mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- added an option to hide the new blizzard focus frame in the focus health module
- added an option to make the focus health module clickable to target your focus - fixed a bug in player health's targeting where the clickable area was in the wrong spot when the bar was flipped to the right side
This commit is contained in:
@ -27,7 +27,7 @@ function FocusHealth.prototype:GetDefaultSettings()
|
|||||||
settings["scale"] = 0.7
|
settings["scale"] = 0.7
|
||||||
settings["mobhealth"] = (MobHealth3 ~= nil)
|
settings["mobhealth"] = (MobHealth3 ~= nil)
|
||||||
settings["classColor"] = false
|
settings["classColor"] = false
|
||||||
-- settings["hideBlizz"] = true
|
settings["hideBlizz"] = false
|
||||||
settings["upperText"] = "[PercentHP:Round]"
|
settings["upperText"] = "[PercentHP:Round]"
|
||||||
settings["lowerText"] = ""
|
settings["lowerText"] = ""
|
||||||
settings["raidIconOnTop"] = true
|
settings["raidIconOnTop"] = true
|
||||||
@ -37,6 +37,7 @@ function FocusHealth.prototype:GetDefaultSettings()
|
|||||||
settings["lockIconAlpha"] = false
|
settings["lockIconAlpha"] = false
|
||||||
settings["abbreviateHealth"] = true
|
settings["abbreviateHealth"] = true
|
||||||
settings["barVerticalOffset"] = 35
|
settings["barVerticalOffset"] = 35
|
||||||
|
settings["allowMouseInteraction"] = false
|
||||||
|
|
||||||
return settings
|
return settings
|
||||||
end
|
end
|
||||||
@ -79,7 +80,7 @@ function FocusHealth.prototype:GetOptions()
|
|||||||
end,
|
end,
|
||||||
order = 41
|
order = 41
|
||||||
}
|
}
|
||||||
--[[
|
|
||||||
opts["hideBlizz"] = {
|
opts["hideBlizz"] = {
|
||||||
type = "toggle",
|
type = "toggle",
|
||||||
name = "Hide Blizzard Frame",
|
name = "Hide Blizzard Frame",
|
||||||
@ -100,7 +101,7 @@ function FocusHealth.prototype:GetOptions()
|
|||||||
end,
|
end,
|
||||||
order = 42
|
order = 42
|
||||||
}
|
}
|
||||||
]]
|
|
||||||
opts["scaleHealthColor"] = {
|
opts["scaleHealthColor"] = {
|
||||||
type = "toggle",
|
type = "toggle",
|
||||||
name = "Color bar by health %",
|
name = "Color bar by health %",
|
||||||
@ -227,6 +228,24 @@ function FocusHealth.prototype:GetOptions()
|
|||||||
order = 40.1
|
order = 40.1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts["allowClickTarget"] = {
|
||||||
|
type = 'toggle',
|
||||||
|
name = 'Allow click-targeting',
|
||||||
|
desc = 'Whether or not to allow click targeting/casting for this bar (Note: does not work properly with HiBar, have to click near the base of the bar)',
|
||||||
|
get = function()
|
||||||
|
return self.moduleSettings.allowMouseInteraction
|
||||||
|
end,
|
||||||
|
set = function(v)
|
||||||
|
self.moduleSettings.allowMouseInteraction = v
|
||||||
|
self:Redraw()
|
||||||
|
end,
|
||||||
|
disabled = function()
|
||||||
|
return not self.moduleSettings.enabled
|
||||||
|
end,
|
||||||
|
usage = '',
|
||||||
|
order = 43,
|
||||||
|
}
|
||||||
|
|
||||||
return opts
|
return opts
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -241,15 +260,64 @@ function FocusHealth.prototype:Enable(core)
|
|||||||
self:RegisterEvent("RAID_TARGET_UPDATE", "UpdateRaidFocusIcon")
|
self:RegisterEvent("RAID_TARGET_UPDATE", "UpdateRaidFocusIcon")
|
||||||
self:RegisterEvent("PLAYER_FOCUS_CHANGED", "UpdateFocus")
|
self:RegisterEvent("PLAYER_FOCUS_CHANGED", "UpdateFocus")
|
||||||
|
|
||||||
-- if (self.moduleSettings.hideBlizz) then
|
if (self.moduleSettings.hideBlizz) then
|
||||||
-- self:HideBlizz()
|
self:HideBlizz()
|
||||||
-- end
|
end
|
||||||
|
|
||||||
self:CreateRaidIconFrame()
|
self:CreateRaidIconFrame()
|
||||||
|
|
||||||
self:Update(self.unit)
|
self:Update(self.unit)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function FocusHealth.prototype:CreateBackground()
|
||||||
|
FocusHealth.super.prototype.CreateBackground(self)
|
||||||
|
|
||||||
|
if not self.frame.button then
|
||||||
|
self.frame.button = CreateFrame("Button", "IceHUD_FocusClickFrame", self.frame, "SecureUnitButtonTemplate")
|
||||||
|
end
|
||||||
|
|
||||||
|
self.frame.button:ClearAllPoints()
|
||||||
|
-- Parnic - kinda hacky, but in order to fit this region to multiple types of bars, we need to do this...
|
||||||
|
-- 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
|
||||||
|
if self.moduleSettings.side == IceCore.Side.Left then
|
||||||
|
self.frame.button:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", -6, 0)
|
||||||
|
self.frame.button:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMRIGHT", -1 * self.frame:GetWidth() / 3, 0)
|
||||||
|
else
|
||||||
|
self.frame.button:SetPoint("TOPLEFT", self.frame, "TOPLEFT", 6, 0)
|
||||||
|
self.frame.button:SetPoint("BOTTOMRIGHT", self.frame, "BOTTOMRIGHT", -1 * self.frame:GetWidth() / 1.5, 0)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self:EnableClickTargeting(self.moduleSettings.allowMouseInteraction)
|
||||||
|
end
|
||||||
|
|
||||||
|
function FocusHealth.prototype:EnableClickTargeting(bEnable)
|
||||||
|
if bEnable then
|
||||||
|
self.frame.button:EnableMouse(true)
|
||||||
|
self.frame.button:RegisterForClicks("LeftButtonUp")
|
||||||
|
self.frame.button:SetAttribute("type1", "target")
|
||||||
|
self.frame.button:SetAttribute("unit", self.unit)
|
||||||
|
|
||||||
|
-- set up click casting
|
||||||
|
ClickCastFrames = ClickCastFrames or {}
|
||||||
|
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
|
||||||
|
self.frame.button:EnableMouse(false)
|
||||||
|
self.frame.button:RegisterForClicks()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function FocusHealth.prototype:UpdateFocus()
|
function FocusHealth.prototype:UpdateFocus()
|
||||||
self:Update(self.unit)
|
self:Update(self.unit)
|
||||||
end
|
end
|
||||||
@ -394,26 +462,27 @@ function FocusHealth.prototype:MathRound(num, idp)
|
|||||||
return math.floor(num * mult + 0.5) / mult
|
return math.floor(num * mult + 0.5) / mult
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[
|
|
||||||
function FocusHealth.prototype:ShowBlizz()
|
function FocusHealth.prototype:ShowBlizz()
|
||||||
FocusFrame:Show()
|
FocusFrame:Show()
|
||||||
FocusFrame:RegisterEvent("PLAYER_TARGET_CHANGED")
|
|
||||||
FocusFrame:RegisterEvent("UNIT_HEALTH")
|
FocusFrame:RegisterEvent("PLAYER_ENTERING_WORLD");
|
||||||
FocusFrame:RegisterEvent("UNIT_LEVEL")
|
FocusFrame:RegisterEvent("PLAYER_FOCUS_CHANGED");
|
||||||
FocusFrame:RegisterEvent("UNIT_FACTION")
|
FocusFrame:RegisterEvent("UNIT_HEALTH");
|
||||||
FocusFrame:RegisterEvent("UNIT_CLASSIFICATION_CHANGED")
|
FocusFrame:RegisterEvent("UNIT_LEVEL");
|
||||||
FocusFrame:RegisterEvent("UNIT_AURA")
|
FocusFrame:RegisterEvent("UNIT_FACTION");
|
||||||
FocusFrame:RegisterEvent("PLAYER_FLAGS_CHANGED")
|
FocusFrame:RegisterEvent("UNIT_CLASSIFICATION_CHANGED");
|
||||||
FocusFrame:RegisterEvent("PARTY_MEMBERS_CHANGED")
|
FocusFrame:RegisterEvent("UNIT_AURA");
|
||||||
FocusFrame:RegisterEvent("RAID_TARGET_UPDATE")
|
FocusFrame:RegisterEvent("PLAYER_FLAGS_CHANGED");
|
||||||
|
FocusFrame:RegisterEvent("PARTY_MEMBERS_CHANGED");
|
||||||
|
FocusFrame:RegisterEvent("RAID_TARGET_UPDATE");
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function FocusHealth.prototype:HideBlizz()
|
function FocusHealth.prototype:HideBlizz()
|
||||||
FocusFrame:Hide()
|
FocusFrame:Hide()
|
||||||
|
|
||||||
FocusFrame:UnregisterAllEvents()
|
FocusFrame:UnregisterAllEvents()
|
||||||
end
|
end
|
||||||
]]
|
|
||||||
|
|
||||||
-- Load us up
|
-- Load us up
|
||||||
IceHUD.FocusHealth = FocusHealth:new()
|
IceHUD.FocusHealth = FocusHealth:new()
|
||||||
|
@ -526,8 +526,13 @@ function PlayerHealth.prototype:CreateBackground(redraw)
|
|||||||
self.frame.button:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", 0, 0)
|
self.frame.button:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", 0, 0)
|
||||||
self.frame.button:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMRIGHT", -1 * self.frame:GetWidth(), 0)
|
self.frame.button:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMRIGHT", -1 * self.frame:GetWidth(), 0)
|
||||||
else
|
else
|
||||||
self.frame.button:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", -6, 0)
|
if self.moduleSettings.side == IceCore.Side.Left then
|
||||||
self.frame.button:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMRIGHT", -1 * self.frame:GetWidth() / 3, 0)
|
self.frame.button:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", -6, 0)
|
||||||
|
self.frame.button:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMRIGHT", -1 * self.frame:GetWidth() / 3, 0)
|
||||||
|
else
|
||||||
|
self.frame.button:SetPoint("TOPLEFT", self.frame, "TOPLEFT", 6, 0)
|
||||||
|
self.frame.button:SetPoint("BOTTOMRIGHT", self.frame, "BOTTOMRIGHT", -1 * self.frame:GetWidth() / 1.5, 0)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
self.frame.button.menu = function()
|
self.frame.button.menu = function()
|
||||||
|
Reference in New Issue
Block a user