mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-30 11:10:00 +00:00
player: clean up dropdown code
This commit is contained in:
+3
-1
@@ -991,7 +991,9 @@ function pfUI.uf:ClickAction(button)
|
||||
-- dropdown menues
|
||||
if button == "RightButton" then
|
||||
if label == "player" then
|
||||
ToggleDropDownMenu(1, nil, pfUI.uf.player.Dropdown,"cursor")
|
||||
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")
|
||||
elseif label == "pet" then
|
||||
|
||||
+5
-6
@@ -40,15 +40,14 @@ pfUI:RegisterModule("player", function ()
|
||||
pfUI.uf.player:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOM", -75, 125)
|
||||
UpdateMovable(pfUI.uf.player)
|
||||
|
||||
pfUI.uf.player.Dropdown = getglobal("PlayerFrameDropDown")
|
||||
function pfUI.uf.player.Dropdowni()
|
||||
-- add reset button when alone
|
||||
if not (UnitInRaid("player") or GetNumPartyMembers() > 0) then
|
||||
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
|
||||
end
|
||||
UnitPopup_ShowMenu(pfUI.uf.player.Dropdown, "SELF", "player")
|
||||
end
|
||||
UIDropDownMenu_Initialize(pfUI.uf.player.Dropdown, pfUI.uf.player.Dropdowni, "MENU")
|
||||
|
||||
pfUI.uf.player:RegisterEvent("UPDATE_FACTION") -- pvp icon
|
||||
pfUI.uf.player:RegisterEvent("UNIT_FACTION") -- pvp icon
|
||||
|
||||
Reference in New Issue
Block a user