diff --git a/REPorter.lua b/REPorter.lua index d20c6a8..d501309 100644 --- a/REPorter.lua +++ b/REPorter.lua @@ -7,25 +7,6 @@ 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) @@ -33,7 +14,7 @@ if (UIDROPDOWNMENU_OPEN_PATCH_VERSION or 0) < 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 @@ -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 @@ -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]) diff --git a/REPorter.toc b/REPorter.toc index abb663e..a60b828 100644 --- a/REPorter.toc +++ b/REPorter.toc @@ -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