mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
- added horizontal positioning option to the ToT module by request
- added an option to disable click-targeting while in combat by request
This commit is contained in:
@ -23,6 +23,7 @@ function PlayerHealth.prototype:GetDefaultSettings()
|
||||
settings["upperText"] = "[PercentHP:Round]"
|
||||
settings["lowerText"] = "[FractionalHP:HPColor:Bracket]"
|
||||
settings["allowMouseInteraction"] = true
|
||||
settings["allowMouseInteractionCombat"] = false
|
||||
settings["lockIconAlpha"] = false
|
||||
|
||||
settings["showStatusIcon"] = true
|
||||
@ -153,6 +154,24 @@ function PlayerHealth.prototype:GetOptions()
|
||||
order = 43
|
||||
}
|
||||
|
||||
opts["allowClickTargetCombat"] = {
|
||||
type = 'toggle',
|
||||
name = 'Allow click-targeting in combat',
|
||||
desc = 'Whether or not to allow click targeting/casting and the player drop-down menu for this bar while the player is in combat (Note: does not work properly with HiBar, have to click near the base of the bar)',
|
||||
get = function()
|
||||
return self.moduleSettings.allowMouseInteractionCombat
|
||||
end,
|
||||
set = function(v)
|
||||
self.moduleSettings.allowMouseInteractionCombat = v
|
||||
self:CreateBackground(true)
|
||||
end,
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled or not self.moduleSettings.allowMouseInteraction
|
||||
end,
|
||||
usage = '',
|
||||
order = 43.5
|
||||
}
|
||||
|
||||
opts["iconSettings"] =
|
||||
{
|
||||
type = 'group',
|
||||
@ -515,7 +534,12 @@ function PlayerHealth.prototype:CreateBackground(redraw)
|
||||
ToggleDropDownMenu(1, nil, PlayerFrameDropDown, "cursor");
|
||||
end
|
||||
|
||||
if self.moduleSettings.allowMouseInteraction then
|
||||
self:EnableClickTargeting(self.moduleSettings.allowMouseInteraction)
|
||||
end
|
||||
|
||||
|
||||
function PlayerHealth.prototype:EnableClickTargeting(bEnable)
|
||||
if bEnable then
|
||||
self.frame.button:EnableMouse(true)
|
||||
self.frame.button:RegisterForClicks("AnyUp")
|
||||
self.frame.button:SetAttribute("type1", "target")
|
||||
@ -573,6 +597,16 @@ end
|
||||
function PlayerHealth.prototype:CheckCombat()
|
||||
PlayerHealth.super.prototype.CheckCombat(self)
|
||||
|
||||
if self.combat then
|
||||
if self.moduleSettings.allowMouseInteraction and not self.moduleSettings.allowMouseInteractionCombat then
|
||||
self:EnableClickTargeting(false)
|
||||
end
|
||||
else
|
||||
if self.moduleSettings.allowMouseInteraction and not self.moduleSettings.allowMouseInteractionCombat then
|
||||
self:EnableClickTargeting(true)
|
||||
end
|
||||
end
|
||||
|
||||
if self.combat or configMode then
|
||||
if (configMode or self.moduleSettings.showStatusIcon) and not self.frame.statusIcon then
|
||||
self.frame.statusIcon = self:CreateTexCoord(self.frame.statusIcon, "Interface\\CharacterFrame\\UI-StateIcon", 20, 20,
|
||||
|
@ -48,6 +48,26 @@ function TargetOfTarget.prototype:GetOptions()
|
||||
order = 31
|
||||
}
|
||||
|
||||
opts["hpos"] = {
|
||||
type = "range",
|
||||
name = "Horizontal Position",
|
||||
desc = "Horizontal Position",
|
||||
get = function()
|
||||
return self.moduleSettings.hpos
|
||||
end,
|
||||
set = function(v)
|
||||
self.moduleSettings.hpos = v
|
||||
self:Redraw()
|
||||
end,
|
||||
min = -500,
|
||||
max = 500,
|
||||
step = 10,
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
order = 31.5
|
||||
}
|
||||
|
||||
opts["showDebuffs"] = {
|
||||
type = "toggle",
|
||||
name = "Show stacking debuffs",
|
||||
@ -166,6 +186,7 @@ end
|
||||
function TargetOfTarget.prototype:GetDefaultSettings()
|
||||
local defaults = TargetOfTarget.super.prototype.GetDefaultSettings(self)
|
||||
defaults["vpos"] = -130
|
||||
defaults["hpos"] = 0
|
||||
defaults["showDebuffs"] = true
|
||||
defaults["fontSize"] = 15
|
||||
defaults["mouse"] = true
|
||||
@ -222,7 +243,7 @@ function TargetOfTarget.prototype:CreateFrame()
|
||||
self.frame:SetWidth(self.moduleSettings.totWidth)
|
||||
end
|
||||
self.frame:SetHeight(self.height)
|
||||
self.frame:SetPoint("TOP", self.parent, "TOP", 0, self.moduleSettings.vpos)
|
||||
self.frame:SetPoint("TOP", self.parent, "TOP", self.moduleSettings.hpos, self.moduleSettings.vpos)
|
||||
self.frame:SetScale(self.moduleSettings.scale)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user