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:
Parnic
2008-10-14 05:05:58 +00:00
parent 3671b0da91
commit 844fcfad26
13 changed files with 54 additions and 126 deletions

View File

@ -1,34 +1,21 @@
package-as: IceHUD
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/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-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-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/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-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/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/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/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
optional-dependencies:
- threat-2-0
- libdogtag-3-0
- libdogtag-unit-3-0
- librangecheck-2-0
- libdruidmana-1-0

View File

@ -286,7 +286,7 @@ IceHUD.options =
set = function(value)
IceHUD.IceCore:SetBarPreset(value)
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
},
@ -555,3 +555,9 @@ end
function IceHUD:SetDebugging()
end
-- rounding stuff
function IceHUD:MathRound(num, idp)
local mult = 10^(idp or 0)
return math.floor(num * mult + 0.5) / mult
end

View File

@ -1,11 +1,11 @@
## Interface: 20400
## Author: Iceroth, continued by Parnic
## Interface: 30000
## Author: Parnic, originally created by Iceroth
## Name: IceHUD
## Title: IceHUD |cff7fff7f -Ace2-|r
## Notes: Another HUD addon
## Version: 1.3.2 ($Revision$)
## Version: 1.3.3 (Revision: @project-revision@)
## 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-Website: http://www.wowace.com/projects/wowace-ice-hud/

View File

@ -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/
..\FrameXML\UI.xsd">
<Script file="Libs\LibStub\LibStub.lua"/>
<Script file="libs\AceLibrary\AceLibrary.lua"/>
<Script file="libs\CallbackHandler-1.0\CallbackHandler-1.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-3.0\AceDB-3.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-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"/>
<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-Unit-3.0\lib.xml"/>
<Include file="libs\LibDruidMana-1.0\lib.xml"/>
<Script file="libs\LibRangeCheck-2.0\LibRangeCheck-2.0.lua"/>
<Include file="libs\LibSharedMedia-3.0\lib.xml"/>
<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"/>
</Ui>

View File

@ -5,8 +5,6 @@ local DruidMana = AceOO.Class(IceUnitBar)
DruidMana.prototype.druidMana = nil
DruidMana.prototype.druidManaMax = nil
local LibDruidMana = nil
-- Constructor --
function DruidMana.prototype:init()
@ -16,10 +14,6 @@ function DruidMana.prototype:init()
self.offset = 0
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
@ -29,11 +23,8 @@ function DruidMana.prototype:GetDefaultSettings()
settings["side"] = IceCore.Side.Right
settings["offset"] = 0
settings["textVisible"] = {upper = true, lower = false}
if LibDruidMana then
settings["upperText"] = "[PercentDruidMP:Round]"
settings["lowerText"] = "[FractionalDruidMP:Color('3071bf'):Bracket]"
end
return settings
end
@ -42,20 +33,18 @@ end
function DruidMana.prototype:Enable(core)
DruidMana.super.prototype.Enable(self, core)
if LibDruidMana then
self:RegisterEvent("UPDATE_SHAPESHIFT_FORM", "Update")
self:RegisterEvent("UNIT_MAXMANA", "Update")
if IceHUD.WowVer >= 30000 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
self:RegisterEvent("UNIT_MANA", "Update")
end
else
self:RegisterEvent("UNIT_MANA", "Update")
end
end
end
@ -69,10 +58,8 @@ function DruidMana.prototype:Update()
local forms = (UnitPowerType(self.unit) ~= 0)
if LibDruidMana then
self.druidMana = LibDruidMana:GetCurrentMana()
self.druidManaMax = LibDruidMana:GetMaximumMana()
end
self.druidMana = UnitPower(self.unit, 0)
self.druidManaMax = UnitPowerMax(self.unit, 0)
if (not self.alive or not forms or not self.druidMana or not self.druidManaMax or self.druidManaMax == 0) then
self:Show(false)

View File

@ -383,23 +383,15 @@ end
function IceTargetHealth.prototype:Round(health)
if (health > 1000000) then
return self:MathRound(health/1000000, 1) .. "M"
return IceHUD:MathRound(health/1000000, 1) .. "M"
end
if (health > 1000) then
return self:MathRound(health/1000, 1) .. "k"
return IceHUD:MathRound(health/1000, 1) .. "k"
end
return health
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()
TargetFrame:Show()

View File

@ -6,7 +6,6 @@ Description: adds a threat bar to IceHUD
]]
local AceOO = AceLibrary("AceOO-2.0")
local Threat = LibStub("Threat-2.0")
local IHUD_Threat = AceOO.Class(IceUnitBar)
@ -34,6 +33,7 @@ function IHUD_Threat.prototype:GetDefaultSettings()
settings["offset"] = 3
settings["enabled"] = false
settings["aggroAlpha"] = 0.7
settings["usesDogTagStrings"] = false
return settings
end
@ -56,9 +56,6 @@ function IHUD_Threat.prototype:GetOptions()
self:Disable()
end
end,
disabled = function()
return Threat == nil
end,
order = 20
}
@ -117,7 +114,7 @@ function IHUD_Threat.prototype:CreateAggroBar()
end
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)
if not (self.aggroBar.bar) then
@ -147,12 +144,6 @@ end
-- bar stuff
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)
if (unit and (unit ~= self.unit)) then
@ -163,71 +154,52 @@ function IHUD_Threat.prototype:Update(unit)
unit = self.unit
end
if not UnitExists("target") or not UnitCanAttack("player", "target") or UnitIsDead("target") or UnitIsFriend("player", "target") or UnitPlayerControlled("target")
then
if not UnitExists("target") or not UnitCanAttack("player", "target") or UnitIsDead("target") or UnitIsFriend("player", "target") or UnitPlayerControlled("target") then
self:Show(false)
return
else
self:Show(true)
end
-- get my threat and the tank threat
local threatMe = Threat:GetThreat( UnitGUID("player") , UnitGUID("target") )
local threatTank = 0
local threatTankName = ""
local isTanking, threatState, scaledPercent, rawPercent = UnitDetailedThreatSituation("player", "target")
local scaledPercentZeroToOne
if UnitExists("targettarget") then
threatTankName = UnitGUID("targettarget")
threatTank = Threat:GetThreat( UnitGUID("targettarget"), UnitGUID("target") )
if not threatState or not scaledPercent or not rawPercent then
scaledPercentZeroToOne = 0
scaledPercent = 0
IceHUD:Debug( "Threat: nil threat on valid target" )
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
-- adjust max threat to avoid divide by 0
if ( threatTank == 0 ) then
threatTank = 1
end
-- set percentage text
self:SetBottomText1( IceHUD:MathRound(scaledPercent) .. "%" )
self:SetBottomText2()
-- aggro gain limit
local threatMulti = 1.3
if ( Threat:UnitInMeleeRange( "target" ) ) then
threatMulti = 1.1
-- elseif ( UnitExists("targettarget") and ( UnitName("targettarget") == UnitName("player") ) ) then
-- threatMulti = 1
elseif ( threatTankName == UnitGUID("player") ) then
-- Parnic: threat lib is no longer used in wotlk
-- ...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
local threatMulti = 1.1
if ( isTanking ) then
threatMulti = 1
end
-- get my threat percentage
local threatPct = self:MathRound( (100/threatTank) * threatMe, 1 )
IceHUD:Debug( "threatMe = " .. threatMe .. ", threatTank = " .. threatTank .. ", threatPct = " .. threatPct )
-- set percentage text
self:SetBottomText1( threatPct .. "%" )
self:SetBottomText2()
-- Parnic: this should probably be switched to use the new api colors for threat...
-- set bar color
if( threatMulti == 1 ) then
self.color = "ThreatDanger"
elseif( threatPct < 50 ) then
elseif( scaledPercent < 50 ) then
self.color = "ThreatLow"
elseif ( threatPct < 80 ) then
elseif ( scaledPercent < 80 ) then
self.color = "ThreatMedium"
else
self.color = "ThreatHigh"
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
self:UpdateBar( threatMe / ( threatTank*threatMulti ), self.color )
self:UpdateBar( scaledPercentZeroToOne, self.color )
-- do the aggro indicator bar stuff, but only if it has changed
if ( self.aggroBarMulti ~= threatMulti ) then
@ -246,11 +218,6 @@ function IHUD_Threat.prototype:Update(unit)
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
IceHUD.IHUD_Threat = IHUD_Threat:new()

BIN
textures/FangRune.blp Normal file

Binary file not shown.

BIN
textures/FangRuneBG.blp Normal file

Binary file not shown.

BIN
textures/RuneBar.blp Normal file

Binary file not shown.

BIN
textures/RuneBarBG.blp Normal file

Binary file not shown.

BIN
textures/RuneColor.blp Normal file

Binary file not shown.

BIN
textures/RuneColorBG.blp Normal file

Binary file not shown.