mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-06 21:50:00 +00:00
player: replace reset-instances dropdown entry
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user