|
572 | 572 | } |
573 | 573 | local atlasColors = nil |
574 | 574 | local capTime = 0 |
575 | | - local curMapID = 0 |
576 | 575 | local curMod = nil |
577 | 576 | local path = {136441} |
578 | 577 | local GetIconData = function(icon) |
|
584 | 583 | local GetAreaPOIInfo = C_AreaPoiInfo.GetAreaPOIInfo |
585 | 584 | local GetAtlasInfo = C_Texture.GetAtlasInfo |
586 | 585 | local GetSpellName = C_Spell.GetSpellName |
| 586 | + local GetBestMapForUnit = C_Map.GetBestMapForUnit |
587 | 587 |
|
588 | 588 | local function UpdatePOI() |
| 589 | + local curMapID = GetBestMapForUnit("player") |
589 | 590 | local pois = GetAreaPOIForMap(curMapID) |
590 | 591 | for i = 1, #pois do |
591 | 592 | local tbl = GetAreaPOIInfo(curMapID, pois[i]) |
|
657 | 658 | end |
658 | 659 | end |
659 | 660 |
|
660 | | - local GetBestMapForUnit = C_Map.GetBestMapForUnit |
661 | 661 | function API:StartFlagCaptures(bgcaptime, _, colors) |
662 | 662 | atlasColors = colors |
663 | 663 | capTime = bgcaptime -- cap time |
664 | | - curMapID = GetBestMapForUnit("player") -- current map |
665 | 664 | landmarkCache = {} |
666 | 665 | curMod = self |
667 | | - local pois = GetAreaPOIForMap(curMapID) |
668 | | - for i = 1, #pois do |
669 | | - local tbl = GetAreaPOIInfo(curMapID, pois[i]) |
670 | | - local icon = tbl.textureIndex |
671 | | - local atlasName = tbl.atlasName |
672 | | - if icon then |
673 | | - landmarkCache[tbl.name] = icon |
674 | | - if icon == 2 or icon == 3 or icon == 151 or icon == 153 or icon == 18 or icon == 20 then |
675 | | - -- Horde mine, Alliance mine, Alliance Refinery, Horde Refinery, Alliance Quarry, Horde Quarry |
676 | | - local _, _, _, id = UnitPosition("player") |
677 | | - if id == 30 or id == 628 or id == 2197 then -- Alterac Valley, IoC, Korrak's Revenge (WoW 15th) |
678 | | - local bar = self:StartBar(tbl.name, 3600, GetIconData(icon), (icon == 3 or icon == 151 or icon == 18) and "colorAlliance" or "colorHorde", true) -- Paused bar for mine status |
679 | | - bar:Pause() |
680 | | - bar:SetTimeVisibility(false) |
681 | | - bar:Set("capping:customchat", function() end) |
682 | | - end |
683 | | - end |
684 | | - elseif atlasName then |
685 | | - --local atlasTbl = GetAtlasInfo(atlasName) |
686 | | - landmarkCache[tbl.name] = atlasName |
687 | | - -- This can stay commented out until the day IoC/AV is converted to atlasNames |
688 | | - --if atlasName == 2 or atlasName == 3 or atlasName == 151 or atlasName == 153 or atlasName == 18 or atlasName == 20 then |
689 | | - -- -- Horde mine, Alliance mine, Alliance Refinery, Horde Refinery, Alliance Quarry, Horde Quarry |
690 | | - -- local _, _, _, id = UnitPosition("player") |
691 | | - -- if id == 30 or id == 628 then -- Alterac Valley, IoC |
692 | | - -- local bar = self:StartBar(tbl.name, 3600, GetIconData(icon), (icon == 3 or icon == 151 or icon == 18) and "colorAlliance" or "colorHorde", true) -- Paused bar for mine status |
693 | | - -- bar:Pause() |
694 | | - -- bar:SetTimeVisibility(false) |
695 | | - -- bar:Set("capping:customchat", function() end) |
696 | | - -- end |
697 | | - --end |
698 | | - end |
699 | | - end |
700 | 666 | self:RegisterEvent("AREA_POIS_UPDATED", UpdatePOI) |
701 | 667 | end |
702 | 668 |
|
|
867 | 833 | if zoneIds[id] then |
868 | 834 | prevZone = id |
869 | 835 | self:RegisterEvent("PLAYER_LEAVING_WORLD") |
870 | | - self:Timer(0, function() zoneIds[id]:EnterZone(id) end) |
871 | | - elseif instanceType == "arena" then |
| 836 | + zoneIds[id]:EnterZone(id) |
| 837 | + elseif zoneIds[instanceType] then |
872 | 838 | prevZone = instanceType |
873 | 839 | self:RegisterEvent("PLAYER_LEAVING_WORLD") |
874 | | - self:Timer(0, function() zoneIds[instanceType]:EnterZone(id) end) |
| 840 | + zoneIds[instanceType]:EnterZone(id) |
875 | 841 | end |
876 | 842 | end |
877 | 843 | function core:PLAYER_LEAVING_WORLD() |
|
0 commit comments