Skip to content

Commit

Permalink
quick fixes for 1.15.0 ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
wardz committed Nov 12, 2023
1 parent 62a261e commit 1a6bf90
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 20 deletions.
1 change: 1 addition & 0 deletions ClassicCastbars/ClassicCastbars.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down
27 changes: 11 additions & 16 deletions ClassicCastbars/ClassicCastbars_NonClassic.lua
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand All @@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
14 changes: 13 additions & 1 deletion ClassicCastbars/core/ClassicSpellData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions ClassicCastbars_Options/ClassicCastbars_Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 1a6bf90

Please sign in to comment.