Skip to content

Commit

Permalink
Cleanup uses of removed functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevcairiel committed Aug 16, 2024
1 parent a0cd5d8 commit 3ff5a92
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 23 deletions.
9 changes: 0 additions & 9 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ read_globals = {
"GetRuneCooldown",
"GetSpecialization",
"GetSpecializationInfoByID",
"GetSpellInfo",
"GetText",
"GetTime",
"GetTotemInfo",
Expand All @@ -80,7 +79,6 @@ read_globals = {
"IsResting",
"IsShiftKeyDown",
"IsSpellKnown",
"IsUsableSpell",
"IsXPUserDisabled",
"UnitAffectingCombat",
"UnitBattlePetType",
Expand All @@ -104,7 +102,6 @@ read_globals = {
"UnitHealth",
"UnitHealthMax",
"UnitInParty",
"UnitInPhase",
"UnitInRaid",
"UnitInRange",
"UnitIsBattlePetCompanion",
Expand Down Expand Up @@ -146,7 +143,6 @@ read_globals = {
"ArenaEnemyPrepFramesContainer",
"ArenaEnemyMatchFramesContainer",
"BuffFrame",
"CastingBarFrame",
"ComboFrame",
"CompactPartyFrame",
"CompactRaidFrameContainer",
Expand All @@ -165,13 +161,10 @@ read_globals = {
"PetFrame",
"PlayerCastingBarFrame",
"PlayerFrame",
"PlayerFrameAlternateManaBar",
"PlayerPowerBarAlt",
"PriestBarFrame",
"RuneFrame",
"TargetFrame",
"TargetFrameToT",
"TemporaryEnchantFrame",
"UIParent",
"WarlockPowerFrame",

Expand All @@ -197,7 +190,6 @@ read_globals = {
"DebuffTypeColor",
"Enum",
"PowerBarColor",
"ADDITIONAL_POWER_BAR_INDEX",
"ALTERNATE_POWER_INDEX",
"CLASS_ICON_TCOORDS",
"CLASS_SORT_ORDER",
Expand All @@ -209,7 +201,6 @@ read_globals = {
"MAX_RAID_MEMBERS",
"MAX_TOTEMS",
"MEMBERS_PER_RAID_GROUP",
"PALADINPOWERBAR_SHOW_LEVEL",
"PET_TYPE_SUFFIX",
"RAID_CLASS_COLORS",
"READY_CHECK_NOT_READY_TEXTURE",
Expand Down
7 changes: 3 additions & 4 deletions ShadowedUnitFrames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ end
local active_hiddens = {}
function ShadowUF:HideBlizzardFrames()
if( self.db.profile.hidden.cast and not active_hiddens.cast ) then
hideBlizzardFrames(true, PlayerCastingBarFrame or CastingBarFrame, PetCastingBarFrame)
hideBlizzardFrames(true, PlayerCastingBarFrame, PetCastingBarFrame)
end

if( self.db.profile.hidden.party and not active_hiddens.party ) then
Expand Down Expand Up @@ -767,12 +767,11 @@ function ShadowUF:HideBlizzardFrames()
end

if( self.db.profile.hidden.buffs and not active_hiddens.buffs ) then
hideBlizzardFrames(false, BuffFrame, TemporaryEnchantFrame or DebuffFrame)
hideBlizzardFrames(false, BuffFrame, DebuffFrame)
end

if( self.db.profile.hidden.player and not active_hiddens.player ) then
-- alternate bar renamed in 10.1.5
hideBlizzardFrames(false, PlayerFrame, PlayerFrameAlternateManaBar or AlternatePowerBar)
hideBlizzardFrames(false, PlayerFrame, AlternatePowerBar)

-- We keep these in case someone is still using the default auras, otherwise it messes up vehicle stuff
PlayerFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
Expand Down
2 changes: 1 addition & 1 deletion modules/auraindicators.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ShadowUF:RegisterModule(Indicators, "auraIndicators", ShadowUF.L["Aura indicator

Indicators.auraFilters = {"boss", "curable"}

local GetSpellTexture = C_Spell and C_Spell.GetSpellTexture or function(id) return (select(3, GetSpellInfo(id))) end
local GetSpellTexture = C_Spell.GetSpellTexture

Indicators.auraConfig = setmetatable({}, {
__index = function(tbl, index)
Expand Down
2 changes: 1 addition & 1 deletion modules/druid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Druid:OnLayoutApplied(frame)
end

function Druid:PowerChanged(frame)
local visible = UnitPowerType(frame.unit) ~= ADDITIONAL_POWER_BAR_INDEX and not frame.inVehicle
local visible = UnitPowerType(frame.unit) ~= Enum.PowerType.Mana and not frame.inVehicle
local type = visible and "RegisterUnitEvent" or "UnregisterSingleEvent"

frame[type](frame, "UNIT_POWER_FREQUENT", self, "Update")
Expand Down
2 changes: 1 addition & 1 deletion modules/holypower.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if( not ShadowUF.ComboPoints ) then return end

local HolyPower = setmetatable({}, {__index = ShadowUF.ComboPoints})
ShadowUF:RegisterModule(HolyPower, "holyPower", ShadowUF.L["Holy Power"], nil, "PALADIN", nil, PALADINPOWERBAR_SHOW_LEVEL)
ShadowUF:RegisterModule(HolyPower, "holyPower", ShadowUF.L["Holy Power"], nil, "PALADIN")
local holyConfig = {max = 5, key = "holyPower", colorKey = "HOLYPOWER", powerType = Enum.PowerType.HolyPower, eventType = "HOLY_POWER", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"}

function HolyPower:OnEnable(frame)
Expand Down
2 changes: 1 addition & 1 deletion modules/priest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Priest:OnLayoutApplied(frame)
end

function Priest:PowerChanged(frame)
local visible = UnitPowerType(frame.unit) ~= ADDITIONAL_POWER_BAR_INDEX and not frame.inVehicle
local visible = UnitPowerType(frame.unit) ~= Enum.PowerType.Mana and not frame.inVehicle
local type = visible and "RegisterUnitEvent" or "UnregisterSingleEvent"

frame[type](frame, "UNIT_POWER_FREQUENT", self, "Update")
Expand Down
4 changes: 2 additions & 2 deletions modules/range.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local GetSpellName = C_Spell and C_Spell.GetSpellName or GetSpellInfo
local IsSpellUsable = C_Spell and C_Spell.IsSpellUsable or IsUsableSpell
local GetSpellName = C_Spell.GetSpellName
local IsSpellUsable = C_Spell.IsSpellUsable
local Range = {
friendly = {
["PRIEST"] = {
Expand Down
2 changes: 1 addition & 1 deletion modules/shaman.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Shaman:OnLayoutApplied(frame)
end

function Shaman:PowerChanged(frame)
local visible = UnitPowerType(frame.unit) ~= ADDITIONAL_POWER_BAR_INDEX and not frame.inVehicle
local visible = UnitPowerType(frame.unit) ~= Enum.PowerType.Mana and not frame.inVehicle
local type = visible and "RegisterUnitEvent" or "UnregisterSingleEvent"

frame[type](frame, "UNIT_POWER_FREQUENT", self, "Update")
Expand Down
2 changes: 1 addition & 1 deletion modules/tags.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local GetSpellName = C_Spell and C_Spell.GetSpellName or GetSpellInfo
local GetSpellName = C_Spell.GetSpellName

local Tags = {afkStatus = {}, offlineStatus = {}, customEvents = {}, powerMap = {}, moduleKey = "tags"}
local tagPool, functionPool, temp, regFontStrings, powerMap = {}, {}, {}, {}, Tags.powerMap
Expand Down
4 changes: 2 additions & 2 deletions options/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ local L = ShadowUF.L

ShadowUF.Config = Config

local GetSpellName = C_Spell and C_Spell.GetSpellName or GetSpellInfo
local GetSpellTexture = C_Spell and C_Spell.GetSpellTexture or function(id) return (select(3, GetSpellInfo(id))) end
local GetSpellName = C_Spell.GetSpellName
local GetSpellTexture = C_Spell.GetSpellTexture

--[[
The part that makes configuration a pain when you actually try is it gets unwieldly when you're adding special code to deal with
Expand Down

0 comments on commit 3ff5a92

Please sign in to comment.