Skip to content

Commit

Permalink
Update API checks for Cataclysm
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevcairiel committed Apr 20, 2024
1 parent a602c01 commit ac69079
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion ActionBars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ local select, ipairs, pairs, tostring, tonumber, min, setmetatable = select, ipa

local WoWClassic = (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE)
local WoWWrath = (WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC)
local WoWCata = (WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC)
local WoW10 = select(4, GetBuildInfo()) >= 100000

local LAB10 = LibStub("LibActionButton-1.0")
Expand Down Expand Up @@ -327,7 +328,7 @@ function BT4ActionBars:Create(id, config, bindingmapping)
bar.bindingmapping = bindingmapping

bar:SetScript("OnEvent", bar.OnEvent)
if not WoWClassic then
if not WoWClassic or WoWCata then
bar:RegisterEvent("PLAYER_TALENT_UPDATE")
bar:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED")
end
Expand Down
3 changes: 2 additions & 1 deletion Bartender4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")

local WoWClassic = (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE)
local WoWWrath = (WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC)
local WoWCata = (WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC)
local WoW10 = select(4, GetBuildInfo()) >= 100000

local LDB = LibStub("LibDataBroker-1.1", true)
local LDBIcon = LibStub("LibDBIcon-1.0", true)
local LibDualSpec = (not WoWClassic or WoWWrath) and LibStub("LibDualSpec-1.0", true)
local LibDualSpec = (not WoWClassic or WoWWrath or WoWCata) and LibStub("LibDualSpec-1.0", true)

local _G = _G
local type, pairs, hooksecurefunc = type, pairs, hooksecurefunc
Expand Down
5 changes: 3 additions & 2 deletions StanceBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ local StanceBarMod = Bartender4:NewModule("StanceBar", "AceEvent-3.0")
-- fetch upvalues
local ButtonBar = Bartender4.ButtonBar.prototype

local WoWClassic = (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE)
local WoWRetail = (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE)
local WoWCata = (WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC)

local _G = _G
local format, setmetatable, min, select = string.format, setmetatable, min, select
Expand Down Expand Up @@ -55,7 +56,7 @@ function StanceBarMod:OnEnable()
self.bar:RegisterEvent("UPDATE_SHAPESHIFT_USABLE")
self.bar:RegisterEvent("UPDATE_SHAPESHIFT_COOLDOWN")
self.bar:RegisterEvent("PLAYER_REGEN_ENABLED")
if not WoWClassic then
if WoWRetail or WoWCata then
self.bar:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR")
self.bar:RegisterEvent("UPDATE_OVERRIDE_ACTIONBAR")
self.bar:RegisterEvent("UPDATE_POSSESS_BAR")
Expand Down
7 changes: 4 additions & 3 deletions StateBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ local table_insert, table_concat, fmt = table.insert, table.concat, string.forma
-- GLOBALS: GetSpellInfo, InCombatLockdown, GetNumShapeshiftForms
-- GLOBALS: MainMenuBarArtFrame, OverrideActionBar, RegisterStateDriver, UnregisterStateDriver

local WoWClassic = (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE)
local WoWRetail = (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE)
local WoWBC = (WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC)
local WoWWrath = (WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC)
local WoWCata = (WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC)

local StateBar = setmetatable({}, {__index = ButtonBar})
local StateBar_MT = {__index = StateBar}
Expand Down Expand Up @@ -46,7 +47,7 @@ function Bartender4.StateBar:Create(id, config, name)
local bar = setmetatable(Bartender4.ButtonBar:Create(id, config, name), StateBar_MT)

if playerclass == "DRUID" then
if not WoWClassic then
if WoWRetail or WoWCata then
bar:RegisterEvent("PLAYER_TALENT_UPDATE")
bar:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED")
end
Expand Down Expand Up @@ -86,7 +87,7 @@ local modifiers = { "ctrl", "alt", "shift" }
-- specifiy the available stances for each class
local DefaultStanceMap

if WoWClassic then
if not WoWRetail then
DefaultStanceMap = setmetatable({}, { __index = function(t,k)
local newT = nil
if k == "DRUID" then
Expand Down

0 comments on commit ac69079

Please sign in to comment.