player: replace reset-instances dropdown entry

This commit is contained in:
shagu
2017-07-24 13:28:42 +02:00
parent bd452ca9e3
commit 11e938ac5e
2 changed files with 9 additions and 9 deletions
-2
View File
@@ -953,8 +953,6 @@ function pfUI.uf:ClickAction(button)
-- dropdown menues
if button == "RightButton" then
if label == "player" then
UIDropDownMenu_Initialize(PlayerFrameDropDown, pfUI.uf.player.dropdown.Init, "MENU")
pfUI.uf.player.dropdown.rebuild = true
ToggleDropDownMenu(1, nil, PlayerFrameDropDown, "cursor")
elseif label == "target" then
ToggleDropDownMenu(1, nil, TargetFrameDropDown, "cursor")
+9 -7
View File
@@ -40,14 +40,16 @@ pfUI:RegisterModule("player", function ()
pfUI.uf.player:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOM", -75, 125)
UpdateMovable(pfUI.uf.player)
pfUI.uf.player.dropdown = {}
function pfUI.uf.player.dropdown:Init()
UnitPopup_ShowMenu(PlayerFrameDropDown, "SELF", "player")
if pfUI.uf.player.dropdown.rebuild and not CanShowResetInstances() then
UIDropDownMenu_AddButton({text = RESET_INSTANCES, func = ResetInstances, notCheckable = 1}, 1)
pfUI.uf.player.dropdown.rebuild = nil
-- Replace default's RESET_INSTANCES button with an always working one
UnitPopupButtons["RESET_INSTANCES_FIX"] = { text = RESET_INSTANCES, dist = 0 };
UnitPopupMenus["SELF"] = { "LOOT_METHOD", "LOOT_THRESHOLD", "LOOT_PROMOTE", "LEAVE", "RESET_INSTANCES_FIX", "RAID_TARGET_ICON", "CANCEL" };
hooksecurefunc("UnitPopup_OnClick", function()
local button = this.value
if button == "RESET_INSTANCES_FIX" then
StaticPopup_Show("CONFIRM_RESET_INSTANCES")
end
end
end)
pfUI.uf.player:RegisterEvent("UPDATE_FACTION") -- pvp icon
pfUI.uf.player:RegisterEvent("UNIT_FACTION") -- pvp icon