Skip to content

Commit

Permalink
Attempt to workaround issues on rated Seething Shore
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Feb 14, 2019
1 parent 89d4154 commit 6a5d9be
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 30 deletions.
69 changes: 40 additions & 29 deletions REPorter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,14 @@ local BUCKET = LibStub("AceBucket-3.0")
_G.REPorter = RE

-- UIDropDownMenu taint workaround by foxlit
if (UIDROPDOWNMENU_VALUE_PATCH_VERSION or 0) < 2 then
UIDROPDOWNMENU_VALUE_PATCH_VERSION = 2
hooksecurefunc("UIDropDownMenu_InitializeHelper", function()
if UIDROPDOWNMENU_VALUE_PATCH_VERSION ~= 2 then
return
end
for i=1, UIDROPDOWNMENU_MAXLEVELS do
for j=1, UIDROPDOWNMENU_MAXBUTTONS do
local b = _G["DropDownList" .. i .. "Button" .. j]
if not (issecurevariable(b, "value") or b:IsShown()) then
b.value = nil
repeat
j, b["fx" .. j] = j+1
until issecurevariable(b, "value")
end
end
end
end)
end
if (UIDROPDOWNMENU_OPEN_PATCH_VERSION or 0) < 1 then
UIDROPDOWNMENU_OPEN_PATCH_VERSION = 1
hooksecurefunc("UIDropDownMenu_InitializeHelper", function(frame)
if UIDROPDOWNMENU_OPEN_PATCH_VERSION ~= 1 then
return
end
if UIDROPDOWNMENU_OPEN_MENU and UIDROPDOWNMENU_OPEN_MENU ~= frame
and not issecurevariable(UIDROPDOWNMENU_OPEN_MENU, "displayMode") then
and not issecurevariable(UIDROPDOWNMENU_OPEN_MENU, "displayMode") then
UIDROPDOWNMENU_OPEN_MENU = nil
local t, f, prefix, i = _G, issecurevariable, " \0", 1
repeat
Expand All @@ -42,6 +23,31 @@ if (UIDROPDOWNMENU_OPEN_PATCH_VERSION or 0) < 1 then
end
end)
end
if (COMMUNITY_UIDD_REFRESH_PATCH_VERSION or 0) < 1 then
COMMUNITY_UIDD_REFRESH_PATCH_VERSION = 1
local function CleanDropdowns()
if COMMUNITY_UIDD_REFRESH_PATCH_VERSION ~= 1 then
return
end
local f, f2 = FriendsFrame, FriendsTabHeader
local s = f:IsShown()
f:Hide()
f:Show()
if not f2:IsShown() then
f2:Show()
f2:Hide()
end
if not s then
f:Hide()
end
end
hooksecurefunc("Communities_LoadUI", CleanDropdowns)
hooksecurefunc("SetCVar", function(n)
if n == "lastSelectedClubId" then
CleanDropdowns()
end
end)
end

--GLOBALS: FACTION_ALLIANCE, FACTION_HORDE, HELP_LABEL, ATTACK, HEALTH, BLUE_GEM, RED_GEM, OPTIONS, MAX_RAID_MEMBERS, UIDROPDOWNMENU_VALUE_PATCH_VERSION, UIDROPDOWNMENU_MAXLEVELS, UIDROPDOWNMENU_MAXBUTTONS, UIDROPDOWNMENU_OPEN_PATCH_VERSION, UIDROPDOWNMENU_OPEN_MENU, issecurevariable
local select, pairs, strsplit, tonumber, strfind, print, strupper, next, strmatch, wipe, floor = _G.select, _G.pairs, _G.strsplit, _G.tonumber, _G.strfind, _G.print, _G.strupper, _G.next, _G.strmatch, _G.wipe, _G.floor
Expand Down Expand Up @@ -846,15 +852,20 @@ function RE:OnPOIUpdate()
wipe(RE.VignettePosition)
RE.VignetteInfo = GetVignetteInfo(RE.POIList[i])
RE.VignettePosition = GetVignettePosition(RE.POIList[i], RE.CurrentMap)
local xZ, yZ = RE:Round(RE.VignettePosition.x, 3), RE:Round(RE.VignettePosition.y, 3)
RE.POIInfo = {["areaPoiID"] = RE.VignetteInfo.vignetteID, ["name"] = RE.VignetteInfo.name, ["description"] = "", ["position"] = {["x"] = RE.VignettePosition.x, ["y"] = RE.VignettePosition.y}, ["textureIndex"] = 0, ["atlasID"] = RE.VignetteInfo.atlasName}
if RE.AzeriteNodes[xZ] and RE.AzeriteNodes[xZ][yZ] then
RE.POIInfo.name = RE.AzeriteNodes[xZ][yZ]
end
if RE.VignetteInfo.atlasName == "AzeriteReady" then
RE.POIInfo.textureIndex = 1002
elseif RE.VignetteInfo.atlasName == "AzeriteSpawning" then
RE.POIInfo.textureIndex = 1001
if RE.VignetteInfo and RE.VignettePosition then
local xZ, yZ = RE:Round(RE.VignettePosition.x, 3), RE:Round(RE.VignettePosition.y, 3)
RE.POIInfo = {["areaPoiID"] = RE.VignetteInfo.vignetteID, ["name"] = RE.VignetteInfo.name, ["description"] = "", ["position"] = {["x"] = RE.VignettePosition.x, ["y"] = RE.VignettePosition.y}, ["textureIndex"] = 0, ["atlasID"] = RE.VignetteInfo.atlasName}
if RE.AzeriteNodes[xZ] and RE.AzeriteNodes[xZ][yZ] then
RE.POIInfo.name = RE.AzeriteNodes[xZ][yZ]
end
if RE.VignetteInfo.atlasName == "AzeriteReady" then
RE.POIInfo.textureIndex = 1002
elseif RE.VignetteInfo.atlasName == "AzeriteSpawning" then
RE.POIInfo.textureIndex = 1001
end
else
RE.VignetteInfo = {}
RE.VignettePosition = {}
end
elseif RE.CurrentMap == EOTS and RE.IsRated then
RE.POIInfo = GetAreaPOIInfo(EOTSR, RE.POIList[i])
Expand Down
2 changes: 1 addition & 1 deletion REPorter.toc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Interface: 80100
## Title: |cFF74D06CRE|rPorter
## Notes: Provide battleground map.
## Version: 2.2.1
## Version: 2.2.2
## Author: AcidWeb
## SavedVariables: REPorterSettings
## X-Website: https://www.curseforge.com/wow/addons/reporter-battleground-map
Expand Down

0 comments on commit 6a5d9be

Please sign in to comment.