From e9d05b1cb0691ebfd5d28ecb06801baed3125de2 Mon Sep 17 00:00:00 2001 From: Parnic Date: Mon, 23 Dec 2013 06:21:33 +0000 Subject: [PATCH] - Integrated a feature by slippycheeze that enables the current threat target's name to be displayed in the "lower text" portion of the Threat bar. http://www.wowace.com/addons/ice-hud/tickets/176-show-name-of-threat-holder-and-color-based-on-their/ --- modules/Threat.lua | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/modules/Threat.lua b/modules/Threat.lua index 35f9ebc..4ee8b2c 100644 --- a/modules/Threat.lua +++ b/modules/Threat.lua @@ -58,6 +58,7 @@ function IceThreat.prototype:GetDefaultSettings() settings["displaySecondPlaceThreat"] = true settings["secondPlaceThreatAlpha"] = 0.75 settings["bAllowExpand"] = false + settings["showTankName"] = true return settings end @@ -176,6 +177,23 @@ function IceThreat.prototype:GetOptions() order = 27.9 } + opts["showTankName"] = { + type = 'toggle', + name = L["Show tank name"], + desc = L["Shows the name of the threat holder colorized by his or her role"], + get = function() + return self.moduleSettings.showTankName + end, + set = function(info, v) + self.moduleSettings.showTankName = v + self:Redraw() + end, + disabled = function() + return not self.moduleSettings.enabled + end, + order = 29.1, + } + return opts end @@ -327,7 +345,22 @@ threatValue = 100 -- set percentage text self:SetBottomText1( IceHUD:MathRound(self.moduleSettings.showScaledThreat and scaledPercent or rawPercent) .. "%" ) - self:SetBottomText2() + if not self.moduleSettings.showTankName or isTanking then + -- nothing if we are the target + self:SetBottomText2() + else + -- display the name of the current threat holder + local name = select(1, UnitName("targettarget")) + local color + if UnitGroupRolesAssigned("targettarget") == "TANK" or GetPartyAssignment("MAINTANK", "targettarget") then + color = "ThreatLow" + elseif GetPartyAssignment("MAINASSIST", "targettarget") then + color = "ThreatMedium" + else + color = "ThreatHigh" + end + self:SetBottomText2(name, color) + end if ( isTanking ) then rangeMulti = 1