- 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:
Parnic
2008-09-26 18:08:56 +00:00
parent 0f772761fb
commit 20e8113306
2 changed files with 57 additions and 2 deletions

View File

@ -23,6 +23,7 @@ function PlayerHealth.prototype:GetDefaultSettings()
settings["upperText"] = "[PercentHP:Round]" settings["upperText"] = "[PercentHP:Round]"
settings["lowerText"] = "[FractionalHP:HPColor:Bracket]" settings["lowerText"] = "[FractionalHP:HPColor:Bracket]"
settings["allowMouseInteraction"] = true settings["allowMouseInteraction"] = true
settings["allowMouseInteractionCombat"] = false
settings["lockIconAlpha"] = false settings["lockIconAlpha"] = false
settings["showStatusIcon"] = true settings["showStatusIcon"] = true
@ -153,6 +154,24 @@ function PlayerHealth.prototype:GetOptions()
order = 43 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"] = opts["iconSettings"] =
{ {
type = 'group', type = 'group',
@ -515,7 +534,12 @@ function PlayerHealth.prototype:CreateBackground(redraw)
ToggleDropDownMenu(1, nil, PlayerFrameDropDown, "cursor"); ToggleDropDownMenu(1, nil, PlayerFrameDropDown, "cursor");
end 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:EnableMouse(true)
self.frame.button:RegisterForClicks("AnyUp") self.frame.button:RegisterForClicks("AnyUp")
self.frame.button:SetAttribute("type1", "target") self.frame.button:SetAttribute("type1", "target")
@ -573,6 +597,16 @@ end
function PlayerHealth.prototype:CheckCombat() function PlayerHealth.prototype:CheckCombat()
PlayerHealth.super.prototype.CheckCombat(self) 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 self.combat or configMode then
if (configMode or self.moduleSettings.showStatusIcon) and not self.frame.statusIcon 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, self.frame.statusIcon = self:CreateTexCoord(self.frame.statusIcon, "Interface\\CharacterFrame\\UI-StateIcon", 20, 20,

View File

@ -48,6 +48,26 @@ function TargetOfTarget.prototype:GetOptions()
order = 31 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"] = { opts["showDebuffs"] = {
type = "toggle", type = "toggle",
name = "Show stacking debuffs", name = "Show stacking debuffs",
@ -166,6 +186,7 @@ end
function TargetOfTarget.prototype:GetDefaultSettings() function TargetOfTarget.prototype:GetDefaultSettings()
local defaults = TargetOfTarget.super.prototype.GetDefaultSettings(self) local defaults = TargetOfTarget.super.prototype.GetDefaultSettings(self)
defaults["vpos"] = -130 defaults["vpos"] = -130
defaults["hpos"] = 0
defaults["showDebuffs"] = true defaults["showDebuffs"] = true
defaults["fontSize"] = 15 defaults["fontSize"] = 15
defaults["mouse"] = true defaults["mouse"] = true
@ -222,7 +243,7 @@ function TargetOfTarget.prototype:CreateFrame()
self.frame:SetWidth(self.moduleSettings.totWidth) self.frame:SetWidth(self.moduleSettings.totWidth)
end end
self.frame:SetHeight(self.height) 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) self.frame:SetScale(self.moduleSettings.scale)