diff --git a/IceCastBar.lua b/IceCastBar.lua index 2601d6a..831ab88 100644 --- a/IceCastBar.lua +++ b/IceCastBar.lua @@ -30,9 +30,15 @@ end local GetSpellInfo = GetSpellInfo if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then - GetSpellInfo = function(id) - local info = C_Spell.GetSpellInfo - return info.name, nil, info.iconID + GetSpellInfo = function(spellID) + if not spellID then + return nil + end + + local spellInfo = C_Spell.GetSpellInfo(spellID) + if spellInfo then + return spellInfo.name, nil, spellInfo.iconID, spellInfo.castTime, spellInfo.minRange, spellInfo.maxRange, spellInfo.spellID, spellInfo.originalIconID + end end end diff --git a/IceCore.lua b/IceCore.lua index d560b51..5bec2f4 100644 --- a/IceCore.lua +++ b/IceCore.lua @@ -19,6 +19,20 @@ end local DogTag = LibStub("LibDogTag-3.0", true) +local GetSpellInfo = GetSpellInfo +if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then + GetSpellInfo = function(spellID) + if not spellID then + return nil + end + + local spellInfo = C_Spell.GetSpellInfo(spellID) + if spellInfo then + return spellInfo.name, nil, spellInfo.iconID, spellInfo.castTime, spellInfo.minRange, spellInfo.maxRange, spellInfo.spellID, spellInfo.originalIconID + end + end +end + local GetSpellName = GetSpellInfo if C_Spell and C_Spell.GetSpellName then GetSpellName = C_Spell.GetSpellName diff --git a/IceHUD.lua b/IceHUD.lua index bbd2f9f..deb64ad 100644 --- a/IceHUD.lua +++ b/IceHUD.lua @@ -53,6 +53,20 @@ else end end +local GetSpellInfo = GetSpellInfo +if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then + GetSpellInfo = function(spellID) + if not spellID then + return nil + end + + local spellInfo = C_Spell.GetSpellInfo(spellID) + if spellInfo then + return spellInfo.name, nil, spellInfo.iconID, spellInfo.castTime, spellInfo.minRange, spellInfo.maxRange, spellInfo.spellID, spellInfo.originalIconID + end + end +end + local GetSpellName = GetSpellInfo if C_Spell and C_Spell.GetSpellName then GetSpellName = C_Spell.GetSpellName diff --git a/IceStackCounter.lua b/IceStackCounter.lua index 91fd828..7e82250 100644 --- a/IceStackCounter.lua +++ b/IceStackCounter.lua @@ -3,6 +3,21 @@ local L = LibStub("AceLocale-3.0"):GetLocale("IceHUD", false) local validUnits = {"player", "target", "focus", "pet", "vehicle", "targettarget", "main hand weapon", "off hand weapon"} local buffOrDebuff = {"buff", "debuff", "charges", "spell count"} +local GetSpellCharges = GetSpellCharges +if not GetSpellCharges and C_Spell then + GetSpellCharges = function(spellID) + local spellChargeInfo = C_Spell.GetSpellCharges(spellID) + if spellChargeInfo then + return spellChargeInfo.currentCharges, spellChargeInfo.maxCharges, spellChargeInfo.cooldownStartTime, spellChargeInfo.cooldownDuration, spellChargeInfo.chargeModRate + end + end +end + +local GetSpellCount = GetSpellCount +if not GetSpellCount and C_Spell then + GetSpellCount = C_Spell.GetSpellCastCount +end + -- OVERRIDE function IceStackCounter_GetOptions(frame, opts) opts["customHeader"] = { diff --git a/modules/CastBar.lua b/modules/CastBar.lua index 582945b..3bc9817 100644 --- a/modules/CastBar.lua +++ b/modules/CastBar.lua @@ -13,6 +13,16 @@ if not IsSpellInRange and C_Spell then IsSpellInRange = C_Spell.IsSpellInRange end +local GetSpellCooldown = GetSpellCooldown +if not GetSpellCooldown and C_Spell then + GetSpellCooldown = function(spellID) + local spellCooldownInfo = C_Spell.GetSpellCooldown(spellID) + if spellCooldownInfo then + return spellCooldownInfo.startTime, spellCooldownInfo.duration, spellCooldownInfo.isEnabled, spellCooldownInfo.modRate + end + end +end + CastBar.prototype.spellCastSent = nil -- Constructor -- diff --git a/modules/ComboPoints.lua b/modules/ComboPoints.lua index 62aef01..2b1849d 100644 --- a/modules/ComboPoints.lua +++ b/modules/ComboPoints.lua @@ -3,6 +3,20 @@ local ComboPoints = IceCore_CreateClass(IceElement) local IceHUD = _G.IceHUD +local GetSpellInfo = GetSpellInfo +if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then + GetSpellInfo = function(spellID) + if not spellID then + return nil + end + + local spellInfo = C_Spell.GetSpellInfo(spellID) + if spellInfo then + return spellInfo.name, nil, spellInfo.iconID, spellInfo.castTime, spellInfo.minRange, spellInfo.maxRange, spellInfo.spellID, spellInfo.originalIconID + end + end +end + local GetSpellName = GetSpellInfo if C_Spell and C_Spell.GetSpellName then GetSpellName = C_Spell.GetSpellName diff --git a/modules/CustomBar.lua b/modules/CustomBar.lua index 35f0979..2dbef8b 100644 --- a/modules/CustomBar.lua +++ b/modules/CustomBar.lua @@ -20,7 +20,7 @@ end local GetSpellInfo = GetSpellInfo if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then GetSpellInfo = function(id) - local info = C_Spell.GetSpellInfo + local info = C_Spell.GetSpellInfo(id) return info.name, nil, info.iconID end end diff --git a/modules/CustomCDBar.lua b/modules/CustomCDBar.lua index 91bc05b..7f9412b 100644 --- a/modules/CustomCDBar.lua +++ b/modules/CustomCDBar.lua @@ -30,16 +30,31 @@ end local GetSpellInfo = GetSpellInfo if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then GetSpellInfo = function(id) - local info = C_Spell.GetSpellInfo + local info = C_Spell.GetSpellInfo(id) return info.name, nil, info.iconID end end +local GetSpellCooldown = GetSpellCooldown +if not GetSpellCooldown and C_Spell then + GetSpellCooldown = function(spellID) + local spellCooldownInfo = C_Spell.GetSpellCooldown(spellID) + if spellCooldownInfo then + return spellCooldownInfo.startTime, spellCooldownInfo.duration, spellCooldownInfo.isEnabled, spellCooldownInfo.modRate + end + end +end + local GetItemInfo = GetItemInfo if not GetItemInfo and C_Item then GetItemInfo = C_Item.GetItemInfo end +local IsUsableSpell = IsUsableSpell +if not IsUsableSpell and C_Spell then + IsUsableSpell = C_Spell.IsSpellUsable +end + IceCustomCDBar.prototype.cooldownDuration = 0 IceCustomCDBar.prototype.cooldownEndTime = 0 IceCustomCDBar.prototype.coolingDown = false diff --git a/modules/CustomCounterBar.lua b/modules/CustomCounterBar.lua index 6b6d6f4..ab59faa 100644 --- a/modules/CustomCounterBar.lua +++ b/modules/CustomCounterBar.lua @@ -10,7 +10,7 @@ local DefaultAuraIcon = "Interface\\Icons\\Spell_Frost_Frost" local GetSpellInfo = GetSpellInfo if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then GetSpellInfo = function(id) - local info = C_Spell.GetSpellInfo + local info = C_Spell.GetSpellInfo(id) return info.name, nil, info.iconID end end diff --git a/modules/GlobalCoolDown.lua b/modules/GlobalCoolDown.lua index d62ecce..55dabd6 100644 --- a/modules/GlobalCoolDown.lua +++ b/modules/GlobalCoolDown.lua @@ -9,11 +9,21 @@ end local GetSpellInfo = GetSpellInfo if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then GetSpellInfo = function(id) - local info = C_Spell.GetSpellInfo + local info = C_Spell.GetSpellInfo(id) return info.name, nil, info.iconID, info.castTime end end +local GetSpellCooldown = GetSpellCooldown +if not GetSpellCooldown and C_Spell then + GetSpellCooldown = function(spellID) + local spellCooldownInfo = C_Spell.GetSpellCooldown(spellID) + if spellCooldownInfo then + return spellCooldownInfo.startTime, spellCooldownInfo.duration, spellCooldownInfo.isEnabled, spellCooldownInfo.modRate + end + end +end + -- Constructor -- function GlobalCoolDown.prototype:init() GlobalCoolDown.super.prototype.init(self, "GlobalCoolDown") diff --git a/modules/Resolve.lua b/modules/Resolve.lua index afb6dba..541403c 100644 --- a/modules/Resolve.lua +++ b/modules/Resolve.lua @@ -4,6 +4,20 @@ local Resolve = IceCore_CreateClass(IceUnitBar) local RESOLVE_SPELL_ID = 158300 local RESOLVE_MAX = 240 +local GetSpellInfo = GetSpellInfo +if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then + GetSpellInfo = function(spellID) + if not spellID then + return nil + end + + local spellInfo = C_Spell.GetSpellInfo(spellID) + if spellInfo then + return spellInfo.name, nil, spellInfo.iconID, spellInfo.castTime, spellInfo.minRange, spellInfo.maxRange, spellInfo.spellID, spellInfo.originalIconID + end + end +end + local GetSpellName = GetSpellInfo if C_Spell and C_Spell.GetSpellName then GetSpellName = C_Spell.GetSpellName diff --git a/modules/RollTheBones.lua b/modules/RollTheBones.lua index 441b14d..89afc74 100644 --- a/modules/RollTheBones.lua +++ b/modules/RollTheBones.lua @@ -26,6 +26,20 @@ if Enum and Enum.PowerType then SPELL_POWER_COMBO_POINTS = Enum.PowerType.ComboPoints end +local GetSpellInfo = GetSpellInfo +if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then + GetSpellInfo = function(spellID) + if not spellID then + return nil + end + + local spellInfo = C_Spell.GetSpellInfo(spellID) + if spellInfo then + return spellInfo.name, nil, spellInfo.iconID, spellInfo.castTime, spellInfo.minRange, spellInfo.maxRange, spellInfo.spellID, spellInfo.originalIconID + end + end +end + local GetSpellName = GetSpellInfo if C_Spell and C_Spell.GetSpellName then GetSpellName = C_Spell.GetSpellName diff --git a/modules/Stagger.lua b/modules/Stagger.lua index 13faff0..31e7e01 100644 --- a/modules/Stagger.lua +++ b/modules/Stagger.lua @@ -23,6 +23,20 @@ if STAGGER_STATES then STAGGER_RED_TRANSITION = STAGGER_STATES.RED.threshold end +local GetSpellInfo = GetSpellInfo +if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then + GetSpellInfo = function(spellID) + if not spellID then + return nil + end + + local spellInfo = C_Spell.GetSpellInfo(spellID) + if spellInfo then + return spellInfo.name, nil, spellInfo.iconID, spellInfo.castTime, spellInfo.minRange, spellInfo.maxRange, spellInfo.spellID, spellInfo.originalIconID + end + end +end + local GetSpellName = GetSpellInfo if C_Spell and C_Spell.GetSpellName then GetSpellName = C_Spell.GetSpellName diff --git a/modules/TargetCC.lua b/modules/TargetCC.lua index f66aa6a..555892d 100644 --- a/modules/TargetCC.lua +++ b/modules/TargetCC.lua @@ -12,6 +12,20 @@ if GetNumGroupMembers then GetNumRaidMembers = GetNumGroupMembers end +local GetSpellInfo = GetSpellInfo +if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then + GetSpellInfo = function(spellID) + if not spellID then + return nil + end + + local spellInfo = C_Spell.GetSpellInfo(spellID) + if spellInfo then + return spellInfo.name, nil, spellInfo.iconID, spellInfo.castTime, spellInfo.minRange, spellInfo.maxRange, spellInfo.spellID, spellInfo.originalIconID + end + end +end + local GetSpellName = GetSpellInfo if C_Spell and C_Spell.GetSpellName then GetSpellName = C_Spell.GetSpellName diff --git a/modules/TargetHealth.lua b/modules/TargetHealth.lua index b371b8b..a94d502 100644 --- a/modules/TargetHealth.lua +++ b/modules/TargetHealth.lua @@ -3,6 +3,11 @@ IceTargetHealth = IceCore_CreateClass(IceUnitBar) local IceHUD = _G.IceHUD +local IsAddOnLoaded = IsAddOnLoaded +if not IsAddOnLoaded and C_AddOns then + IsAddOnLoaded = C_AddOns.IsAddOnLoaded +end + IceTargetHealth.prototype.color = nil IceTargetHealth.prototype.determineColor = true IceTargetHealth.prototype.registerEvents = true diff --git a/modules/TargetInvuln.lua b/modules/TargetInvuln.lua index 4b1699f..754b9cd 100644 --- a/modules/TargetInvuln.lua +++ b/modules/TargetInvuln.lua @@ -12,6 +12,20 @@ if GetNumGroupMembers then GetNumRaidMembers = GetNumGroupMembers end +local GetSpellInfo = GetSpellInfo +if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then + GetSpellInfo = function(spellID) + if not spellID then + return nil + end + + local spellInfo = C_Spell.GetSpellInfo(spellID) + if spellInfo then + return spellInfo.name, nil, spellInfo.iconID, spellInfo.castTime, spellInfo.minRange, spellInfo.maxRange, spellInfo.spellID, spellInfo.originalIconID + end + end +end + local GetSpellName = GetSpellInfo if C_Spell and C_Spell.GetSpellName then GetSpellName = C_Spell.GetSpellName diff --git a/modules/Vengeance.lua b/modules/Vengeance.lua index ef87d53..fd46e8e 100644 --- a/modules/Vengeance.lua +++ b/modules/Vengeance.lua @@ -3,6 +3,20 @@ local Vengeance = IceCore_CreateClass(IceUnitBar) local VENGEANCE_SPELL_ID = 93098 +local GetSpellInfo = GetSpellInfo +if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then + GetSpellInfo = function(spellID) + if not spellID then + return nil + end + + local spellInfo = C_Spell.GetSpellInfo(spellID) + if spellInfo then + return spellInfo.name, nil, spellInfo.iconID, spellInfo.castTime, spellInfo.minRange, spellInfo.maxRange, spellInfo.spellID, spellInfo.originalIconID + end + end +end + local GetSpellName = GetSpellInfo if C_Spell and C_Spell.GetSpellName then GetSpellName = C_Spell.GetSpellName