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

Commit

Permalink
Port to WotLK classic
Browse files Browse the repository at this point in the history
  • Loading branch information
brittyazel committed Sep 3, 2022
1 parent 0a11bf7 commit 3035ca2
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 33 deletions.
4 changes: 2 additions & 2 deletions Neuron-Defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Neuron.DefaultBarOptions.PetBar = {
-----------------------------------
----------- Menu Bar --------------
-----------------------------------
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then
Neuron.DefaultBarOptions.MenuBar = {
[1] = {
snapTo = false,
Expand Down Expand Up @@ -310,7 +310,7 @@ end
-----------------------------------
------------ Bag Bar --------------
-----------------------------------
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then
Neuron.DefaultBarOptions.BagBar = {
[1] = {
padH = 1,
Expand Down
4 changes: 2 additions & 2 deletions Neuron-GUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function NeuronGUI:OnInitialize()
NeuronGUI.interfaceOptions.args.profile = LibStub("AceDBOptions-3.0"):GetOptionsTable(Neuron.db)

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

NeuronGUI:RegisterEvent("ADDON_LOADED")

if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then
NeuronGUI:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED")
end

Expand Down
4 changes: 2 additions & 2 deletions Neuron-Startup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function Neuron:RegisterBars()
--Neuron Pet Bar
Neuron:RegisterBarClass("PetBar", "PetBar", L["Pet Bar"], "Pet Button", DB.PetBar, Neuron.PETBTN, 10, true)

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

Expand Down Expand Up @@ -116,7 +116,7 @@ function Neuron:RegisterGUI()
CDALPHA = true },
false, 65)

if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then
--Neuron Zone Ability Bar
Neuron:RegisterGUIOptions("ZoneAbilityBar", {
AUTOHIDE = true,
Expand Down
10 changes: 5 additions & 5 deletions Neuron.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ Neuron.SNAPTO_TOLLERANCE = 28
Neuron.enteredWorld = false --flag that gets set when the player enters the world. It's used primarily for throttling events so that the player doesn't crash on logging with too many processes

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
Neuron.isWoWClassicEra = true
elseif WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC then
Neuron.isWoWClassic = true
elseif WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
Neuron.isWoWClassic_TBC = true
end

Neuron.activeSpec = 1
Expand Down Expand Up @@ -203,7 +203,7 @@ function Neuron:OnEnable()
end

--set current spec before loading bars and buttons
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then
Neuron.activeSpec = GetSpecialization()
end

Expand Down Expand Up @@ -353,7 +353,7 @@ function Neuron:LoginMessage()
end

--Shadowlands warning that will show as long as a player has one button on their ZoneAbilityBar for Shadowlands content
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
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic and UnitLevel("player") >= 50 and Neuron.db.profile.ZoneAbilityBar[1] and #Neuron.db.profile.ZoneAbilityBar[1].buttons == 1 then
print(" ")
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"))
print(" ")
Expand Down Expand Up @@ -439,7 +439,7 @@ function Neuron:UpdateSpellCache()
end
end

if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then
for i = 1, select("#", GetProfessions()) do
local index = select(i, GetProfessions())

Expand Down
1 change: 1 addition & 0 deletions Neuron.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Interface: 90207
## Interface-Classic: 11403
## Interface-BCC: 20504
## Interface-Wrath: 30400
## Title: Neuron
## Notes: A macro-based action bar and object manager add-on
## Author: Britt W. Yazel
Expand Down
4 changes: 2 additions & 2 deletions Objects/ACTIONBUTTON.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function ACTIONBUTTON:SetupEvents()
self:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateAll")
self:RegisterEvent("UNIT_PET", "UpdateAll")

if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then
self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
self:RegisterEvent("EQUIPMENT_SETS_CHANGED")

Expand Down Expand Up @@ -469,7 +469,7 @@ function ACTIONBUTTON:UpdateAll()
--pass to parent UpdateAll function
Neuron.BUTTON.UpdateAll(self)

if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then
self:UpdateGlow()
end
end
Expand Down
6 changes: 3 additions & 3 deletions Objects/ACTIONBUTTON_Flyout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -742,13 +742,13 @@ function ACTIONBUTTON:GetDataList(options)
scanData = self:filter_spell(tooltip)
elseif types:find("^i") then --Item
scanData = self:filter_item(tooltip)
elseif types:find("^c") and not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then --Companion
elseif types:find("^c") and not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then --Companion
scanData = self:filter_pet()
elseif types:find("^f") and not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then --toy
elseif types:find("^f") and not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then --toy
scanData = self:filter_toy()
elseif types:find("^m") then --Mount
scanData = self:filter_mount()
elseif types:find("^p") and not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then --Profession
elseif types:find("^p") and not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then --Profession
scanData = self:filter_profession()
elseif types:find("^t") then --Item Type
scanData = self:filter_type()
Expand Down
6 changes: 3 additions & 3 deletions Objects/BAGBTN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
local BAGBTN = setmetatable({}, {__index = Neuron.BUTTON})
Neuron.BAGBTN = BAGBTN

if Neuron.isWoWClassic or Neuron.isWoWClassic_TBC then
if Neuron.isWoWClassicEra or Neuron.isWoWClassic then
Neuron.NUM_BAG_BUTTONS = 6
else
Neuron.NUM_BAG_BUTTONS = 5
end

local blizzBagButtons

if Neuron.isWoWClassic or Neuron.isWoWClassic_TBC then
if Neuron.isWoWClassicEra or Neuron.isWoWClassic then
blizzBagButtons = {
KeyRingButton, --wow classic has a keyring button
CharacterBag3Slot,
Expand Down Expand Up @@ -58,7 +58,7 @@ function BAGBTN:SetType()
self.hookedButton:ClearAllPoints()
self.hookedButton:SetParent(self)
self.hookedButton:Show()
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
if (Neuron.isWoWClassicEra or 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
self.hookedButton:SetPoint("RIGHT", self, "RIGHT")
else
self.hookedButton:SetPoint("CENTER", self, "CENTER")
Expand Down
2 changes: 1 addition & 1 deletion Objects/BUTTON.lua
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ function BUTTON:UpdateUsableItem()
--for some reason toys don't show as usable items, so this is a workaround for that
if not isUsable then
local itemID = GetItemInfoInstant(self.item)
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC and itemID and PlayerHasToy(itemID) then
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic and itemID and PlayerHasToy(itemID) then
isUsable = true
end
end
Expand Down
6 changes: 3 additions & 3 deletions Objects/MENUBTN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ local blizzMenuButtons = {
StoreMicroButton,
MainMenuMicroButton}

if Neuron.isWoWClassic or Neuron.isWoWClassic_TBC then
if Neuron.isWoWClassicEra or Neuron.isWoWClassic then
wipe(blizzMenuButtons)
for i=1, #MICRO_BUTTONS do
blizzMenuButtons[i] = _G[MICRO_BUTTONS[i]]
Expand All @@ -47,8 +47,8 @@ end
---------------------------------------------------------

function MENUBTN:SetType()
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
if not self:IsEventRegistered("PET_BATTLE_CLOSE") and not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then --only run this code on the first SetType, not the reloads after pet battles and such
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then
if not self:IsEventRegistered("PET_BATTLE_CLOSE") and not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then --only run this code on the first SetType, not the reloads after pet battles and such
self:RegisterEvent("PET_BATTLE_CLOSE")
end

Expand Down
2 changes: 1 addition & 1 deletion Objects/PETBTN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function PETBTN:SetType()
self:RegisterEvent("PLAYER_CONTROL_GAINED", "UpdateData")
self:RegisterEvent("PLAYER_FARSIGHT_FOCUS_CHANGED", "UpdateData")

if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then
self:RegisterEvent("PET_SPECIALIZATION_CHANGED", "PLAYER_ENTERING_WORLD")
end

Expand Down
21 changes: 12 additions & 9 deletions Objects/STATUSBTN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ function STATUSBTN:xpDropDown_Initialize() -- initialize the dropdown menu for c
})

--wow classic doesn't have Honor points nor Azerite, carefull
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then

if C_Covenants.GetActiveCovenantID() ~= 0 then
table.insert(menu, {
Expand Down Expand Up @@ -444,7 +444,7 @@ function STATUSBTN:repstrings_Update(repGainedString)
if (not isHeader or hasRep) and not IsFactionInactive(i) then

local friendID, standing, isParagon
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then --classic doesn't have Friendships or Paragon, carefull
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then --classic doesn't have Friendships or Paragon, carefull
friendID, _, _, _, _, _, standing, _, _ = GetFriendshipReputation(factionID)
isParagon = C_Reputation.IsFactionParagon(factionID)
end
Expand Down Expand Up @@ -529,7 +529,10 @@ function STATUSBTN:repDropDown_Initialize() --Initialize the dropdown menu for c

for k,v in pairs(RepWatch) do --insert all factions and percentages into "data"
if k > 0 then --skip the "0" entry which is our autowatch
if not repDataTable[v.header]then
if not v.header then --classic doesn't have headers, so this will give us a default header
v.header = "Core"
end
if not repDataTable[v.header] then
repDataTable[v.header] = {}
end
table.insert(repDataTable[v.header], { ID=v.ID, name=v.name, standing=v.standing, percent=v.percent, hex=v.hex})
Expand Down Expand Up @@ -814,7 +817,7 @@ function STATUSBTN:CastBar_OnEvent(event, ...)

local name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible

if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then
name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo(unit)
elseif unit == "player" then
name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = CastingInfo() --classic doesn't have UnitCastingInfo()
Expand Down Expand Up @@ -878,7 +881,7 @@ function STATUSBTN:CastBar_OnEvent(event, ...)

local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible

if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then
name, text, texture, startTime, endTime, isTradeSkill, notInterruptible = UnitChannelInfo(unit)
elseif unit == "player" then
name, text, texture, startTime, endTime, isTradeSkill, notInterruptible = ChannelInfo()
Expand Down Expand Up @@ -973,7 +976,7 @@ function STATUSBTN:CastBar_OnEvent(event, ...)

local name, text, texture, startTime, endTime, isTradeSkill

if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then
name, text, texture, startTime, endTime, isTradeSkill = UnitCastingInfo(unit)
elseif unit == "player" then
name, text, texture, startTime, endTime, isTradeSkill = CastingInfo() --Classic doesn't have UnitCastingInfo()
Expand Down Expand Up @@ -1009,7 +1012,7 @@ function STATUSBTN:CastBar_OnEvent(event, ...)

local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible

if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then
name, text, texture, startTime, endTime, isTradeSkill, notInterruptible = UnitChannelInfo(unit)
elseif unit == "player" then
name, text, texture, startTime, endTime, isTradeSkill, notInterruptible = ChannelInfo()
Expand Down Expand Up @@ -1859,7 +1862,7 @@ function STATUSBTN:SetType()
self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_UPDATE", "CastBar_OnEvent")
self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP", "CastBar_OnEvent")

if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then
self:RegisterEvent("UNIT_SPELLCAST_INTERRUPTIBLE", "CastBar_OnEvent")
self:RegisterEvent("UNIT_SPELLCAST_NOT_INTERRUPTIBLE", "CastBar_OnEvent")
end
Expand Down Expand Up @@ -1897,7 +1900,7 @@ function STATUSBTN:SetType()
self:RegisterEvent("PLAYER_ENTERING_WORLD", "XPBar_OnEvent")
self:RegisterEvent("PLAYER_EQUIPMENT_CHANGED", "XPBar_OnEvent")

if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
if not Neuron.isWoWClassicEra and not Neuron.isWoWClassic then
self:RegisterEvent("HONOR_XP_UPDATE", "XPBar_OnEvent")
self:RegisterEvent("COVENANT_SANCTUM_RENOWN_LEVEL_CHANGED", "XPBar_OnEvent")
self:RegisterEvent("AZERITE_ITEM_EXPERIENCE_CHANGED", "XPBar_OnEvent")
Expand Down

0 comments on commit 3035ca2

Please sign in to comment.