From 34ca35cc592e14c04e23b3c57ae09e1426687055 Mon Sep 17 00:00:00 2001 From: Parnic Date: Tue, 28 Dec 2010 06:42:34 +0000 Subject: [PATCH] - another attempt at fixing stack overflow related to dropdown menus for secure frames --- modules/PlayerHealth.lua | 8 +++++--- modules/TargetHealth.lua | 8 +++++--- modules/TargetInfo.lua | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/modules/PlayerHealth.lua b/modules/PlayerHealth.lua index ac1a975..e58f81c 100644 --- a/modules/PlayerHealth.lua +++ b/modules/PlayerHealth.lua @@ -854,9 +854,11 @@ function PlayerHealth.prototype:CreateBackground(redraw) end end - self.frame.button.menu = function() - IceHUD.DropdownUnit = self.unit - ToggleDropDownMenu(1, nil, IceHUD_UnitFrame_DropDown, "cursor") + if not self.frame.button.menu then + self.frame.button.menu = function(this, unit) + IceHUD.DropdownUnit = unit + ToggleDropDownMenu(1, nil, IceHUD_UnitFrame_DropDown, "cursor") + end end self:EnableClickTargeting(self.moduleSettings.allowMouseInteraction) diff --git a/modules/TargetHealth.lua b/modules/TargetHealth.lua index c00a0db..01357d8 100644 --- a/modules/TargetHealth.lua +++ b/modules/TargetHealth.lua @@ -699,9 +699,11 @@ function IceTargetHealth.prototype:CreateBackground(redraw) end end - self.frame.button.menu = function() - IceHUD.DropdownUnit = self.unit - ToggleDropDownMenu(1, nil, IceHUD_UnitFrame_DropDown, "cursor") + if not self.frame.button.menu then + self.frame.button.menu = function(this, unit) + IceHUD.DropdownUnit = unit + ToggleDropDownMenu(1, nil, IceHUD_UnitFrame_DropDown, "cursor") + end end end end diff --git a/modules/TargetInfo.lua b/modules/TargetInfo.lua index 20de401..1bcde3d 100644 --- a/modules/TargetInfo.lua +++ b/modules/TargetInfo.lua @@ -1037,8 +1037,8 @@ do -- OVERRIDE: IceTargetInfo.prototype:CreateFrame(redraw) self.frame:SetAttribute("unit", self.unit) if not self.frame.menu then - self.frame.menu = function() - IceHUD.DropdownUnit = self.unit + self.frame.menu = function(this, unit) + IceHUD.DropdownUnit = unit ToggleDropDownMenu(1, nil, IceHUD_UnitFrame_DropDown, "cursor") end end