From 1a6bf90117e46a0b10c8fdff3f98066782afa192 Mon Sep 17 00:00:00 2001 From: wardz <10900212+wardz@users.noreply.github.com> Date: Sun, 12 Nov 2023 18:30:27 +0100 Subject: [PATCH] quick fixes for 1.15.0 ptr --- ClassicCastbars/ClassicCastbars.lua | 1 + .../ClassicCastbars_NonClassic.lua | 27 ++++++++----------- ClassicCastbars/core/ClassicSpellData.lua | 14 +++++++++- .../ClassicCastbars_Options.lua | 6 ++--- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/ClassicCastbars/ClassicCastbars.lua b/ClassicCastbars/ClassicCastbars.lua index d760b88..fff3757 100644 --- a/ClassicCastbars/ClassicCastbars.lua +++ b/ClassicCastbars/ClassicCastbars.lua @@ -1,4 +1,5 @@ if WOW_PROJECT_ID ~= WOW_PROJECT_CLASSIC then return end +if select(7, GetBuildInfo()) >= 11500 then return end -- Patch 1.15.0 now has built in castbars local _, namespace = ... local PoolManager = namespace.PoolManager diff --git a/ClassicCastbars/ClassicCastbars_NonClassic.lua b/ClassicCastbars/ClassicCastbars_NonClassic.lua index 056c694..77ead5d 100644 --- a/ClassicCastbars/ClassicCastbars_NonClassic.lua +++ b/ClassicCastbars/ClassicCastbars_NonClassic.lua @@ -1,11 +1,4 @@ -if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then return end - ---[[ - Currently missing features for retail after Dragonflight's UI changes: - - Empowered evoker castbars - - Personal player castbar - - Uninterruptible checks should be rewritten with new unit aura system (TBC) -]] +if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC and select(7, GetBuildInfo()) < 11500 then return end local _, namespace = ... local PoolManager = namespace.PoolManager @@ -24,7 +17,7 @@ addon.AnchorManager = namespace.AnchorManager addon.defaultConfig = namespace.defaultConfig addon.activeFrames = activeFrames -local CLIENT_IS_TBC = WOW_PROJECT_ID == (WOW_PROJECT_BURNING_CRUSADE_CLASSIC or 5) +local CLIENT_IS_TBC_OR_SOD = (WOW_PROJECT_ID == (WOW_PROJECT_BURNING_CRUSADE_CLASSIC or 5) or (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC and select(7, GetBuildInfo()) >= 11500)) local CLIENT_IS_RETAIL = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE local GetSchoolString = _G.GetSchoolString @@ -105,7 +98,9 @@ function addon:DisableBlizzardCastbar() if not self.isSpellbarsHooked then self.isSpellbarsHooked = true TargetFrameSpellBar:HookScript("OnShow", HideBlizzardSpellbar) - FocusFrameSpellBar:HookScript("OnShow", HideBlizzardSpellbar) + if FocusFrameSpellBar then + FocusFrameSpellBar:HookScript("OnShow", HideBlizzardSpellbar) + end end -- arena frames are load on demand, hook if available @@ -156,7 +151,7 @@ function addon:BindCurrentCastData(castbar, unitID, isChanneled) cast.isInterrupted = nil cast.isCastComplete = nil - if CLIENT_IS_TBC then -- only wotlk and beyond has notInterruptible from UnitCastingInfo() + if CLIENT_IS_TBC_OR_SOD then -- only wotlk and beyond has notInterruptible from UnitCastingInfo() cast.isUninterruptible = uninterruptibleList[spellName] or false if not cast.isUninterruptible and not cast.unitIsPlayer then local _, _, _, _, _, npcID = strsplit("-", UnitGUID(unitID)) @@ -177,7 +172,7 @@ function addon:BindCurrentCastData(castbar, unitID, isChanneled) end end - if CLIENT_IS_TBC and not cast.isUninterruptible then + if CLIENT_IS_TBC_OR_SOD and not cast.isUninterruptible then -- Check for temp buff immunities for i = 1, 40 do local buffName = UnitAura(unitID, i, "HELPFUL") @@ -212,8 +207,8 @@ function addon:UNIT_AURA(unitID) end end - -- Checks below are only needed for TBC (+vanilla but thats handled in the other CLassicCastbars lua file) - if not CLIENT_IS_TBC then return end + -- Checks below are only needed for TBC/Classic SoD + if not CLIENT_IS_TBC_OR_SOD then return end local castbar = activeFrames[unitID] if not castbar or not castbar._data then return end @@ -600,7 +595,7 @@ local playerInterrupts = namespace.playerInterrupts function addon:COMBAT_LOG_EVENT_UNFILTERED() local _, eventType, _, _, _, srcFlags, _, dstGUID, _, dstFlags, _, _, spellName, _, missType, _, extraSchool = CombatLogGetCurrentEventInfo() - if eventType == "SPELL_MISSED" and CLIENT_IS_TBC then + if eventType == "SPELL_MISSED" and CLIENT_IS_TBC_OR_SOD then if missType == "IMMUNE" and playerInterrupts[spellName] then -- FIXME: event no longer generated for interrupts in latest builds? if bit_band(dstFlags, COMBATLOG_OBJECT_CONTROL_PLAYER) <= 0 then -- dest unit is not a player if bit_band(srcFlags, COMBATLOG_OBJECT_CONTROL_PLAYER) > 0 then -- source unit is player @@ -628,7 +623,7 @@ function addon:COMBAT_LOG_EVENT_UNFILTERED() end end elseif eventType == "SPELL_AURA_REMOVED" then - if CLIENT_IS_TBC and castImmunityBuffs[spellName] then + if CLIENT_IS_TBC_OR_SOD and castImmunityBuffs[spellName] then local unitID = self:GetFirstAvailableUnitIDByGUID(dstGUID) if not unitID then return end diff --git a/ClassicCastbars/core/ClassicSpellData.lua b/ClassicCastbars/core/ClassicSpellData.lua index 73b2785..8fd489f 100644 --- a/ClassicCastbars/core/ClassicSpellData.lua +++ b/ClassicCastbars/core/ClassicSpellData.lua @@ -8,7 +8,7 @@ local CLIENT_PRE_WOTLK = (CLIENT_IS_TBC or CLIENT_IS_CLASSIC_ERA) -- Spell data for wotlk / pre-wotlk era. -- Feel free to reuse any of this data. -if CLIENT_IS_CLASSIC_ERA then +if CLIENT_IS_CLASSIC_ERA and select(7, GetBuildInfo()) < 11500 then local castSpellIDs = { 25262, -- Abomination Spit @@ -1847,6 +1847,11 @@ if CLIENT_PRE_WOTLK then namespace.playerInterrupts[GetSpellInfo(32747)] = 1 -- Deadly Throw Interrupt Effect end + if CLIENT_IS_CLASSIC_ERA and select(7, GetBuildInfo()) >= 11500 then + namespace.playerInterrupts[GetSpellInfo(410176)] = 1 -- Skull Bash + namespace.playerInterrupts[GetSpellInfo(425609)] = 1 -- Rebuke + end + if CLIENT_IS_TBC then namespace.playerSilences = { [GetSpellInfo(18469)] = 1, -- Counterspell - Silenced @@ -1855,6 +1860,13 @@ if CLIENT_PRE_WOTLK then [GetSpellInfo(15487)] = 1, -- Silence [GetSpellInfo(34490)] = 1, -- Silencing Shot } + elseif CLIENT_IS_CLASSIC_ERA and select(7, GetBuildInfo()) >= 11500 then + namespace.playerSilences = { + [GetSpellInfo(18469)] = 1, -- Counterspell - Silenced + [GetSpellInfo(18425)] = 1, -- Kick - Silenced + [GetSpellInfo(24259)] = 1, -- Spell Lock + [GetSpellInfo(15487)] = 1, -- Silence + } else namespace.playerSilences = {} end diff --git a/ClassicCastbars_Options/ClassicCastbars_Options.lua b/ClassicCastbars_Options/ClassicCastbars_Options.lua index f87be7e..d46c23e 100644 --- a/ClassicCastbars_Options/ClassicCastbars_Options.lua +++ b/ClassicCastbars_Options/ClassicCastbars_Options.lua @@ -674,7 +674,7 @@ local function GetOptionsTable() order = 7, name = _G.BROWSER_CLEAR_CACHE, desc = L.CLEAR_CACHE_DESC, - hidden = not isClassicEra, + hidden = select(7, GetBuildInfo()) >= 11500, confirm = function() return L.CLEAR_CACHE_DESC end, @@ -694,7 +694,7 @@ local function GetOptionsTable() order = 8, type = "description", name = "\n", - hidden = not isClassicEra, + hidden = select(7, GetBuildInfo()) >= 11500, }, -- Character specific savedvariables Checkbox @@ -722,7 +722,7 @@ local function GetOptionsTable() order = 10, width = 1.4, type = "toggle", - hidden = not isClassicEra, + hidden = select(7, GetBuildInfo()) >= 11500, name = "Clear CastTime Cache Per Zone", desc = "Delete cached NPC cast times every time you change a major zone.", get = function()