- WIP version of optionally hiding TargetOfTarget modules if the player is the active target. everything seems to work except for TargetOfTargetHealth and I'm not quite sure why yet...need to check it out further

This commit is contained in:
Parnic
2010-07-19 19:30:43 +00:00
parent 1ce2c37e96
commit 0a73b2883e
3 changed files with 92 additions and 11 deletions

View File

@ -2,6 +2,8 @@ local AceOO = AceLibrary("AceOO-2.0")
local TargetTargetCast = AceOO.Class(IceCastBar)
local SelfDisplayModeOptions = {"Hide", "Normal"}
-- Constructor --
function TargetTargetCast.prototype:init()
TargetTargetCast.super.prototype.init(self, "TargetTargetCast")
@ -25,6 +27,7 @@ function TargetTargetCast.prototype:GetDefaultSettings()
settings["enabled"] = false
settings["barVerticalOffset"] = 35
settings["scale"] = 0.7
settings["selfDisplayMode"] = "Normal"
return settings
end
@ -43,6 +46,11 @@ function TargetTargetCast.prototype:UpdateTargetTarget()
self:StopBar()
return
end
if self.moduleSettings.selfDisplayMode == "Hide" and UnitIsUnit("player", self.unit) then
self:StopBar()
return
end
local spell = UnitCastingInfo(self.unit)
if (spell) then
@ -129,6 +137,24 @@ function TargetTargetCast.prototype:GetOptions()
end,
order = 29
}
opts["selfDisplayMode"] = {
type = "text",
name = "Self Display Mode",
desc = "What this bar should do whenever the player is the TargetOfTarget",
get = function()
return self.moduleSettings.selfDisplayMode
end,
set = function(value)
self.moduleSettings.selfDisplayMode = value
self:Redraw()
end,
disabled = function()
return not self.moduleSettings.enabled
end,
validate = SelfDisplayModeOptions,
order = 44,
}
return opts
end