mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
- added code to resize the clickable region based on the texture the player is using (the previous region didn't fit HiBar very well)
This commit is contained in:
@ -133,8 +133,15 @@ function PlayerHealth.prototype:CreateBackground(redraw)
|
|||||||
end
|
end
|
||||||
|
|
||||||
self.frame.button:ClearAllPoints()
|
self.frame.button:ClearAllPoints()
|
||||||
self.frame.button:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", -6, 0)
|
-- Parnic - kinda hacky, but in order to fit this region to multiple types of bars, we need to do this...
|
||||||
self.frame.button:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMRIGHT", -1 * self.frame:GetWidth()/3, 0)
|
-- would be nice to define this somewhere in data, but for now...here we are
|
||||||
|
if self.settings.barTexture == "HiBar" then
|
||||||
|
self.frame.button:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", 0, 0)
|
||||||
|
self.frame.button:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMRIGHT", -1 * self.frame:GetWidth(), 0)
|
||||||
|
else
|
||||||
|
self.frame.button:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", -6, 0)
|
||||||
|
self.frame.button:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMRIGHT", -1 * self.frame:GetWidth() / 3, 0)
|
||||||
|
end
|
||||||
|
|
||||||
self.frame.button.menu = function()
|
self.frame.button.menu = function()
|
||||||
ToggleDropDownMenu(1, nil, PlayerFrameDropDown, "cursor");
|
ToggleDropDownMenu(1, nil, PlayerFrameDropDown, "cursor");
|
||||||
@ -150,6 +157,13 @@ function PlayerHealth.prototype:CreateBackground(redraw)
|
|||||||
-- set up click casting
|
-- set up click casting
|
||||||
ClickCastFrames = ClickCastFrames or {}
|
ClickCastFrames = ClickCastFrames or {}
|
||||||
ClickCastFrames[self.frame.button] = true
|
ClickCastFrames[self.frame.button] = true
|
||||||
|
|
||||||
|
-- Parnic - debug code for showing the clickable region on this bar
|
||||||
|
-- self.frame.button:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background",
|
||||||
|
-- edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
|
||||||
|
-- tile = false,
|
||||||
|
-- insets = { left = 0, right = 0, top = 0, bottom = 0 }});
|
||||||
|
-- self.frame.button:SetBackdropColor(0,0,0,1);
|
||||||
else
|
else
|
||||||
self.frame.button:EnableMouse(false)
|
self.frame.button:EnableMouse(false)
|
||||||
self.frame.button:RegisterForClicks()
|
self.frame.button:RegisterForClicks()
|
||||||
|
Reference in New Issue
Block a user