Skip to content

Commit

Permalink
Remove GetSpellBookItemName usage
Browse files Browse the repository at this point in the history
  • Loading branch information
nebularg committed Aug 20, 2024
1 parent 5da4e91 commit 248d103
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
24 changes: 11 additions & 13 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,26 @@ globals = {
"PitBull4",
"oRA3",

-- Frames/tables
-- FrameXML
"BasicMessageDialog",
"ChatFontNormal",
"CombatFeedbackText",
"CooldownFrame_Set",
"CopyTable",
"DEFAULT_CHAT_FRAME",
"GameTooltip",
"SOUNDKIT",
"GameTooltip_SetDefaultAnchor",
"SpellIsSelfBuff",
"StaticPopup_Show",
"StaticPopupDialogs",
"StatusTrackingBarManager",
"SOUNDKIT",
"TooltipUtil",
"UIErrorsFrame",
"UIParent",
"tContains",
"tInvert",
"ipairs_reverse",

"Enum",

Expand All @@ -73,18 +82,14 @@ globals = {
"CancelItemTempEnchantment",
"CancelUnitBuff",
"CheckInteractDistance",
"CooldownFrame_Set",
"CopyTable",
"CreateFrame",
"DestroyTotem",
"GameTooltip_SetDefaultAnchor",
"GetBattlefieldStatus",
"GetCVarBool",
"GetComboPoints",
"GetBuildInfo",
"GetFriendshipReputation",
"GetInventoryItemLink",
"GetItemQualityColor",
"GetLocale",
"GetManagedEnvironment",
"GetMaxPlayerLevel",
Expand All @@ -104,7 +109,6 @@ globals = {
"GetScreenWidth",
"GetShapeshiftFormID",
"GetSpecialization",
"GetSpellBookItemName",
"GetTalentInfoBySpecialization",
"GetThreatStatusColor",
"GetTime",
Expand All @@ -131,9 +135,6 @@ globals = {
"SetPortraitTexture",
"ShowBossFrameWhenUninteractable",
"SpellGetVisibilityInfo",
"SpellIsSelfBuff",
"StaticPopup_Show",
"TooltipUtil",
"UnitAffectingCombat",
"UnitBattlePetLevel",
"UnitBattlePetType",
Expand Down Expand Up @@ -218,10 +219,7 @@ globals = {
"strtrim",
"table",
"tostringall",
"tContains",
"tInvert",
"wipe",
"ipairs_reverse",

-- Strings
"ALTERNATE_POWER_INDEX",
Expand Down
19 changes: 6 additions & 13 deletions Modules/Aura/Filter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ local L = PitBull4.L
local PitBull4_Aura = PitBull4:GetModule("Aura")

local wow_cata = PitBull4.wow_cata
local GetSpellName = C_Spell.GetSpellName or _G.GetSpellInfo -- XXX wow_tww

local GetSpellName = C_Spell.GetSpellName

local player_class = UnitClassBase("player")
local _, player_race = UnitRace("player")
Expand All @@ -20,14 +21,6 @@ function PitBull4_Aura:GetFilterDB(filter)
return self.db.profile.global.filters[filter]
end

local function IsBookSpell(id)
local spell = GetSpellName(id)
if not spell then return end
if GetSpellBookItemName(spell) then
return true
end
end

-- Setup the data for who can dispel what types of auras.
-- dispel in this context means remove from friendly players
local can_dispel = {
Expand Down Expand Up @@ -181,7 +174,7 @@ function PitBull4_Aura:PLAYER_TALENT_UPDATE()
self:GetFilterDB('/3').aura_type_list.Poison = can_dispel.PALADIN.Poison

elseif player_class == "PRIEST" then
can_dispel.PRIEST.Magic = IsBookSpell(527) or IsPlayerSpell(32375) -- Dispel Magic, Mass Dispel
can_dispel.PRIEST.Magic = IsPlayerSpell(527) or IsPlayerSpell(32375) -- Dispel Magic, Mass Dispel
self:GetFilterDB('03').aura_type_list.Magic = can_dispel.PRIEST.Magic
can_dispel.PRIEST.Disease = IsPlayerSpell(528) or IsPlayerSpell(552) -- Cure Disease, Abolish Disease
self:GetFilterDB('03').aura_type_list.Disease = can_dispel.PRIEST.Disease
Expand All @@ -194,15 +187,15 @@ function PitBull4_Aura:PLAYER_TALENT_UPDATE()
can_dispel.SHAMAN.Poison = IsPlayerSpell(526) -- or IsPlayerSpell(8166) -- Cure Poison, Poison Cleansing Totem
self:GetFilterDB('23').aura_type_list.Poison = can_dispel.SHAMAN.Poison

can_purge.SHAMAN.Magic = IsBookSpell(370) -- Purge
can_purge.SHAMAN.Magic = IsPlayerSpell(370) -- Purge
self:GetFilterDB('27').aura_type_list.Magic = can_purge.SHAMAN.Magic

elseif player_class == "WARLOCK" then
can_purge.WARLOCK.Magic = IsBookSpell(19505) -- Devour Magic
can_purge.WARLOCK.Magic = IsSpellKnown(19505, true) -- Devour Magic
self:GetFilterDB('37').aura_type_list.Magic = can_purge.WARLOCK.Magic

elseif player_class == "WARRIOR" then
can_purge.WARRIOR.Magic = IsBookSpell(23922) -- Shield Slam
can_purge.WARRIOR.Magic = IsPlayerSpell(23922) -- Shield Slam
self:GetFilterDB('47').aura_type_list.Magic = can_purge.WARRIOR.Magic
end
end
Expand Down

0 comments on commit 248d103

Please sign in to comment.