Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Commit e692f9c

Browse files
committed
add early support for TBC Classic and add support for multiple .toc files
Along side the support for multiple .toc files, we now can finally fix the WoW classic bug about BackdropTemplate not being available by faking the template at runtime.
1 parent 527e561 commit e692f9c

File tree

13 files changed

+98
-30
lines changed

13 files changed

+98
-30
lines changed

ClassicHacks/BackdropTemplate.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!--Neuron is a World of Warcraft® user interface addon.
2+
Copyright (c) 2017-2021 Britt W. Yazel
3+
Copyright (c) 2006-2014 Connor H. Chenoweth
4+
This code is licensed under the MIT license (see LICENSE for details)-->
5+
6+
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ https://github.com/Gethe/wow-ui-source/blob/live/FrameXML/UI.xsd">
7+
<Frame name="BackdropTemplate" virtual="true">
8+
</Frame>
9+
</Ui>

Neuron-Classic.toc

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
## Interface: 11307
2+
## Title: Neuron
3+
## Notes: A macro-based action bar and object manager add-on
4+
## Author: Britt W. Yazel
5+
## Version: @project-version@
6+
## DefaultState: enabled
7+
## OptionalDeps: Masque
8+
## SavedVariables: NeuronProfilesDB
9+
## SavedVariablesPerCharacter:
10+
## X-Credits-Maintainer: Britt W. Yazel
11+
## X-Email: [email protected]
12+
## X-License: MIT
13+
14+
15+
Libs\embeds.xml
16+
Localizations\Neuron_Localizations.xml
17+
18+
Neuron-DB-Defaults.lua
19+
Neuron.lua
20+
Neuron-States.lua
21+
22+
Utilities\DB-Fixer.lua
23+
24+
#fix for missing template in Classic
25+
#I want to remove this as soon as possible
26+
ClassicHacks\BackdropTemplate.xml
27+
28+
Objects\BUTTON.lua
29+
Objects\BAR.lua
30+
Objects\ACTIONBUTTON.lua
31+
Objects\ACTIONBUTTON_DragAndDrop.lua
32+
Objects\ACTIONBUTTON_Flyout.lua
33+
Objects\BAGBTN.lua
34+
Objects\EXITBTN.lua
35+
Objects\EXTRABTN.lua
36+
Objects\MENUBTN.lua
37+
Objects\PETBTN.lua
38+
Objects\STATUSBTN.lua
39+
Objects\ZONEABILITYBTN.lua
40+
Objects\BAR_SnapTo.lua
41+
Objects\KEYBINDER.lua
42+
43+
Neuron-DisableBlizzardUI.lua
44+
Neuron-Console.lua
45+
Neuron-MinimapIcon.lua
46+
47+
XML\NeuronActionButtonTemplate.xml
48+
XML\NeuronAnchorButtonTemplate.xml
49+
XML\NeuronBarTemplate.xml
50+
XML\NeuronBindFrameTemplate.xml
51+
XML\NeuronStatusBarTemplate.xml
52+
53+
Neuron-Defaults.lua
54+
Neuron-Startup.lua
55+
56+
Neuron-GUI.lua
57+
XML\Neuron-GUI.xml

Neuron-Defaults.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ Neuron.DefaultBarOptions.PetBar = {
262262
-----------------------------------
263263
----------- Menu Bar --------------
264264
-----------------------------------
265-
if not Neuron.isWoWClassic then
265+
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
266266
Neuron.DefaultBarOptions.MenuBar = {
267267
[1] = {
268268
snapTo = false,
@@ -310,7 +310,7 @@ end
310310
-----------------------------------
311311
------------ Bag Bar --------------
312312
-----------------------------------
313-
if not Neuron.isWoWClassic then
313+
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
314314
Neuron.DefaultBarOptions.BagBar = {
315315
[1] = {
316316
padH = 1,

Neuron-GUI.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function NeuronGUI:OnInitialize()
9898
NeuronGUI.interfaceOptions.args.profile = LibStub("AceDBOptions-3.0"):GetOptionsTable(Neuron.db)
9999

100100
-- Per spec profiles
101-
if not Neuron.isWoWClassic then
101+
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
102102
local LibDualSpec = LibStub('LibDualSpec-1.0')
103103
LibDualSpec:EnhanceDatabase(Neuron.db, addonName) --enhance the database object with per spec profile features
104104
LibDualSpec:EnhanceOptions(NeuronGUI.interfaceOptions.args.profile, Neuron.db) -- enhance the profiles config panel with per spec profile features
@@ -131,7 +131,7 @@ function NeuronGUI:OnEnable()
131131

132132
NeuronGUI:RegisterEvent("ADDON_LOADED")
133133

134-
if not Neuron.isWoWClassic then
134+
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
135135
NeuronGUI:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED")
136136
end
137137

Neuron-Startup.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function Neuron:RegisterBars()
3333
--Neuron Pet Bar
3434
Neuron:RegisterBarClass("PetBar", "PetBar", L["Pet Bar"], "Pet Button", DB.PetBar, Neuron.PETBTN, 10, true)
3535

36-
if not Neuron.isWoWClassic then
36+
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
3737
--Neuron Zone Ability Bar
3838
Neuron:RegisterBarClass("ZoneAbilityBar", "ZoneAbilityBar", L["Zone Action Bar"], "Zone Action Button", DB.ZoneAbilityBar, Neuron.ZONEABILITYBTN, 5, true)
3939

@@ -116,7 +116,7 @@ function Neuron:RegisterGUI()
116116
CDALPHA = true },
117117
false, 65)
118118

119-
if not Neuron.isWoWClassic then
119+
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
120120
--Neuron Zone Ability Bar
121121
Neuron:RegisterGUIOptions("ZoneAbilityBar", {
122122
AUTOHIDE = true,

Neuron.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ Neuron.enteredWorld = false --flag that gets set when the player enters the worl
104104

105105
if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then --boolean check to set a flag if the current session is WoW Classic. Retail == 1, Classic == 2
106106
Neuron.isWoWClassic = true
107+
elseif WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
108+
Neuron.isWoWClassic_TBC = true
107109
end
108110

109111
Neuron.activeSpec = 1
@@ -200,7 +202,7 @@ function Neuron:OnEnable()
200202
end
201203

202204
--set current spec before loading bars and buttons
203-
if not Neuron.isWoWClassic then
205+
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
204206
Neuron.activeSpec = GetSpecialization()
205207
end
206208

@@ -350,7 +352,7 @@ function Neuron:LoginMessage()
350352
end
351353

352354
--Shadowlands warning that will show as long as a player has one button on their ZoneAbilityBar for Shadowlands content
353-
if not Neuron.isWoWClassic and UnitLevel("player") >= 50 and Neuron.db.profile.ZoneAbilityBar[1] and #Neuron.db.profile.ZoneAbilityBar[1].buttons == 1 then
355+
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC and UnitLevel("player") >= 50 and Neuron.db.profile.ZoneAbilityBar[1] and #Neuron.db.profile.ZoneAbilityBar[1].buttons == 1 then
354356
print(" ")
355357
Neuron:Print(WrapTextInColorCode("IMPORTANT: Shadowlands content now requires multiple Zone Ability Buttons. Please add at least 3 buttons to your Zone Ability Bar to support this new functionality.", "FF00FFEC"))
356358
print(" ")
@@ -436,7 +438,7 @@ function Neuron:UpdateSpellCache()
436438
end
437439
end
438440

439-
if not Neuron.isWoWClassic then
441+
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
440442
for i = 1, select("#", GetProfessions()) do
441443
local index = select(i, GetProfessions())
442444

Objects/ACTIONBUTTON.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ function ACTIONBUTTON:SetupEvents()
130130
self:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateAll")
131131
self:RegisterEvent("UNIT_PET", "UpdateAll")
132132

133-
if not Neuron.isWoWClassic then
133+
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
134134
self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
135135
self:RegisterEvent("EQUIPMENT_SETS_CHANGED")
136136

@@ -469,7 +469,7 @@ function ACTIONBUTTON:UpdateAll()
469469
--pass to parent UpdateAll function
470470
Neuron.BUTTON.UpdateAll(self)
471471

472-
if not Neuron.isWoWClassic then
472+
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
473473
self:UpdateGlow()
474474
end
475475
end

Objects/ACTIONBUTTON_Flyout.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -742,13 +742,13 @@ function ACTIONBUTTON:GetDataList(options)
742742
scanData = self:filter_spell(tooltip)
743743
elseif types:find("^i") then --Item
744744
scanData = self:filter_item(tooltip)
745-
elseif types:find("^c") and not Neuron.isWoWClassic then --Companion
745+
elseif types:find("^c") and not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then --Companion
746746
scanData = self:filter_pet()
747-
elseif types:find("^f") and not Neuron.isWoWClassic then --toy
747+
elseif types:find("^f") and not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then --toy
748748
scanData = self:filter_toy()
749749
elseif types:find("^m") then --Mount
750750
scanData = self:filter_mount()
751-
elseif types:find("^p") and not Neuron.isWoWClassic then --Profession
751+
elseif types:find("^p") and not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then --Profession
752752
scanData = self:filter_profession()
753753
elseif types:find("^t") then --Item Type
754754
scanData = self:filter_type()

Objects/BAGBTN.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
local BAGBTN = setmetatable({}, {__index = Neuron.BUTTON})
88
Neuron.BAGBTN = BAGBTN
99

10-
if Neuron.isWoWClassic then
10+
if Neuron.isWoWClassic or Neuron.isWoWClassic_TBC then
1111
Neuron.NUM_BAG_BUTTONS = 6
1212
else
1313
Neuron.NUM_BAG_BUTTONS = 5
1414
end
1515

1616
local blizzBagButtons
1717

18-
if Neuron.isWoWClassic then
18+
if Neuron.isWoWClassic or Neuron.isWoWClassic_TBC then
1919
blizzBagButtons = {
2020
KeyRingButton, --wow classic has a keyring button
2121
CharacterBag3Slot,
@@ -58,7 +58,7 @@ function BAGBTN:SetType()
5858
self.hookedButton:ClearAllPoints()
5959
self.hookedButton:SetParent(self)
6060
self.hookedButton:Show()
61-
if Neuron.isWoWClassic and self.id==1 then --the keyring button should be aligned to the right because it's only 1/3 the width of the other bag buttons
61+
if (Neuron.isWoWClassic or Neuron.isWoWClassic_TBC) and self.id==1 then --the keyring button should be aligned to the right because it's only 1/3 the width of the other bag buttons
6262
self.hookedButton:SetPoint("RIGHT", self, "RIGHT")
6363
else
6464
self.hookedButton:SetPoint("CENTER", self, "CENTER")

Objects/BUTTON.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ function BUTTON:UpdateUsableItem()
753753
--for some reason toys don't show as usable items, so this is a workaround for that
754754
if not isUsable then
755755
local itemID = GetItemInfoInstant(self.item)
756-
if not Neuron.isWoWClassic and itemID and PlayerHasToy(itemID) then
756+
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC and itemID and PlayerHasToy(itemID) then
757757
isUsable = true
758758
end
759759
end

0 commit comments

Comments
 (0)