mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
- 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:
@ -2,6 +2,8 @@ local AceOO = AceLibrary("AceOO-2.0")
|
||||
|
||||
local TargetTargetMana = AceOO.Class(IceTargetMana)
|
||||
|
||||
local SelfDisplayModeOptions = {"Hide", "Normal"}
|
||||
|
||||
-- Constructor --
|
||||
function TargetTargetMana.prototype:init()
|
||||
TargetTargetMana.super.prototype.init(self, "TargetTargetMana", "targettarget")
|
||||
@ -23,10 +25,35 @@ function TargetTargetMana.prototype:GetDefaultSettings()
|
||||
settings["barVerticalOffset"] = 35
|
||||
settings["scale"] = 0.7
|
||||
settings["enabled"] = false
|
||||
settings["selfDisplayMode"] = "Normal"
|
||||
|
||||
return settings
|
||||
end
|
||||
|
||||
function TargetTargetMana.prototype:GetOptions()
|
||||
local opts = TargetTargetMana.super.prototype.GetOptions(self)
|
||||
|
||||
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
|
||||
|
||||
function TargetTargetMana.prototype:Enable(core)
|
||||
self.registerEvents = false
|
||||
-- make sure the super class doesn't override our color selection
|
||||
@ -45,6 +72,13 @@ end
|
||||
function TargetTargetMana.prototype:Update(unit)
|
||||
self.color = "TargetTargetMana"
|
||||
|
||||
if self.moduleSettings.selfDisplayMode == "Hide" and UnitIsUnit("player", self.unit) then
|
||||
self:Show(false)
|
||||
return
|
||||
end
|
||||
|
||||
self:Show(true)
|
||||
|
||||
local manaType = UnitPowerType(self.unit)
|
||||
|
||||
if (self.moduleSettings.scaleManaColor) then
|
||||
|
Reference in New Issue
Block a user