mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- added user-requested toggle to color the TargetHealth bar by hostility if the target is an NPC and the bar is set to use class coloring (instead of health % coloring)
- cleaned up the options and options dependencies a bit in the target health module
This commit is contained in:
@ -58,6 +58,7 @@ function IceTargetHealth.prototype:GetDefaultSettings()
|
|||||||
settings["PvPIconScale"] = 1.0
|
settings["PvPIconScale"] = 1.0
|
||||||
settings["PvPIconOnTop"] = false
|
settings["PvPIconOnTop"] = false
|
||||||
settings["allowMouseInteraction"] = false
|
settings["allowMouseInteraction"] = false
|
||||||
|
settings["npcHostilityColor"] = false
|
||||||
|
|
||||||
return settings
|
return settings
|
||||||
end
|
end
|
||||||
@ -70,7 +71,7 @@ function IceTargetHealth.prototype:GetOptions()
|
|||||||
opts["classColor"] = {
|
opts["classColor"] = {
|
||||||
type = "toggle",
|
type = "toggle",
|
||||||
name = "Class color bar",
|
name = "Class color bar",
|
||||||
desc = "Use class color as the bar color instead of reaction color",
|
desc = "Use class color as the bar color instead of reaction color\n\n(Note: The 'color bar by health %' setting overrides this)",
|
||||||
get = function()
|
get = function()
|
||||||
return self.moduleSettings.classColor
|
return self.moduleSettings.classColor
|
||||||
end,
|
end,
|
||||||
@ -79,11 +80,28 @@ function IceTargetHealth.prototype:GetOptions()
|
|||||||
self:Update(self.unit)
|
self:Update(self.unit)
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled
|
return not self.moduleSettings.enabled or self.moduleSettings.scaleHealthColor
|
||||||
end,
|
end,
|
||||||
order = 41
|
order = 41
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts["npcHostilityColor"] = {
|
||||||
|
type = "toggle",
|
||||||
|
name = "Color NPC's by hostility",
|
||||||
|
desc = "If you are using the 'class color bar' setting above, then enabling this will color NPC's by their hostility toward you since NPC class isn't very helpful or applicable information.",
|
||||||
|
get = function()
|
||||||
|
return self.moduleSettings.npcHostilityColor
|
||||||
|
end,
|
||||||
|
set = function(v)
|
||||||
|
self.moduleSettings.npcHostilityColor = v
|
||||||
|
self:Redraw()
|
||||||
|
end,
|
||||||
|
disabled = function()
|
||||||
|
return not self.moduleSettings.enabled or not self.moduleSettings.classColor or self.moduleSettings.scaleHealthColor
|
||||||
|
end,
|
||||||
|
order = 41.5
|
||||||
|
}
|
||||||
|
|
||||||
opts["hideBlizz"] = {
|
opts["hideBlizz"] = {
|
||||||
type = "toggle",
|
type = "toggle",
|
||||||
name = "Hide Blizzard Frame",
|
name = "Hide Blizzard Frame",
|
||||||
@ -126,7 +144,7 @@ function IceTargetHealth.prototype:GetOptions()
|
|||||||
opts["scaleHealthColor"] = {
|
opts["scaleHealthColor"] = {
|
||||||
type = "toggle",
|
type = "toggle",
|
||||||
name = "Color bar by health %",
|
name = "Color bar by health %",
|
||||||
desc = "Colors the health bar from MaxHealthColor to MinHealthColor based on current health %",
|
desc = "Colors the health bar from MaxHealthColor to MinHealthColor based on current health %\n\n(Note: This overrides the 'class color bar' setting. Disable this to use class coloring)",
|
||||||
get = function()
|
get = function()
|
||||||
return self.moduleSettings.scaleHealthColor
|
return self.moduleSettings.scaleHealthColor
|
||||||
end,
|
end,
|
||||||
@ -647,7 +665,7 @@ function IceTargetHealth.prototype:Update(unit)
|
|||||||
self.color = "TargetHealthHostile"
|
self.color = "TargetHealthHostile"
|
||||||
end
|
end
|
||||||
|
|
||||||
if (self.moduleSettings.classColor) then
|
if (self.moduleSettings.classColor) and (not self.moduleSettings.npcHostilityColor or UnitPlayerControlled("target")) then
|
||||||
self.color = self.unitClass
|
self.color = self.unitClass
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user