Restore context menus for Health and Info modules

Apparently we don't have to do any of this anymore (and might not have had to do it for a long time, but I missed the memo) so if we can, just use the built-in menuing stuff. Setting focus doesn't trigger taint with this.
This commit is contained in:
Parnic
2024-07-25 22:25:55 -05:00
parent 8a3f9e19d0
commit e94138d201
6 changed files with 14 additions and 7 deletions

View File

@ -714,7 +714,7 @@ function IceTargetHealth.prototype:CreateBackground(redraw)
end
end
if not self.frame.button.menu then
if not self.frame.button.menu and UnitPopup_ShowMenu then
self.frame.button.menu = function(this, unit)
IceHUD.DropdownUnit = unit
ToggleDropDownMenu(1, nil, IceHUD_UnitFrame_DropDown, "cursor")
@ -733,7 +733,7 @@ function IceTargetHealth.prototype:EnableClickTargeting(bEnable)
self.frame.button:EnableMouse(true)
self.frame.button:RegisterForClicks("AnyUp")
self.frame.button:SetAttribute("type1", "target")
self.frame.button:SetAttribute("type2", "menu")
self.frame.button:SetAttribute("type2", UnitPopup_ShowMenu and "menu" or "togglemenu")
self.frame.button:SetAttribute("unit", self.unit)
-- set up click casting