From f15dda769d12119413fcd79eca5fa0560cd1633a Mon Sep 17 00:00:00 2001 From: Parnic Date: Sun, 21 Jul 2024 13:54:45 -0500 Subject: [PATCH] Fix popup menu replacement code error on 11.0.2 (temp) This removes the menu replacement code that is preventing errors when trying to focus someone or dismiss a pet through a right-click menu on an addon. There is a new API, UnitPopup_OpenMenu, that is a replacement for ShowMenu, but it's not a drop-in replacement, so until I have access to the beta or an 11.0.2 PTR there's not much I can do here. --- IceHUD.lua | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/IceHUD.lua b/IceHUD.lua index deb64ad..4303096 100644 --- a/IceHUD.lua +++ b/IceHUD.lua @@ -1010,17 +1010,20 @@ if UnitPopupFrames then end IceHUD.DropdownUnit = nil -UIDropDownMenu_Initialize(IceHUD_UnitFrame_DropDown, function() - if not IceHUD.DropdownUnit then - return - end +-- todo: update for new UnitPopup_OpenMenu() API +if UnitPopup_ShowMenu then + UIDropDownMenu_Initialize(IceHUD_UnitFrame_DropDown, function() + if not IceHUD.DropdownUnit then + return + end - local menu, id = figure_unit_menu(IceHUD.DropdownUnit) - if menu then - menu = IceHUD.MungeUnitMenu(menu) - UnitPopup_ShowMenu(IceHUD_UnitFrame_DropDown, menu, IceHUD.DropdownUnit, nil, id) - end -end, "MENU", nil) + local menu, id = figure_unit_menu(IceHUD.DropdownUnit) + if menu then + menu = IceHUD.MungeUnitMenu(menu) + UnitPopup_ShowMenu(IceHUD_UnitFrame_DropDown, menu, IceHUD.DropdownUnit, nil, id) + end + end, "MENU", nil) +end function IceHUD:OutOfCombatWrapper(func) return function(...)