- removed the last remnants of Ace2 (AceOO-2.0 and AceLibrary) thanks to a huge amount of help from ckknight for metatables

This commit is contained in:
Parnic
2010-09-17 05:41:04 +00:00
parent fd6d570e0b
commit 250adfc2db
56 changed files with 203 additions and 294 deletions

View File

@ -4,7 +4,6 @@ externals:
libs/LibStub:
url: svn://svn.wowace.com/wow/ace3/mainline/trunk/LibStub
tag: latest
libs/AceLibrary: svn://svn.wowace.com/wow/ace2/mainline/trunk/AceLibrary
libs/CallbackHandler-1.0:
url: svn://svn.wowace.com/wow/ace3/mainline/trunk/CallbackHandler-1.0
tag: latest
@ -26,7 +25,6 @@ externals:
libs/AceGUI-3.0:
url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceGUI-3.0
tag: latest
libs/AceOO-2.0: svn://svn.wowace.com/wow/ace2/mainline/trunk/AceOO-2.0
libs/AceAddon-3.0:
url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceAddon-3.0
tag: latest

View File

@ -1,9 +1,6 @@
local AceOO = AceLibrary("AceOO-2.0")
local DogTag = nil
IceBarElement = AceOO.Class(IceElement)
IceBarElement.virtual = true
IceBarElement = IceCore_CreateClass(IceElement)
IceBarElement.BarTextureWidth = 128
@ -14,6 +11,7 @@ IceBarElement.prototype.LastScale = 1
IceBarElement.prototype.DesiredScale = 1
IceBarElement.prototype.CurrScale = 1
IceBarElement.prototype.Markers = {}
IceBarElement.prototype.IsBarElement = true -- cheating to avoid crawling up the 'super' references looking for this class. see IceCore.lua
local lastMarkerPosConfig = 50
local lastMarkerColorConfig = {r=1, b=0, g=0, a=1}
@ -33,9 +31,11 @@ end
function IceBarElement.prototype:Enable()
IceBarElement.super.prototype.Enable(self)
if IceHUD.IceCore:ShouldUseDogTags() and AceLibrary:HasInstance("LibDogTag-3.0") then
DogTag = AceLibrary("LibDogTag-3.0")
AceLibrary("LibDogTag-Unit-3.0")
if IceHUD.IceCore:ShouldUseDogTags() then
DogTag = LibStub("LibDogTag-3.0", true)
if DogTag then
LibStub("LibDogTag-Unit-3.0", true)
end
end
if self.moduleSettings.myTagVersion < IceHUD.CurrTagVersion then

View File

@ -1,9 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local SPELLINTERRUPTOTHERSELF = SPELLINTERRUPTOTHERSELF
local SPELLFAILCASTSELF = SPELLFAILCASTSELF
IceCastBar = AceOO.Class(IceBarElement)
IceCastBar = IceCore_CreateClass(IceBarElement)
IceCastBar.Actions = { None = 0, Cast = 1, Channel = 2, Instant = 3, Success = 4, Failure = 5 }

View File

@ -1,6 +1,22 @@
local AceOO = AceLibrary("AceOO-2.0")
function IceCore_CreateClass(parent)
local class = { prototype = {} }
if parent then
class.super = parent
setmetatable(class.prototype, { __index = parent.prototype })
end
local mt = { __index = class.prototype }
function class.new(...)
local self = setmetatable({}, mt)
if self.init then
self:init(...)
end
return self
end
IceCore = AceOO.Class()
return class
end
IceCore = IceCore_CreateClass()
IceCore.Side = { Left = "LEFT", Right = "RIGHT" }
@ -27,7 +43,6 @@ IceCore.prototype.bConfigMode = false
-- Constructor --
function IceCore.prototype:init()
IceCore.super.prototype.init(self)
IceHUD:Debug("IceCore.prototype:init()")
self.IceHUDFrame = CreateFrame("Frame","IceHUDFrame", UIParent)
@ -617,7 +632,7 @@ function IceCore.prototype:ConfigModeToggle(bWantConfig)
if self.elements[i]:IsEnabled() then
self.elements[i].frame:Show()
self.elements[i]:Redraw()
if AceOO.inherits(self.elements[i], IceBarElement) then
if self.elements[i].IsBarElement then
self.elements[i]:SetBottomText1(self.elements[i].elementName)
end
end
@ -629,7 +644,7 @@ function IceCore.prototype:ConfigModeToggle(bWantConfig)
end
-- blank the bottom text that we set before. if the module uses this text, it will reset itself on redraw
if AceOO.inherits(self.elements[i], IceBarElement) then
if self.elements[i].IsBarElement then
self.elements[i]:SetBottomText1()
end
@ -639,7 +654,7 @@ function IceCore.prototype:ConfigModeToggle(bWantConfig)
end
function IceCore.prototype:ShouldUseDogTags()
return AceLibrary:HasInstance("LibDogTag-3.0") and self.settings.bShouldUseDogTags
return LibStub("LibDogTag-3.0", true) and self.settings.bShouldUseDogTags
end
function IceCore.prototype:SetShouldUseDogTags(should)

View File

@ -1,8 +1,6 @@
local AceOO = AceLibrary("AceOO-2.0")
local SML = AceLibrary("LibSharedMedia-3.0")
local SML = LibStub("LibSharedMedia-3.0")
IceElement = AceOO.Class()
IceElement.virtual = true
IceElement = IceCore_CreateClass()
IceElement.TexturePath = IceHUD.Location .. "\\textures\\"
@ -31,7 +29,6 @@ IceElement.prototype.bIsVisible = true
-- Therefore we can wait for IceCore to load and then register our
-- module to the core with another event.
function IceElement.prototype:init(name)
IceElement.super.prototype.init(self)
assert(name, "IceElement must have a name")
self.elementName = name

View File

@ -1,6 +1,6 @@
IceHUD = LibStub("AceAddon-3.0"):NewAddon("IceHUD", "AceConsole-3.0")
local SML = AceLibrary("LibSharedMedia-3.0")
local SML = LibStub("LibSharedMedia-3.0")
local ACR = LibStub("AceConfigRegistry-3.0")
local ConfigDialog = LibStub("AceConfigDialog-3.0")
local icon = LibStub("LibDBIcon-1.0")
@ -652,7 +652,7 @@ Expand "|cffffdc42Module Settings|r", expand PlayerInfo (or TargetInfo for targe
StaticPopup_Show("ICEHUD_CHANGED_DOGTAG")
end,
hidden = function()
return not AceLibrary:HasInstance("LibDogTag-3.0")
return not LibStub("LibDogTag-3.0", true)
end,
order = 96
},

View File

@ -1,11 +1,11 @@
## Interface: 30300
## Author: Parnic, originally created by Iceroth
## Name: IceHUD
## Title: IceHUD |cff7fff7f -Ace2/3-|r
## Title: IceHUD |cff7fff7f -Ace3-|r
## Notes: Another HUD addon
## Version: @project-version@ (Revision: @project-revision@)
## SavedVariables: IceCoreDB
## OptionalDeps: Ace2, Ace3, LibSharedMedia-3.0, LibDogTag-3.0, LibDogTag-Unit-3.0, LibRangeCheck-2.0, LibHealComm-4.0
## OptionalDeps: Ace3, LibSharedMedia-3.0, LibDogTag-3.0, LibDogTag-Unit-3.0, LibRangeCheck-2.0, LibHealComm-4.0
## X-Category: HUDs
## X-Website: http://www.wowace.com/projects/ice-hud/
## X-Compatible-With: 40000

View File

@ -1,7 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
IceUnitBar = AceOO.Class(IceBarElement)
IceUnitBar.virtual = true
IceUnitBar = IceCore_CreateClass(IceBarElement)
IceUnitBar.prototype.unit = nil
IceUnitBar.prototype.alive = nil

View File

@ -1,8 +1,6 @@
<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"/>
<Include file="libs\AceDB-3.0\AceDB-3.0.xml"/>
<Include file="libs\AceDBOptions-3.0\AceDBOptions-3.0.xml"/>
<Include file="libs\AceGUI-3.0\AceGUI-3.0.xml"/>

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local CastBar = AceOO.Class(IceCastBar)
local CastBar = IceCore_CreateClass(IceCastBar)
CastBar.prototype.lagBar = nil
CastBar.prototype.spellCastSent = nil

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
IceClassPowerCounter = AceOO.Class(IceElement)
IceClassPowerCounter = IceCore_CreateClass(IceElement)
IceClassPowerCounter.prototype.runeHeight = 22
IceClassPowerCounter.prototype.runeWidth = 36

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local ComboPoints = AceOO.Class(IceElement)
local ComboPoints = IceCore_CreateClass(IceElement)
ComboPoints.prototype.comboSize = 20

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local ComboPointsBar = AceOO.Class(IceBarElement)
local ComboPointsBar = IceCore_CreateClass(IceBarElement)
function ComboPointsBar.prototype:init()
ComboPointsBar.super.prototype.init(self, "ComboPointsBar")
@ -56,7 +54,7 @@ end
function ComboPointsBar.prototype:CreateFrame()
ComboPointsBar.super.prototype.CreateFrame(self)
self:UpdateComboPoints()
end

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
IceCustomBar = AceOO.Class(IceUnitBar)
IceCustomBar = IceCore_CreateClass(IceUnitBar)
local validUnits = {"player", "target", "focus", "focustarget", "pet", "pettarget", "vehicle", "targettarget", "main hand weapon", "off hand weapon"}
local buffOrDebuff = {"buff", "debuff"}

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
IceCustomCDBar = AceOO.Class(IceUnitBar)
IceCustomCDBar = IceCore_CreateClass(IceUnitBar)
local validDisplayModes = {"Always", "When ready", "When cooling down"}

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
IceCustomCount = AceOO.Class(IceElement)
IceCustomCount = IceCore_CreateClass(IceElement)
IceCustomCount.prototype.countSize = 20

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
IceCustomHealth = AceOO.Class(IceTargetHealth)
IceCustomHealth = IceCore_CreateClass(IceTargetHealth)
IceCustomHealth.prototype.scheduledEvent = nil
-- Constructor --

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
IceCustomMana = AceOO.Class(IceTargetMana)
IceCustomMana = IceCore_CreateClass(IceTargetMana)
IceCustomMana.prototype.scheduledEvent = nil
-- Constructor --

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local DruidMana = AceOO.Class(IceUnitBar)
local DruidMana = IceCore_CreateClass(IceUnitBar)
DruidMana.prototype.druidMana = nil
DruidMana.prototype.druidManaMax = nil
@ -13,7 +11,7 @@ function DruidMana.prototype:init()
self.side = IceCore.Side.Right
self.offset = 0
self:SetDefaultColor("DruidMana", 87, 82, 141)
end

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local EclipseBar = AceOO.Class(IceBarElement)
local EclipseBar = IceCore_CreateClass(IceBarElement)
EclipseBar.prototype.barUpdateColor = "EclipseLunar"
function EclipseBar.prototype:init()

View File

@ -1,8 +1,6 @@
local AceOO = AceLibrary("AceOO-2.0")
-- changed to inherit from the TargetCC bar since the only difference is the unit and the default placement
-- helps keep changes in one place and we don't have to duplicate the CC spell tables and they don't have to be globals
local FocusCC = AceOO.Class(TargetCC)
local FocusCC = IceCore_CreateClass(TargetCC)
-- Constructor --
function FocusCC.prototype:init()
@ -17,7 +15,7 @@ function FocusCC.prototype:GetDefaultSettings()
settings["side"] = IceCore.Side.Right
settings["offset"] = 5
return settings
end

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local FocusCast = AceOO.Class(IceCastBar)
local FocusCast = IceCore_CreateClass(IceCastBar)
-- Constructor --
function FocusCast.prototype:init()

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local FocusHealth = AceOO.Class(IceUnitBar)
local FocusHealth = IceCore_CreateClass(IceUnitBar)
FocusHealth.prototype.color = nil

View File

@ -1,12 +1,10 @@
local AceOO = AceLibrary("AceOO-2.0")
local FocusMana = AceOO.Class(IceUnitBar)
local FocusMana = IceCore_CreateClass(IceUnitBar)
-- Constructor --
function FocusMana.prototype:init()
FocusMana.super.prototype.init(self, "FocusMana", "focus")
self:SetDefaultColor("FocusMana", 52, 64, 221)
self:SetDefaultColor("FocusRage", 235, 44, 26)
self:SetDefaultColor("FocusEnergy", 228, 242, 31)
@ -65,17 +63,17 @@ function FocusMana.prototype:Update(unit)
if (unit and (unit ~= self.unit)) then
return
end
if ((not UnitExists(unit)) or (self.maxMana == 0)) then
self:Show(false)
return
else
else
self:Show(true)
end
local manaType = UnitPowerType(self.unit)
local color = "FocusMana"
if (self.moduleSettings.scaleManaColor) then
color = "ScaledManaColor"
@ -87,11 +85,11 @@ function FocusMana.prototype:Update(unit)
elseif (manaType == SPELL_POWER_ENERGY) then
color = "FocusEnergy"
end
if (self.tapped) then
color = "Tapped"
end
self:UpdateBar(self.manaPercentage, color)
if not IceHUD.IceCore:ShouldUseDogTags() then

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local IceFocusThreat = AceOO.Class(IceThreat)
local IceFocusThreat = IceCore_CreateClass(IceThreat)
-- constructor
function IceFocusThreat.prototype:init()

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local GlobalCoolDown = AceOO.Class(IceBarElement)
local GlobalCoolDown = IceCore_CreateClass(IceBarElement)
GlobalCoolDown.prototype.scheduledEvent = nil
-- Constructor --

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local HolyPower = AceOO.Class(IceClassPowerCounter)
local HolyPower = IceCore_CreateClass(IceClassPowerCounter)
function HolyPower.prototype:init()
HolyPower.super.prototype.init(self, "HolyPower")

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local HungerForBlood = AceOO.Class(IceUnitBar)
local HungerForBlood = IceCore_CreateClass(IceUnitBar)
local hfbEndTime = 0
local hfbDuration = 0
@ -25,7 +23,7 @@ end
-- OVERRIDE
function HungerForBlood.prototype:Enable(core)
HungerForBlood.super.prototype.Enable(self, core)
if IceHUD.WowVer >= 30000 then
self:RegisterEvent("UNIT_AURA", "UpdateHungerForBlood")
else
@ -71,7 +69,7 @@ function HungerForBlood.prototype:GetOptions()
local opts = HungerForBlood.super.prototype.GetOptions(self)
opts["textSettings"].args["upperTextString"]["desc"] = "The text to display under this bar. # will be replaced with the number of Slice and Dice seconds remaining."
opts["allowClickCast"] = {
type = 'toggle',
name = 'Allow click casting',

View File

@ -1,13 +1,11 @@
local AceOO = AceLibrary("AceOO-2.0")
local LacerateCount = AceOO.Class(IceElement)
local LacerateCount = IceCore_CreateClass(IceElement)
LacerateCount.prototype.lacerateSize = 20
-- Constructor --
function LacerateCount.prototype:init()
LacerateCount.super.prototype.init(self, "LacerateCount")
self:SetDefaultColor("LacerateCount", 1, 1, 0)
self.scalingEnabled = true
end
@ -160,7 +158,7 @@ end
-- OVERRIDE
function LacerateCount.prototype:Redraw()
LacerateCount.super.prototype.Redraw(self)
self:CreateFrame()
self:UpdateLacerateCount()
end
@ -169,7 +167,7 @@ end
-- OVERRIDE
function LacerateCount.prototype:Enable(core)
LacerateCount.super.prototype.Enable(self, core)
self:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateLacerateCount")
self:RegisterEvent("UNIT_AURA", "UpdateLacerateCount")
@ -193,7 +191,7 @@ function LacerateCount.prototype:CreateFrame()
self.frame:SetHeight(1)
self.frame:ClearAllPoints()
self.frame:SetPoint("TOP", self.parent, "BOTTOM", self.moduleSettings.hpos, self.moduleSettings.vpos)
self:Show(true)
self:CreateLacerateFrame()
@ -311,7 +309,7 @@ function LacerateCount.prototype:UpdateLacerateCount()
else
self.frame.graphicalBG[i]:Hide()
end
if (points ~= nil and i <= points) then
self.frame.graphical[i]:Show()
else

View File

@ -1,13 +1,11 @@
local AceOO = AceLibrary("AceOO-2.0")
local MaelstromCount = AceOO.Class(IceElement)
local MaelstromCount = IceCore_CreateClass(IceElement)
MaelstromCount.prototype.maelstromSize = 20
-- Constructor --
function MaelstromCount.prototype:init()
MaelstromCount.super.prototype.init(self, "MaelstromCount")
self:SetDefaultColor("MaelstromCount", 1, 1, 0)
self.scalingEnabled = true
end
@ -139,7 +137,7 @@ end
-- OVERRIDE
function MaelstromCount.prototype:Redraw()
MaelstromCount.super.prototype.Redraw(self)
self:CreateFrame()
self:UpdateMaelstromCount()
end
@ -148,7 +146,7 @@ end
-- OVERRIDE
function MaelstromCount.prototype:Enable(core)
MaelstromCount.super.prototype.Enable(self, core)
self:RegisterEvent("UNIT_AURA", "UpdateMaelstromCount")
self:CreateMaelstromFrame(true)
@ -167,7 +165,7 @@ function MaelstromCount.prototype:CreateFrame()
self.frame:SetHeight(1)
self.frame:ClearAllPoints()
self.frame:SetPoint("TOP", self.parent, "BOTTOM", 0, self.moduleSettings.vpos)
self:Show(true)
self:CreateMaelstromFrame()
@ -289,7 +287,7 @@ function MaelstromCount.prototype:UpdateMaelstromCount(event, unit)
else
self.frame.graphicalBG[i]:Hide()
end
if (points ~= nil and i <= points) then
self.frame.graphical[i]:Show()
else

View File

@ -1,5 +1,3 @@
local AceOO = AceLibrary("AceOO-2.0")
-- 2 classes in the same file.. ugly but keeps the idea of
-- "1 module = 1 file" intact
@ -8,7 +6,7 @@ local AceOO = AceLibrary("AceOO-2.0")
-- MirrorBar --
-------------------------------------------------------------------------------
local MirrorBar = AceOO.Class(IceBarElement)
local MirrorBar = IceCore_CreateClass(IceBarElement)
MirrorBar.prototype.timer = nil
MirrorBar.prototype.value = nil
@ -155,7 +153,7 @@ end
-------------------------------------------------------------------------------
local MirrorBarHandler = AceOO.Class(IceElement)
local MirrorBarHandler = IceCore_CreateClass(IceElement)
MirrorBarHandler.prototype.bars = nil

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local PetHealth = AceOO.Class(IceUnitBar)
local PetHealth = IceCore_CreateClass(IceUnitBar)
PetHealth.prototype.happiness = nil

View File

@ -1,5 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local PetInfo = AceOO.Class(IceTargetInfo)
local PetInfo = IceCore_CreateClass(IceTargetInfo)
-- Constructor --
function PetInfo.prototype:init()

View File

@ -1,16 +1,14 @@
local AceOO = AceLibrary("AceOO-2.0")
local PetMana = AceOO.Class(IceUnitBar)
local PetMana = IceCore_CreateClass(IceUnitBar)
-- Constructor --
function PetMana.prototype:init()
PetMana.super.prototype.init(self, "PetMana", "pet")
self:SetDefaultColor("PetMana", 62, 54, 152)
self:SetDefaultColor("PetRage", 171, 59, 59)
self:SetDefaultColor("PetEnergy", 218, 231, 31)
self:SetDefaultColor("PetFocus", 242, 149, 98)
self.scalingEnabled = true
end
@ -42,7 +40,7 @@ function PetMana.prototype:CreateFrame()
else
point = "BOTTOMRIGHT"
end
self.frame.bottomUpperText:ClearAllPoints()
self.frame.bottomUpperText:SetPoint(point, relativeTo, relativePoint, 0, 0)
end
@ -95,7 +93,7 @@ function PetMana.prototype:ManaType(event, unit)
if (unit ~= self.unit) then
return
end
self.manaType = UnitPowerType(self.unit)
self:Update(self.unit)
end

View File

@ -1,8 +1,6 @@
local AceOO = AceLibrary("AceOO-2.0")
-- changed to inherit from the TargetCC bar since the only difference is the unit and the default placement
-- helps keep changes in one place and we don't have to duplicate the CC spell tables and they don't have to be globals
local PlayerCC = AceOO.Class(TargetCC)
local PlayerCC = IceCore_CreateClass(TargetCC)
-- Constructor --
function PlayerCC.prototype:init()
@ -17,7 +15,7 @@ function PlayerCC.prototype:GetDefaultSettings()
settings["side"] = IceCore.Side.Left
settings["offset"] = 5
return settings
end

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local PlayerHealth = AceOO.Class(IceUnitBar)
local PlayerHealth = IceCore_CreateClass(IceUnitBar)
PlayerHealth.prototype.resting = nil
PlayerHealth.prototype.pendingBlizzardPartyHide = false
@ -90,8 +88,8 @@ function PlayerHealth.prototype:Enable(core)
self:RegisterEvent("UNIT_EXITED_VEHICLE", "ExitingVehicle")
if IceHUD.WowVer < 40000 then
if AceLibrary:HasInstance("LibHealComm-4.0") then
HealComm = AceLibrary("LibHealComm-4.0")
HealComm = LibStub("LibHealComm-4.0", true)
if HealComm then
HealComm.RegisterCallback(self, "HealComm_HealStarted", function(event, casterGUID, spellID, spellType, endTime, ...) self:HealComm_HealEvent(event, casterGUID, spellID, spellType, endTime, ...) end)
HealComm.RegisterCallback(self, "HealComm_HealUpdated", function(event, casterGUID, spellID, spellType, endTime, ...) self:HealComm_HealEvent(event, casterGUID, spellID, spellType, endTime, ...) end)
HealComm.RegisterCallback(self, "HealComm_HealDelayed", function(event, casterGUID, spellID, spellType, endTime, ...) self:HealComm_HealEvent(event, casterGUID, spellID, spellType, endTime, ...) end)
@ -1417,4 +1415,4 @@ function PlayerHealth.prototype:OutCombat()
end
-- Load us up
IceHUD.PlayerHealth = PlayerHealth:new()
IceHUD.PlayerHealth = PlayerHealth.new()

View File

@ -1,5 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local PlayerInfo = AceOO.Class(IceTargetInfo)
local PlayerInfo = IceCore_CreateClass(IceTargetInfo)
local EPSILON = 0.5

View File

@ -1,8 +1,6 @@
local AceOO = AceLibrary("AceOO-2.0")
-- changed to inherit from the TargetInvuln bar since the only difference is the unit and the default placement
-- helps keep changes in one place and we don't have to duplicate the Invuln spell tables and they don't have to be globals
local PlayerInvuln = AceOO.Class(TargetInvuln)
local PlayerInvuln = IceCore_CreateClass(TargetInvuln)
-- Constructor --
function PlayerInvuln.prototype:init()
@ -17,7 +15,7 @@ function PlayerInvuln.prototype:GetDefaultSettings()
settings["side"] = IceCore.Side.Left
settings["offset"] = 3
return settings
end

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local PlayerMana = AceOO.Class(IceUnitBar)
local PlayerMana = IceCore_CreateClass(IceUnitBar)
PlayerMana.prototype.manaType = nil
PlayerMana.prototype.tickStart = nil
@ -9,7 +7,7 @@ PlayerMana.prototype.previousEnergy = nil
-- Constructor --
function PlayerMana.prototype:init()
PlayerMana.super.prototype.init(self, "PlayerMana", "player")
self:SetDefaultColor("PlayerMana", 62, 54, 152)
self:SetDefaultColor("PlayerRage", 171, 59, 59)
self:SetDefaultColor("PlayerEnergy", 218, 231, 31)
@ -54,8 +52,8 @@ if self:ShouldUseTicker() then
end,
order = 51
}
opts["tickerAlpha"] =
opts["tickerAlpha"] =
{
type = 'range',
name = 'Energy Ticker Alpha',
@ -92,7 +90,7 @@ end
end,
order = 53
}
return opts
end
@ -116,7 +114,7 @@ function PlayerMana.prototype:Enable(core)
self:RegisterEvent("UNIT_ENERGY", "UpdateEnergy")
self:RegisterEvent("UNIT_RUNIC_POWER", "UpdateEvent")
end
self:RegisterEvent("UNIT_ENTERED_VEHICLE", "EnteringVehicle")
self:RegisterEvent("UNIT_EXITED_VEHICLE", "ExitingVehicle")
@ -226,7 +224,7 @@ function PlayerMana.prototype:Update(unit, powertype)
if (unit and (unit ~= self.unit)) then
return
end
if powertype ~= nil and powertype == "ENERGY" then
self:UpdateEnergy(nil, unit)
end
@ -234,7 +232,7 @@ function PlayerMana.prototype:Update(unit, powertype)
if self.unit == "vehicle" and ((not UnitExists(unit)) or (self.maxMana == 0)) then
self:Show(false)
return
else
else
self:Show(true)
end
@ -246,7 +244,7 @@ function PlayerMana.prototype:Update(unit, powertype)
if (self.manaType ~= SPELL_POWER_ENERGY and self:ShouldUseTicker()) then
self.tickerFrame:Hide()
end
local color = "PlayerMana"
if (self.moduleSettings.scaleManaColor) then
color = "ScaledManaColor"
@ -264,7 +262,7 @@ function PlayerMana.prototype:Update(unit, powertype)
color = "PlayerFocus"
end
end
self:UpdateBar(self.manaPercentage, color)
local powerType = UnitPowerType(self.unit)
@ -343,24 +341,24 @@ function PlayerMana.prototype:EnergyTick()
self.tickerFrame:Hide()
return
end
local now = GetTime()
local elapsed = now - self.tickStart
if (elapsed > 2) then
self.tickStart = now
end
local pos = elapsed / 2
local y = pos * (self.settings.barHeight-2)
if (self.moduleSettings.side == IceCore.Side.Left) then
self.tickerFrame.spark:SetTexCoord(1, 0, 1-pos-0.01, 1-pos)
else
self.tickerFrame.spark:SetTexCoord(0, 1, 1-pos-0.01, 1-pos)
end
self.tickerFrame.spark:SetHeight(self.settings.barHeight * 0.01)
self.tickerFrame:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", 0, y)
end
@ -373,16 +371,16 @@ function PlayerMana.prototype:CreateTickerFrame()
if not (self.tickerFrame) then
self.tickerFrame = CreateFrame("Frame", nil, self.barFrame)
end
self.tickerFrame:SetFrameStrata("BACKGROUND")
self.tickerFrame:SetWidth(self.settings.barWidth)
self.tickerFrame:SetHeight(self.settings.barHeight)
if not (self.tickerFrame.spark) then
self.tickerFrame.spark = self.tickerFrame:CreateTexture(nil, "BACKGROUND")
self.tickerFrame:Hide()
end
self.tickerFrame.spark:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture())
self.tickerFrame.spark:SetBlendMode("ADD")
self.tickerFrame.spark:ClearAllPoints()
@ -391,7 +389,7 @@ function PlayerMana.prototype:CreateTickerFrame()
self.tickerFrame.spark:SetHeight(0)
self.tickerFrame.spark:SetVertexColor(self:GetColor("PlayerEnergy", self.moduleSettings.tickerAlpha))
self.tickerFrame:ClearAllPoints()
self.tickerFrame:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", 0, 0)
end

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local RangeCheck = AceOO.Class(IceElement)
local RangeCheck = IceCore_CreateClass(IceElement)
RangeCheck.prototype.scheduledEvent = nil
local LibRange = nil
@ -9,19 +7,17 @@ local DogTag = nil
-- Constructor --
function RangeCheck.prototype:init()
RangeCheck.super.prototype.init(self, "RangeCheck")
self.scalingEnabled = true
if AceLibrary:HasInstance("LibRangeCheck-2.0") then
LibRange = AceLibrary("LibRangeCheck-2.0")
end
LibRange = LibStub("LibRangeCheck-2.0", true)
end
function RangeCheck.prototype:Enable(core)
RangeCheck.super.prototype.Enable(self, core)
if IceHUD.IceCore:ShouldUseDogTags() then
DogTag = AceLibrary("LibDogTag-3.0")
DogTag = LibStub("LibDogTag-3.0", true)
self:RegisterFontStrings()
else
self.scheduledEvent = self:ScheduleRepeatingTimer("UpdateRange", 0.1)
@ -167,7 +163,7 @@ function RangeCheck.prototype:UpdateRange()
else
self.frame.rangeFontString:SetText("Unknown")
end
self.frame.rangeFontString:SetWidth(0)
else
self.frame.rangeFontString:SetText()

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local Runes = AceOO.Class(IceElement)
local Runes = IceCore_CreateClass(IceElement)
-- blizzard cracks me up. the below block is copied verbatim from RuneFrame.lua ;)
--Readability == win

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local ShardCounter = AceOO.Class(IceClassPowerCounter)
local ShardCounter = IceCore_CreateClass(IceClassPowerCounter)
function ShardCounter.prototype:init()
ShardCounter.super.prototype.init(self, "ShardCounter")

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local SliceAndDice = AceOO.Class(IceUnitBar)
local SliceAndDice = IceCore_CreateClass(IceUnitBar)
local NetherbladeItemIdList = {29044, 29045, 29046, 29047, 29048}
-- Parnic - bah, have to abandon the more robust string representation of each slot because of loc issues...
@ -39,7 +37,7 @@ end
-- OVERRIDE
function SliceAndDice.prototype:Enable(core)
SliceAndDice.super.prototype.Enable(self, core)
self:RegisterEvent("PLAYER_TARGET_CHANGED", "TargetChanged")
self:RegisterEvent("UNIT_AURA", "UpdateSliceAndDice")
self:RegisterEvent("UNIT_COMBO_POINTS", "UpdateDurationBar")
@ -125,7 +123,7 @@ function SliceAndDice.prototype:GetOptions()
return not self.moduleSettings.enabled
end
}
return opts
end
@ -288,7 +286,7 @@ function SliceAndDice.prototype:UpdateDurationBar(event, unit)
self.durationFrame.bar:SetTexCoord(0, 1, 1-scale, 1)
end
self.durationFrame.bar:SetHeight(self.settings.barHeight * scale)
if scale == 0 then
self.durationFrame.bar:Hide()
else

View File

@ -1,13 +1,11 @@
local AceOO = AceLibrary("AceOO-2.0")
local SunderCount = AceOO.Class(IceElement)
local SunderCount = IceCore_CreateClass(IceElement)
SunderCount.prototype.sunderSize = 20
-- Constructor --
function SunderCount.prototype:init()
SunderCount.super.prototype.init(self, "SunderCount")
self:SetDefaultColor("SunderCount", 1, 1, 0)
self.scalingEnabled = true
end
@ -139,7 +137,7 @@ end
-- OVERRIDE
function SunderCount.prototype:Redraw()
SunderCount.super.prototype.Redraw(self)
self:CreateFrame()
self:UpdateSunderCount()
end
@ -148,7 +146,7 @@ end
-- OVERRIDE
function SunderCount.prototype:Enable(core)
SunderCount.super.prototype.Enable(self, core)
self:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateSunderCount")
self:RegisterEvent("UNIT_AURA", "UpdateSunderCount")
@ -172,7 +170,7 @@ function SunderCount.prototype:CreateFrame()
self.frame:SetHeight(1)
self.frame:ClearAllPoints()
self.frame:SetPoint("TOP", self.parent, "BOTTOM", 0, self.moduleSettings.vpos)
self:Show(true)
self:CreateSunderFrame()
@ -290,7 +288,7 @@ function SunderCount.prototype:UpdateSunderCount()
else
self.frame.graphicalBG[i]:Hide()
end
if (points ~= nil and i <= points) then
self.frame.graphical[i]:Show()
else

View File

@ -1,7 +1,5 @@
local AceOO = AceLibrary("AceOO-2.0")
-- needs to not be local so that we can inherit from it
TargetCC = AceOO.Class(IceUnitBar)
TargetCC = IceCore_CreateClass(IceUnitBar)
TargetCC.prototype.debuffName = nil
TargetCC.prototype.debuffRemaining = 0

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local TargetCast = AceOO.Class(IceCastBar)
local TargetCast = IceCore_CreateClass(IceCastBar)
TargetCast.prototype.notInterruptible = false

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
IceTargetHealth = AceOO.Class(IceUnitBar)
IceTargetHealth = IceCore_CreateClass(IceUnitBar)
IceTargetHealth.prototype.color = nil
IceTargetHealth.prototype.determineColor = true

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
IceTargetInfo = AceOO.Class(IceElement)
IceTargetInfo = IceCore_CreateClass(IceElement)
local DogTag = nil
@ -40,7 +38,7 @@ function IceTargetInfo.prototype:init(moduleName, unit)
else
IceTargetInfo.super.prototype.init(self, moduleName)
end
self.scalingEnabled = true
end
@ -53,8 +51,10 @@ function IceTargetInfo.prototype:Enable(core)
IceTargetInfo.super.prototype.Enable(self, core)
if IceHUD.IceCore:ShouldUseDogTags() then
DogTag = AceLibrary("LibDogTag-3.0")
AceLibrary("LibDogTag-Unit-3.0")
DogTag = LibStub("LibDogTag-3.0", true)
if DogTag then
LibStub("LibDogTag-Unit-3.0")
end
end
self:RegisterEvent("UNIT_AURA", "AuraChanged")
@ -78,7 +78,7 @@ function IceTargetInfo.prototype:Enable(core)
self.moduleSettings.line3tag = origDefaults["line3tag"]
self.moduleSettings.myTagVersion = IceHUD.CurrTagVersion
end
if self.moduleSettings.filterBuffs == nil
and self.moduleSettings.filterDebuffs == nil
and self.moduleSettings.filter ~= nil then
@ -94,7 +94,7 @@ end
-- OVERRIDE
function IceTargetInfo.prototype:Disable(core)
IceTargetInfo.super.prototype.Disable(self, core)
UnregisterUnitWatch(self.frame)
self:UnregisterFontStrings()
@ -170,7 +170,7 @@ function IceTargetInfo.prototype:GetOptions()
end,
order = 32
}
opts["stackFontSize"] = {
type = 'range',
name = 'Stack Font Size',
@ -190,7 +190,7 @@ function IceTargetInfo.prototype:GetOptions()
end,
order = 32
}
opts["zoom"] = {
type = 'range',
name = 'Buff zoom',
@ -257,7 +257,7 @@ function IceTargetInfo.prototype:GetOptions()
end,
order = 35
}
opts["showBuffs"] = {
type = 'toggle',
name = 'Show buffs',
@ -274,7 +274,7 @@ function IceTargetInfo.prototype:GetOptions()
end,
order = 36
}
opts["filterBuffs"] = {
type = 'select',
name = 'Only show buffs by me',
@ -292,7 +292,7 @@ function IceTargetInfo.prototype:GetOptions()
values = { "Never", "In Combat", "Always" },
order = 36.1
}
opts["showDebuffs"] = {
type = 'toggle',
name = 'Show debuffs',
@ -309,7 +309,7 @@ function IceTargetInfo.prototype:GetOptions()
end,
order = 36.2
}
opts["filterDebuffs"] = {
type = 'select',
name = 'Only show debuffs by me',
@ -327,7 +327,7 @@ function IceTargetInfo.prototype:GetOptions()
values = { "Never", "In Combat", "Always" },
order = 36.3
}
opts["perRow"] = {
type = 'range',
name = 'Buffs / row',
@ -517,7 +517,7 @@ function IceTargetInfo.prototype:GetOptions()
name = 'Mouse settings',
order = 37.9
}
opts["mouseTarget"] = {
type = 'toggle',
name = 'Mouseover for target',
@ -534,7 +534,7 @@ function IceTargetInfo.prototype:GetOptions()
end,
order = 38
}
opts["mouseBuff"] = {
type = 'toggle',
name = 'Mouseover for buffs',
@ -743,7 +743,7 @@ function IceTargetInfo.prototype:RedrawBuffs()
if (self.moduleSettings.enabled) then
self:CreateBuffFrame(false)
self:CreateDebuffFrame(false)
self:TargetChanged()
end
end
@ -875,7 +875,7 @@ function IceTargetInfo.prototype:CreateRaidIconFrame()
if (not self.frame.raidIcon) then
self.frame.raidIcon = CreateFrame("Frame", nil, self.frame)
end
if (not self.frame.raidIcon.icon) then
self.frame.raidIcon.icon = self.frame.raidIcon:CreateTexture(nil, "BACKGROUND")
self.frame.raidIcon.icon:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcons")
@ -884,7 +884,7 @@ function IceTargetInfo.prototype:CreateRaidIconFrame()
self.frame.raidIcon:SetPoint("BOTTOM", self.frame, "TOP", 0, 1)
self.frame.raidIcon:SetWidth(16)
self.frame.raidIcon:SetHeight(16)
self.frame.raidIcon.icon:SetAllPoints(self.frame.raidIcon)
SetRaidTargetIconTexture(self.frame.raidIcon.icon, 0)
self.frame.raidIcon:Hide()
@ -898,7 +898,7 @@ function IceTargetInfo.prototype:CreateBuffFrame(redraw)
self.frame.buffFrame:SetFrameStrata("BACKGROUND")
self.frame.buffFrame:SetWidth(1)
self.frame.buffFrame:SetHeight(1)
self.frame.buffFrame:Show()
self.frame.buffFrame.buffs = {}
@ -906,7 +906,7 @@ function IceTargetInfo.prototype:CreateBuffFrame(redraw)
self.frame.buffFrame:ClearAllPoints()
self.frame.buffFrame:SetPoint("TOPRIGHT", self.frame, self.moduleSettings.buffAnchorTo, self.moduleSettings.buffOffset['x'], self.moduleSettings.buffOffset['y'])
if (not redraw) then
local direction = self.moduleSettings.buffGrowDirection == "Left" and -1 or 1
self.frame.buffFrame.buffs = self:CreateIconFrames(self.frame.buffFrame, direction, self.frame.buffFrame.buffs, "buff")
@ -927,7 +927,7 @@ function IceTargetInfo.prototype:CreateDebuffFrame(redraw)
self.frame.debuffFrame:SetFrameStrata("BACKGROUND")
self.frame.debuffFrame:SetWidth(1)
self.frame.debuffFrame:SetHeight(1)
self.frame.debuffFrame:Show()
self.frame.debuffFrame.buffs = {}
@ -935,7 +935,7 @@ function IceTargetInfo.prototype:CreateDebuffFrame(redraw)
self.frame.debuffFrame:ClearAllPoints()
self.frame.debuffFrame:SetPoint("TOPLEFT", self.frame, self.moduleSettings.debuffAnchorTo, self.moduleSettings.debuffOffset['x'], self.moduleSettings.debuffOffset['y'])
if (not redraw) then
local direction = self.moduleSettings.debuffGrowDirection == "Left" and -1 or 1
self.frame.debuffFrame.buffs = self:CreateIconFrames(self.frame.debuffFrame, direction, self.frame.debuffFrame.buffs, "debuff")
@ -968,7 +968,7 @@ function IceTargetInfo.prototype:CreateIconFrames(parent, direction, buffs, type
buffs[i]:SetWidth(self.moduleSettings.buffSize)
buffs[i]:SetHeight(self.moduleSettings.buffSize)
end
buffs[i].icon:SetFrameStrata("BACKGROUND")
if buffs[i].fromPlayer then
buffs[i].icon:SetWidth(self.moduleSettings.ownBuffSize-2)
@ -977,7 +977,7 @@ function IceTargetInfo.prototype:CreateIconFrames(parent, direction, buffs, type
buffs[i].icon:SetWidth(self.moduleSettings.buffSize-2)
buffs[i].icon:SetHeight(self.moduleSettings.buffSize-2)
end
buffs[i].cd:SetFrameStrata("BACKGROUND")
buffs[i].cd:SetFrameLevel(buffs[i].icon:GetFrameLevel()+1)
buffs[i].cd:SetReverse(true)
@ -1064,7 +1064,7 @@ function IceTargetInfo.prototype:UpdateBuffs()
filterBuffs = true
end
end
if (self.moduleSettings.filterDebuffs == "Always") then
filterDebuffs = true
elseif (self.moduleSettings.filterDebuffs == "In Combat") then
@ -1219,7 +1219,7 @@ function IceTargetInfo.prototype:TargetChanged()
if (not UnitExists(self.unit)) then
--self.frame:Hide()
--self.frame.target:Hide()
self.frame.targetName:SetText()
self.frame.targetInfo:SetText()
self.frame.targetGuild:SetText()
@ -1307,7 +1307,7 @@ end
function IceTargetInfo.prototype:TargetReaction(unit)
if (unit == self.unit or unit == internal) then
self.reaction = UnitReaction(self.unit, "player")
-- if we don't get reaction, unit is out of range - has to be friendly
-- to be targettable (party/raid)
if (not self.reaction) then

View File

@ -1,7 +1,5 @@
local AceOO = AceLibrary("AceOO-2.0")
-- needs to not be local so that we can inherit from it
TargetInvuln = AceOO.Class(IceUnitBar)
TargetInvuln = IceCore_CreateClass(IceUnitBar)
TargetInvuln.prototype.buffName = nil
TargetInvuln.prototype.buffRemaining = 0

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
IceTargetMana = AceOO.Class(IceUnitBar)
IceTargetMana = IceCore_CreateClass(IceUnitBar)
IceTargetMana.prototype.registerEvents = true
IceTargetHealth.prototype.color = nil
IceTargetMana.prototype.determineColor = true

View File

@ -1,7 +1,6 @@
local AceOO = AceLibrary("AceOO-2.0")
local SML = AceLibrary("LibSharedMedia-3.0")
local SML = LibStub("LibSharedMedia-3.0")
local TargetOfTarget = AceOO.Class(IceElement)
local TargetOfTarget = IceCore_CreateClass(IceElement)
TargetOfTarget.prototype.stackedDebuffs = nil
TargetOfTarget.prototype.buffSize = nil
@ -28,7 +27,7 @@ end
-- OVERRIDE
function TargetOfTarget.prototype:GetOptions()
local opts = TargetOfTarget.super.prototype.GetOptions(self)
opts["vpos"] = {
type = "range",
name = "Vertical Position",
@ -85,7 +84,7 @@ function TargetOfTarget.prototype:GetOptions()
end,
order = 32
}
opts["fontSize"] = {
type = 'range',
name = 'Font Size',
@ -105,7 +104,7 @@ function TargetOfTarget.prototype:GetOptions()
end,
order = 33
}
opts["mouse"] = {
type = 'toggle',
name = 'Mouseover',
@ -122,7 +121,7 @@ function TargetOfTarget.prototype:GetOptions()
end,
order = 34
}
opts["texture"] = {
type = 'select',
name = 'Texture',
@ -178,7 +177,7 @@ function TargetOfTarget.prototype:GetOptions()
return self.moduleSettings.sizeToGap
end
}
return opts
end
@ -210,19 +209,19 @@ end
function TargetOfTarget.prototype:Enable(core)
TargetOfTarget.super.prototype.Enable(self, core)
self.scheduledEvent = self:ScheduleRepeatingTimer("Update", 0.2)
RegisterUnitWatch(self.frame)
self:Update()
end
function TargetOfTarget.prototype:Disable(core)
TargetOfTarget.super.prototype.Disable(self, core)
self:CancelTimer(self.scheduledEvent, true)
UnregisterUnitWatch(self.frame)
end
@ -245,14 +244,14 @@ function TargetOfTarget.prototype:CreateFrame()
self.frame:SetHeight(self.height)
self.frame:SetPoint("TOP", self.parent, "TOP", self.moduleSettings.hpos, self.moduleSettings.vpos)
self.frame:SetScale(self.moduleSettings.scale)
self.frame.unit = self.unit -- for blizz default tooltip handling
if (self.moduleSettings.mouse) then
self.frame:EnableMouse(true)
self.frame:RegisterForClicks("AnyUp")
self.frame:SetScript("OnEnter", function(frame) self:OnEnter(frame) end)
self.frame:SetScript("OnLeave", function(frame) self:OnLeave(frame) end)
else
@ -262,7 +261,7 @@ function TargetOfTarget.prototype:CreateFrame()
self.frame:SetScript("OnLeave", nil)
end
self.frame:SetAttribute("type1", "target")
self.frame:SetAttribute("unit", self.unit)
@ -271,7 +270,7 @@ function TargetOfTarget.prototype:CreateFrame()
self:CreateToTFrame()
self:CreateToTHPFrame()
self:CreateDebuffFrame()
-- click casting support
ClickCastFrames = ClickCastFrames or {}
ClickCastFrames[self.frame] = true
@ -309,8 +308,8 @@ function TargetOfTarget.prototype:CreateBarFrame()
self.frame.bar.texture:SetTexture(SML:Fetch(SML.MediaType.STATUSBAR, self.moduleSettings.texture))
self.frame.bar.texture:SetAllPoints(self.frame.bar)
self.frame.bar:SetStatusBarTexture(self.frame.bar.texture)
if (not self.frame.bar.highLight) then
self.frame.bar.highLight = self.frame.bar:CreateTexture(nil, "OVERLAY")
end
@ -327,7 +326,7 @@ end
function TargetOfTarget.prototype:CreateToTFrame()
self.frame.totName = self:FontFactory(self.moduleSettings.fontSize, self.frame.bar, self.frame.totName)
if self.moduleSettings.sizeToGap then
self.frame.totName:SetWidth(self.settings.gap-40)
else
@ -382,14 +381,14 @@ function TargetOfTarget.prototype:CreateIconFrames(parent)
buffs[i]:SetHeight(self.buffSize)
buffs[i]:SetPoint("LEFT", (i-1) * self.buffSize + (i-1), 0)
buffs[i]:Show()
buffs[i].texture = buffs[i]:CreateTexture()
buffs[i].texture:SetTexture(nil)
buffs[i].texture:SetAllPoints(buffs[i])
buffs[i].stack = self:FontFactory(11, buffs[i], buffs[i].stack, "OUTLINE")
buffs[i].stack:SetPoint("BOTTOMRIGHT" , buffs[i], "BOTTOMRIGHT", 2, -1)
if (self.moduleSettings.mouse) then
buffs[i]:EnableMouse(true)
buffs[i]:SetScript("OnEnter", function(this) self:BuffOnEnter(this) end)
@ -399,7 +398,7 @@ function TargetOfTarget.prototype:CreateIconFrames(parent)
buffs[i]:SetScript("OnEnter", nil)
buffs[i]:SetScript("OnLeave", nil)
end
buffs[i].unit = self.unit
end
return buffs
@ -408,7 +407,7 @@ end
function TargetOfTarget.prototype:UpdateBuffs()
local debuffs = 0
if (self.moduleSettings.showDebuffs) then
for i = 1, IceCore.BuffLimit do
local buffName, buffRank, buffTexture, buffApplications = UnitDebuff(self.unit, i)
@ -419,14 +418,14 @@ function TargetOfTarget.prototype:UpdateBuffs()
if not (self.stackedDebuffs[debuffs]) then
self.stackedDebuffs[debuffs] = {}
end
self.stackedDebuffs[debuffs].texture = buffTexture
self.stackedDebuffs[debuffs].count = buffApplications
self.stackedDebuffs[debuffs].id = i
end
end
end
for i = 1, IceCore.BuffLimit do
if (self.moduleSettings.showDebuffs and (i <= debuffs)) then
self.frame.debuffFrame.buffs[i]:Show()
@ -449,15 +448,15 @@ function TargetOfTarget.prototype:Update()
return
end
self.hadTarget = false
self.frame.totName:SetText()
self.frame.totHealth:SetText()
self:UpdateBuffs()
return
end
self.hadTarget = true
self:UpdateBuffs()
local _, unitClass = UnitClass(self.unit)

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local TargetTargetCast = AceOO.Class(IceCastBar)
local TargetTargetCast = IceCore_CreateClass(IceCastBar)
TargetTargetCast.prototype.scheduledEvent = nil
local SelfDisplayModeOptions = {"Hide", "Normal"}

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local TargetTargetHealth = AceOO.Class(IceTargetHealth)
local TargetTargetHealth = IceCore_CreateClass(IceTargetHealth)
TargetTargetHealth.prototype.scheduledEvent = nil
local SelfDisplayModeOptions = {"Color as SelfColor", "Hide", "Normal"}
@ -151,7 +149,7 @@ function TargetTargetHealth.prototype:Update(unit)
return
end
end
if self.moduleSettings.selfDisplayMode == "Hide" then
self:Show(UnitExists(self.unit))
end

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local TargetTargetMana = AceOO.Class(IceTargetMana)
local TargetTargetMana = IceCore_CreateClass(IceTargetMana)
TargetTargetMana.prototype.scheduledEvent = nil
local SelfDisplayModeOptions = {"Hide", "Normal"}
@ -51,7 +49,7 @@ function TargetTargetMana.prototype:GetOptions()
values = SelfDisplayModeOptions,
order = 44,
}
return opts
end

View File

@ -4,9 +4,7 @@ Author: Caryna/Turalyon EU (Alliance) (updated for Threat-2.0 by 'acapela' of Wo
Description: adds a threat bar to IceHUD
]]
local AceOO = AceLibrary("AceOO-2.0")
IceThreat = AceOO.Class(IceUnitBar)
IceThreat = IceCore_CreateClass(IceUnitBar)
IceThreat.prototype.color = nil
IceThreat.aggroBar = nil

View File

@ -1,6 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local Totems = AceOO.Class(IceElement)
local Totems = IceCore_CreateClass(IceElement)
-- the below block is copied from TotemFrame.lua
local FIRE_TOTEM_SLOT = 1;