mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
v1.3.3-Release
- interface version up to 3.0! hooray new stuff. - mod version bumped to 1.3.3 for all the new stuff and 3.0 client compatibility - made the threat module wow 3.0-compatible (these changes do not branch based on interface version due to the removal of lots of libs...there's no goin' back now!) - fixed text display on threat module to actually show threat % as intended - extracted MathRound function to make it accessible to all modules instead of being embedded within TargetHealth - added a few more user-submitted bar textures - removed LibDruidMana and fixed up DruidMana module to work with the new UnitPower API
This commit is contained in:
13
.pkgmeta
13
.pkgmeta
@ -1,34 +1,21 @@
|
|||||||
package-as: IceHUD
|
package-as: IceHUD
|
||||||
|
|
||||||
externals:
|
externals:
|
||||||
libs/LibStub: svn://svn.wowace.com/wow/libstub/mainline/tags/1.0
|
|
||||||
libs/AceLibrary: svn://svn.wowace.com/wow/ace2/mainline/trunk/AceLibrary
|
libs/AceLibrary: svn://svn.wowace.com/wow/ace2/mainline/trunk/AceLibrary
|
||||||
libs/CallbackHandler-1.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/CallbackHandler-1.0
|
libs/CallbackHandler-1.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/CallbackHandler-1.0
|
||||||
libs/AceBucket-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceBucket-3.0
|
|
||||||
libs/AceComm-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceComm-3.0
|
|
||||||
libs/AceTimer-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceTimer-3.0
|
|
||||||
libs/AceSerializer-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceSerializer-3.0
|
|
||||||
libs/AceEvent-2.0: svn://svn.wowace.com/wow/ace2/mainline/trunk/AceEvent-2.0
|
libs/AceEvent-2.0: svn://svn.wowace.com/wow/ace2/mainline/trunk/AceEvent-2.0
|
||||||
libs/AceEvent-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceEvent-3.0
|
|
||||||
libs/AceDB-2.0: svn://svn.wowace.com/wow/ace2/mainline/trunk/AceDB-2.0
|
libs/AceDB-2.0: svn://svn.wowace.com/wow/ace2/mainline/trunk/AceDB-2.0
|
||||||
libs/AceDB-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceDB-3.0
|
|
||||||
libs/AceOO-2.0: svn://svn.wowace.com/wow/ace2/mainline/trunk/AceOO-2.0
|
libs/AceOO-2.0: svn://svn.wowace.com/wow/ace2/mainline/trunk/AceOO-2.0
|
||||||
libs/AceAddon-2.0: svn://svn.wowace.com/wow/ace2/mainline/trunk/AceAddon-2.0
|
libs/AceAddon-2.0: svn://svn.wowace.com/wow/ace2/mainline/trunk/AceAddon-2.0
|
||||||
libs/AceAddon-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceAddon-3.0
|
|
||||||
libs/AceConsole-2.0: svn://svn.wowace.com/wow/ace2/mainline/trunk/AceConsole-2.0
|
libs/AceConsole-2.0: svn://svn.wowace.com/wow/ace2/mainline/trunk/AceConsole-2.0
|
||||||
libs/AceConsole-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceConsole-3.0
|
|
||||||
libs/Deformat-2.0: svn://svn.wowace.com/wow/deformat/mainline/trunk/Deformat-2.0
|
libs/Deformat-2.0: svn://svn.wowace.com/wow/deformat/mainline/trunk/Deformat-2.0
|
||||||
libs/LibDogTag-Unit-3.0: svn://svn.wowace.com/wow/libdogtag-unit-3-0/mainline/trunk
|
libs/LibDogTag-Unit-3.0: svn://svn.wowace.com/wow/libdogtag-unit-3-0/mainline/trunk
|
||||||
libs/LibDruidMana-1.0: svn://svn.wowace.com/wow/libdruidmana-1-0/mainline/trunk
|
|
||||||
libs/LibRangeCheck-2.0: svn://svn.wowace.com/wow/librangecheck-2-0/mainline/trunk/LibRangeCheck-2.0
|
libs/LibRangeCheck-2.0: svn://svn.wowace.com/wow/librangecheck-2-0/mainline/trunk/LibRangeCheck-2.0
|
||||||
libs/LibSharedMedia-3.0: svn://svn.wowace.com/wow/libsharedmedia-3-0/mainline/trunk
|
libs/LibSharedMedia-3.0: svn://svn.wowace.com/wow/libsharedmedia-3-0/mainline/trunk
|
||||||
libs/LibDogTag-3.0: svn://svn.wowace.com/wow/libdogtag-3-0/mainline/trunk
|
libs/LibDogTag-3.0: svn://svn.wowace.com/wow/libdogtag-3-0/mainline/trunk
|
||||||
libs/Threat-2.0: svn://svn.wowace.com/wow/threat-2-0/mainline/trunk/Threat-2.0
|
|
||||||
libs/Waterfall-1.0: svn://svn.wowace.com/wow/waterfall-1-0/mainline/trunk/Waterfall-1.0
|
libs/Waterfall-1.0: svn://svn.wowace.com/wow/waterfall-1-0/mainline/trunk/Waterfall-1.0
|
||||||
|
|
||||||
optional-dependencies:
|
optional-dependencies:
|
||||||
- threat-2-0
|
|
||||||
- libdogtag-3-0
|
- libdogtag-3-0
|
||||||
- libdogtag-unit-3-0
|
- libdogtag-unit-3-0
|
||||||
- librangecheck-2-0
|
- librangecheck-2-0
|
||||||
- libdruidmana-1-0
|
|
@ -286,7 +286,7 @@ IceHUD.options =
|
|||||||
set = function(value)
|
set = function(value)
|
||||||
IceHUD.IceCore:SetBarPreset(value)
|
IceHUD.IceCore:SetBarPreset(value)
|
||||||
end,
|
end,
|
||||||
validate = { "Bar", "HiBar", "RoundBar", "ColorBar", "RivetBar", "RivetBar2", "CleanCurves", "GlowArc", "BloodGlaives" },
|
validate = { "Bar", "HiBar", "RoundBar", "ColorBar", "RivetBar", "RivetBar2", "CleanCurves", "GlowArc", "BloodGlaives", "FangRune", "RuneBar", "RuneColor" },
|
||||||
order = 9
|
order = 9
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -555,3 +555,9 @@ end
|
|||||||
|
|
||||||
function IceHUD:SetDebugging()
|
function IceHUD:SetDebugging()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- rounding stuff
|
||||||
|
function IceHUD:MathRound(num, idp)
|
||||||
|
local mult = 10^(idp or 0)
|
||||||
|
return math.floor(num * mult + 0.5) / mult
|
||||||
|
end
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
## Interface: 20400
|
## Interface: 30000
|
||||||
## Author: Iceroth, continued by Parnic
|
## Author: Parnic, originally created by Iceroth
|
||||||
## Name: IceHUD
|
## Name: IceHUD
|
||||||
## Title: IceHUD |cff7fff7f -Ace2-|r
|
## Title: IceHUD |cff7fff7f -Ace2-|r
|
||||||
## Notes: Another HUD addon
|
## Notes: Another HUD addon
|
||||||
## Version: 1.3.2 ($Revision$)
|
## Version: 1.3.3 (Revision: @project-revision@)
|
||||||
## SavedVariables: IceCoreDB
|
## SavedVariables: IceCoreDB
|
||||||
## OptionalDeps: Ace2, Ace3, LibSharedMedia-3.0, Waterfall-1.0, Deformat, LibDogTag-3.0, LibDogTag-Unit-3.0, LibDruidMana-1.0, LibRangeCheck-2.0, Threat-2.0
|
## OptionalDeps: Ace2, LibSharedMedia-3.0, Waterfall-1.0, Deformat, LibDogTag-3.0, LibDogTag-Unit-3.0, LibDruidMana-1.0, LibRangeCheck-2.0
|
||||||
## X-Category: HUDs
|
## X-Category: HUDs
|
||||||
## X-Website: http://www.wowace.com/projects/wowace-ice-hud/
|
## X-Website: http://www.wowace.com/projects/wowace-ice-hud/
|
||||||
|
|
||||||
|
11
embeds.xml
11
embeds.xml
@ -1,29 +1,18 @@
|
|||||||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
|
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
|
||||||
..\FrameXML\UI.xsd">
|
..\FrameXML\UI.xsd">
|
||||||
|
|
||||||
<Script file="Libs\LibStub\LibStub.lua"/>
|
|
||||||
<Script file="libs\AceLibrary\AceLibrary.lua"/>
|
<Script file="libs\AceLibrary\AceLibrary.lua"/>
|
||||||
<Script file="libs\CallbackHandler-1.0\CallbackHandler-1.0.lua"/>
|
<Script file="libs\CallbackHandler-1.0\CallbackHandler-1.0.lua"/>
|
||||||
<Script file="libs\AceOO-2.0\AceOO-2.0.lua"/>
|
<Script file="libs\AceOO-2.0\AceOO-2.0.lua"/>
|
||||||
<Script file="libs\AceDB-2.0\AceDB-2.0.lua"/>
|
<Script file="libs\AceDB-2.0\AceDB-2.0.lua"/>
|
||||||
<Script file="libs\AceDB-3.0\AceDB-3.0.lua"/>
|
|
||||||
<Script file="libs\AceEvent-2.0\AceEvent-2.0.lua"/>
|
<Script file="libs\AceEvent-2.0\AceEvent-2.0.lua"/>
|
||||||
<Script file="libs\AceEvent-3.0\AceEvent-3.0.lua"/>
|
|
||||||
<Script file="libs\AceConsole-2.0\AceConsole-2.0.lua"/>
|
<Script file="libs\AceConsole-2.0\AceConsole-2.0.lua"/>
|
||||||
<Script file="libs\AceConsole-3.0\AceConsole-3.0.lua"/>
|
|
||||||
<Script file="libs\AceAddon-3.0\AceAddon-3.0.lua"/>
|
|
||||||
<Script file="libs\AceAddon-2.0\AceAddon-2.0.lua"/>
|
<Script file="libs\AceAddon-2.0\AceAddon-2.0.lua"/>
|
||||||
<Include file="Libs\AceBucket-3.0\AceBucket-3.0.xml"/>
|
|
||||||
<Include file="Libs\AceComm-3.0\AceComm-3.0.xml"/>
|
|
||||||
<Include file="Libs\AceTimer-3.0\AceTimer-3.0.xml"/>
|
|
||||||
<Include file="Libs\AceSerializer-3.0\AceSerializer-3.0.xml"/>
|
|
||||||
<Include file="libs\LibDogTag-3.0\lib.xml"/>
|
<Include file="libs\LibDogTag-3.0\lib.xml"/>
|
||||||
<Include file="libs\LibDogTag-Unit-3.0\lib.xml"/>
|
<Include file="libs\LibDogTag-Unit-3.0\lib.xml"/>
|
||||||
<Include file="libs\LibDruidMana-1.0\lib.xml"/>
|
|
||||||
<Script file="libs\LibRangeCheck-2.0\LibRangeCheck-2.0.lua"/>
|
<Script file="libs\LibRangeCheck-2.0\LibRangeCheck-2.0.lua"/>
|
||||||
<Include file="libs\LibSharedMedia-3.0\lib.xml"/>
|
<Include file="libs\LibSharedMedia-3.0\lib.xml"/>
|
||||||
<Script file="libs\Deformat-2.0\Deformat-2.0.lua"/>
|
<Script file="libs\Deformat-2.0\Deformat-2.0.lua"/>
|
||||||
<Include file="libs\Threat-2.0\lib.xml"/>
|
|
||||||
<Script file="libs\Waterfall-1.0\Waterfall-1.0.lua"/>
|
<Script file="libs\Waterfall-1.0\Waterfall-1.0.lua"/>
|
||||||
|
|
||||||
</Ui>
|
</Ui>
|
||||||
|
@ -5,8 +5,6 @@ local DruidMana = AceOO.Class(IceUnitBar)
|
|||||||
DruidMana.prototype.druidMana = nil
|
DruidMana.prototype.druidMana = nil
|
||||||
DruidMana.prototype.druidManaMax = nil
|
DruidMana.prototype.druidManaMax = nil
|
||||||
|
|
||||||
local LibDruidMana = nil
|
|
||||||
|
|
||||||
|
|
||||||
-- Constructor --
|
-- Constructor --
|
||||||
function DruidMana.prototype:init()
|
function DruidMana.prototype:init()
|
||||||
@ -16,10 +14,6 @@ function DruidMana.prototype:init()
|
|||||||
self.offset = 0
|
self.offset = 0
|
||||||
|
|
||||||
self:SetDefaultColor("DruidMana", 87, 82, 141)
|
self:SetDefaultColor("DruidMana", 87, 82, 141)
|
||||||
|
|
||||||
if AceLibrary:HasInstance("LibDogTag-3.0") and AceLibrary:HasInstance("LibDruidMana-1.0") then
|
|
||||||
LibDruidMana = AceLibrary("LibDruidMana-1.0")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -29,11 +23,8 @@ function DruidMana.prototype:GetDefaultSettings()
|
|||||||
settings["side"] = IceCore.Side.Right
|
settings["side"] = IceCore.Side.Right
|
||||||
settings["offset"] = 0
|
settings["offset"] = 0
|
||||||
settings["textVisible"] = {upper = true, lower = false}
|
settings["textVisible"] = {upper = true, lower = false}
|
||||||
|
|
||||||
if LibDruidMana then
|
|
||||||
settings["upperText"] = "[PercentDruidMP:Round]"
|
settings["upperText"] = "[PercentDruidMP:Round]"
|
||||||
settings["lowerText"] = "[FractionalDruidMP:Color('3071bf'):Bracket]"
|
settings["lowerText"] = "[FractionalDruidMP:Color('3071bf'):Bracket]"
|
||||||
end
|
|
||||||
|
|
||||||
return settings
|
return settings
|
||||||
end
|
end
|
||||||
@ -42,13 +33,12 @@ end
|
|||||||
function DruidMana.prototype:Enable(core)
|
function DruidMana.prototype:Enable(core)
|
||||||
DruidMana.super.prototype.Enable(self, core)
|
DruidMana.super.prototype.Enable(self, core)
|
||||||
|
|
||||||
if LibDruidMana then
|
|
||||||
self:RegisterEvent("UPDATE_SHAPESHIFT_FORM", "Update")
|
self:RegisterEvent("UPDATE_SHAPESHIFT_FORM", "Update")
|
||||||
self:RegisterEvent("UNIT_MAXMANA", "Update")
|
self:RegisterEvent("UNIT_MAXMANA", "Update")
|
||||||
|
|
||||||
if IceHUD.WowVer >= 30000 then
|
if IceHUD.WowVer >= 30000 then
|
||||||
if GetCVarBool("predictedPower") and self.frame then
|
if GetCVarBool("predictedPower") and self.frame then
|
||||||
self.frame:SetScript("OnUpdate", function() self:Update(self.unit) end)
|
self.frame:SetScript("OnUpdate", function() self:Update() end)
|
||||||
else
|
else
|
||||||
self:RegisterEvent("UNIT_MANA", "Update")
|
self:RegisterEvent("UNIT_MANA", "Update")
|
||||||
end
|
end
|
||||||
@ -56,7 +46,6 @@ function DruidMana.prototype:Enable(core)
|
|||||||
self:RegisterEvent("UNIT_MANA", "Update")
|
self:RegisterEvent("UNIT_MANA", "Update")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function DruidMana.prototype:Disable(core)
|
function DruidMana.prototype:Disable(core)
|
||||||
@ -69,10 +58,8 @@ function DruidMana.prototype:Update()
|
|||||||
|
|
||||||
local forms = (UnitPowerType(self.unit) ~= 0)
|
local forms = (UnitPowerType(self.unit) ~= 0)
|
||||||
|
|
||||||
if LibDruidMana then
|
self.druidMana = UnitPower(self.unit, 0)
|
||||||
self.druidMana = LibDruidMana:GetCurrentMana()
|
self.druidManaMax = UnitPowerMax(self.unit, 0)
|
||||||
self.druidManaMax = LibDruidMana:GetMaximumMana()
|
|
||||||
end
|
|
||||||
|
|
||||||
if (not self.alive or not forms or not self.druidMana or not self.druidManaMax or self.druidManaMax == 0) then
|
if (not self.alive or not forms or not self.druidMana or not self.druidManaMax or self.druidManaMax == 0) then
|
||||||
self:Show(false)
|
self:Show(false)
|
||||||
|
@ -383,23 +383,15 @@ end
|
|||||||
|
|
||||||
function IceTargetHealth.prototype:Round(health)
|
function IceTargetHealth.prototype:Round(health)
|
||||||
if (health > 1000000) then
|
if (health > 1000000) then
|
||||||
return self:MathRound(health/1000000, 1) .. "M"
|
return IceHUD:MathRound(health/1000000, 1) .. "M"
|
||||||
end
|
end
|
||||||
if (health > 1000) then
|
if (health > 1000) then
|
||||||
return self:MathRound(health/1000, 1) .. "k"
|
return IceHUD:MathRound(health/1000, 1) .. "k"
|
||||||
end
|
end
|
||||||
return health
|
return health
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function IceTargetHealth.prototype:MathRound(num, idp)
|
|
||||||
local mult = 10^(idp or 0)
|
|
||||||
return math.floor(num * mult + 0.5) / mult
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function IceTargetHealth.prototype:ShowBlizz()
|
function IceTargetHealth.prototype:ShowBlizz()
|
||||||
TargetFrame:Show()
|
TargetFrame:Show()
|
||||||
|
@ -6,7 +6,6 @@ Description: adds a threat bar to IceHUD
|
|||||||
]]
|
]]
|
||||||
|
|
||||||
local AceOO = AceLibrary("AceOO-2.0")
|
local AceOO = AceLibrary("AceOO-2.0")
|
||||||
local Threat = LibStub("Threat-2.0")
|
|
||||||
|
|
||||||
local IHUD_Threat = AceOO.Class(IceUnitBar)
|
local IHUD_Threat = AceOO.Class(IceUnitBar)
|
||||||
|
|
||||||
@ -34,6 +33,7 @@ function IHUD_Threat.prototype:GetDefaultSettings()
|
|||||||
settings["offset"] = 3
|
settings["offset"] = 3
|
||||||
settings["enabled"] = false
|
settings["enabled"] = false
|
||||||
settings["aggroAlpha"] = 0.7
|
settings["aggroAlpha"] = 0.7
|
||||||
|
settings["usesDogTagStrings"] = false
|
||||||
return settings
|
return settings
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -56,9 +56,6 @@ function IHUD_Threat.prototype:GetOptions()
|
|||||||
self:Disable()
|
self:Disable()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
disabled = function()
|
|
||||||
return Threat == nil
|
|
||||||
end,
|
|
||||||
order = 20
|
order = 20
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,7 +114,7 @@ function IHUD_Threat.prototype:CreateAggroBar()
|
|||||||
end
|
end
|
||||||
|
|
||||||
self.aggroBar:SetFrameStrata("BACKGROUND")
|
self.aggroBar:SetFrameStrata("BACKGROUND")
|
||||||
self.aggroBar:SetWidth(self.settings.barWidth)
|
self.aggroBar:SetWidth(self.settings.barWidth + (self.moduleSettings.widthModifier or 0))
|
||||||
self.aggroBar:SetHeight(self.settings.barHeight)
|
self.aggroBar:SetHeight(self.settings.barHeight)
|
||||||
|
|
||||||
if not (self.aggroBar.bar) then
|
if not (self.aggroBar.bar) then
|
||||||
@ -147,12 +144,6 @@ end
|
|||||||
|
|
||||||
-- bar stuff
|
-- bar stuff
|
||||||
function IHUD_Threat.prototype:Update(unit)
|
function IHUD_Threat.prototype:Update(unit)
|
||||||
-- only show bar if the user has Threat-2.0 and there's any threat
|
|
||||||
if not Threat or not Threat:IsActive() then
|
|
||||||
self:Show(false)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
IHUD_Threat.super.prototype.Update(self)
|
IHUD_Threat.super.prototype.Update(self)
|
||||||
|
|
||||||
if (unit and (unit ~= self.unit)) then
|
if (unit and (unit ~= self.unit)) then
|
||||||
@ -163,71 +154,52 @@ function IHUD_Threat.prototype:Update(unit)
|
|||||||
unit = self.unit
|
unit = self.unit
|
||||||
end
|
end
|
||||||
|
|
||||||
if not UnitExists("target") or not UnitCanAttack("player", "target") or UnitIsDead("target") or UnitIsFriend("player", "target") or UnitPlayerControlled("target")
|
if not UnitExists("target") or not UnitCanAttack("player", "target") or UnitIsDead("target") or UnitIsFriend("player", "target") or UnitPlayerControlled("target") then
|
||||||
then
|
|
||||||
self:Show(false)
|
self:Show(false)
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
self:Show(true)
|
self:Show(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- get my threat and the tank threat
|
local isTanking, threatState, scaledPercent, rawPercent = UnitDetailedThreatSituation("player", "target")
|
||||||
local threatMe = Threat:GetThreat( UnitGUID("player") , UnitGUID("target") )
|
local scaledPercentZeroToOne
|
||||||
local threatTank = 0
|
|
||||||
local threatTankName = ""
|
|
||||||
|
|
||||||
if UnitExists("targettarget") then
|
if not threatState or not scaledPercent or not rawPercent then
|
||||||
threatTankName = UnitGUID("targettarget")
|
scaledPercentZeroToOne = 0
|
||||||
threatTank = Threat:GetThreat( UnitGUID("targettarget"), UnitGUID("target") )
|
scaledPercent = 0
|
||||||
|
|
||||||
|
IceHUD:Debug( "Threat: nil threat on valid target" )
|
||||||
else
|
else
|
||||||
threatTank, threatTankName = Threat:GetMaxThreatOnTarget( UnitGUID("target") )
|
scaledPercentZeroToOne = scaledPercent / 100
|
||||||
|
|
||||||
|
IceHUD:Debug( "isTanking="..(isTanking or "nil").." threatState="..(threatState or "nil").." scaledPercent="..(scaledPercent or "nil").." rawPercent="..(rawPercent or "nil") )
|
||||||
end
|
end
|
||||||
|
|
||||||
-- adjust max threat to avoid divide by 0
|
-- set percentage text
|
||||||
if ( threatTank == 0 ) then
|
self:SetBottomText1( IceHUD:MathRound(scaledPercent) .. "%" )
|
||||||
threatTank = 1
|
self:SetBottomText2()
|
||||||
end
|
|
||||||
|
|
||||||
-- aggro gain limit
|
-- Parnic: threat lib is no longer used in wotlk
|
||||||
local threatMulti = 1.3
|
-- ...assuming a 1.1 threat multi if not tanking for the time being unless we decide to switch it back to 1.3/1.1 based on ranged/melee status later
|
||||||
if ( Threat:UnitInMeleeRange( "target" ) ) then
|
local threatMulti = 1.1
|
||||||
threatMulti = 1.1
|
if ( isTanking ) then
|
||||||
-- elseif ( UnitExists("targettarget") and ( UnitName("targettarget") == UnitName("player") ) ) then
|
|
||||||
-- threatMulti = 1
|
|
||||||
elseif ( threatTankName == UnitGUID("player") ) then
|
|
||||||
threatMulti = 1
|
threatMulti = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
-- get my threat percentage
|
-- Parnic: this should probably be switched to use the new api colors for threat...
|
||||||
local threatPct = self:MathRound( (100/threatTank) * threatMe, 1 )
|
|
||||||
|
|
||||||
IceHUD:Debug( "threatMe = " .. threatMe .. ", threatTank = " .. threatTank .. ", threatPct = " .. threatPct )
|
|
||||||
|
|
||||||
-- set percentage text
|
|
||||||
self:SetBottomText1( threatPct .. "%" )
|
|
||||||
self:SetBottomText2()
|
|
||||||
|
|
||||||
-- set bar color
|
-- set bar color
|
||||||
if( threatMulti == 1 ) then
|
if( threatMulti == 1 ) then
|
||||||
self.color = "ThreatDanger"
|
self.color = "ThreatDanger"
|
||||||
elseif( threatPct < 50 ) then
|
elseif( scaledPercent < 50 ) then
|
||||||
self.color = "ThreatLow"
|
self.color = "ThreatLow"
|
||||||
elseif ( threatPct < 80 ) then
|
elseif ( scaledPercent < 80 ) then
|
||||||
self.color = "ThreatMedium"
|
self.color = "ThreatMedium"
|
||||||
else
|
else
|
||||||
self.color = "ThreatHigh"
|
self.color = "ThreatHigh"
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[ local g = floor( (255 / (threatTank*threatMulti) ) *threatMe )
|
|
||||||
|
|
||||||
if(g>255) then g=255 end
|
|
||||||
if(g<0) then g=0 end
|
|
||||||
|
|
||||||
IceHUD.IceCore:SetColor("ThreatCustom", 255, 255, 0)
|
|
||||||
self.color = "ThreatCustom"
|
|
||||||
]]
|
|
||||||
-- set the bar value
|
-- set the bar value
|
||||||
self:UpdateBar( threatMe / ( threatTank*threatMulti ), self.color )
|
self:UpdateBar( scaledPercentZeroToOne, self.color )
|
||||||
|
|
||||||
-- do the aggro indicator bar stuff, but only if it has changed
|
-- do the aggro indicator bar stuff, but only if it has changed
|
||||||
if ( self.aggroBarMulti ~= threatMulti ) then
|
if ( self.aggroBarMulti ~= threatMulti ) then
|
||||||
@ -246,11 +218,6 @@ function IHUD_Threat.prototype:Update(unit)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- rounding stuff
|
|
||||||
function IHUD_Threat.prototype:MathRound(num, idp)
|
|
||||||
local mult = 10^(idp or 0)
|
|
||||||
return math.floor(num * mult + 0.5) / mult
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Load us up
|
-- Load us up
|
||||||
IceHUD.IHUD_Threat = IHUD_Threat:new()
|
IceHUD.IHUD_Threat = IHUD_Threat:new()
|
||||||
|
BIN
textures/FangRune.blp
Normal file
BIN
textures/FangRune.blp
Normal file
Binary file not shown.
BIN
textures/FangRuneBG.blp
Normal file
BIN
textures/FangRuneBG.blp
Normal file
Binary file not shown.
BIN
textures/RuneBar.blp
Normal file
BIN
textures/RuneBar.blp
Normal file
Binary file not shown.
BIN
textures/RuneBarBG.blp
Normal file
BIN
textures/RuneBarBG.blp
Normal file
Binary file not shown.
BIN
textures/RuneColor.blp
Normal file
BIN
textures/RuneColor.blp
Normal file
Binary file not shown.
BIN
textures/RuneColorBG.blp
Normal file
BIN
textures/RuneColorBG.blp
Normal file
Binary file not shown.
Reference in New Issue
Block a user