mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- fixed yet more closure garbage being generated in the totems module. eventually i'm going to find all of it.
This commit is contained in:
@ -333,7 +333,19 @@ function Totems.prototype:CreateTotem(i, name)
|
|||||||
self.frame.graphical[i]:SetPoint("TOPLEFT", 0, -1 * ((i-1) * (self.totemSize-(MAX_TOTEMS - 1)) + (i-1) + ((i-1) * self.moduleSettings.totemGap)))
|
self.frame.graphical[i]:SetPoint("TOPLEFT", 0, -1 * ((i-1) * (self.totemSize-(MAX_TOTEMS - 1)) + (i-1) + ((i-1) * self.moduleSettings.totemGap)))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not self.graphicalOnEnter then
|
||||||
|
self.graphicalOnEnter = function(button) GameTooltip:SetOwner(button); GameTooltip:SetTotem(button.slot) end
|
||||||
|
end
|
||||||
|
if not self.graphicalOnLeave then
|
||||||
|
self.graphicalOnLeave = function() GameTooltip:Hide() end
|
||||||
|
end
|
||||||
|
if not self.graphicalOnMouseUp then
|
||||||
|
self.graphicalOnMouseUp = function (self, mouseButton)
|
||||||
|
if mouseButton == "RightButton" then
|
||||||
|
DestroyTotem(self.slot)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
self.frame.graphical[i].cd:SetFrameStrata("BACKGROUND")
|
self.frame.graphical[i].cd:SetFrameStrata("BACKGROUND")
|
||||||
self.frame.graphical[i].cd:SetFrameLevel(self.frame.graphical[i]:GetFrameLevel()+1)
|
self.frame.graphical[i].cd:SetFrameLevel(self.frame.graphical[i]:GetFrameLevel()+1)
|
||||||
@ -356,15 +368,11 @@ function Totems.prototype:CreateTotem(i, name)
|
|||||||
|
|
||||||
self.frame.graphical[i]:EnableMouse(true)
|
self.frame.graphical[i]:EnableMouse(true)
|
||||||
self.frame.graphical[i].slot = i;
|
self.frame.graphical[i].slot = i;
|
||||||
self.frame.graphical[i]:SetScript("OnEnter", function(button) GameTooltip:SetOwner(button); GameTooltip:SetTotem(button.slot) end)
|
self.frame.graphical[i]:SetScript("OnEnter", self.graphicalOnEnter)
|
||||||
self.frame.graphical[i]:SetScript("OnLeave", function() GameTooltip:Hide() end)
|
self.frame.graphical[i]:SetScript("OnLeave", self.graphicalOnLeave)
|
||||||
-- it looks like HookScript will continue to add handlers every time instead of replacing them like SetScript
|
-- it looks like HookScript will continue to add handlers every time instead of replacing them like SetScript
|
||||||
if (bWasNewFrame) then
|
if (bWasNewFrame) then
|
||||||
self.frame.graphical[i]:HookScript("OnMouseUp", function (self, mouseButton)
|
self.frame.graphical[i]:HookScript("OnMouseUp", self.graphicalOnMouseUp)
|
||||||
if ( mouseButton == "RightButton" ) then
|
|
||||||
DestroyTotem(self.slot);
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user