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

Commit ef37c05

Browse files
committed
WoW Classic, add support for the keyring
1 parent 22c0c19 commit ef37c05

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

Neuron-Startup.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function Neuron:RegisterBars()
4646
Neuron:RegisterBarClass("ActionBar", "ActionBar", L["Action Bar"], "Action Button", DB.ActionBar, Neuron.ACTIONBUTTON, 250, true)
4747

4848
--Neuron Bag Bar
49-
Neuron:RegisterBarClass("BagBar", "BagBar", L["Bag Bar"], "Bag Button", DB.BagBar, Neuron.BAGBTN,5, false)
49+
Neuron:RegisterBarClass("BagBar", "BagBar", L["Bag Bar"], "Bag Button", DB.BagBar, Neuron.BAGBTN, Neuron.NUM_BAG_BUTTONS, false) --Neuron.NUM_BAG_BUTTONS == 5 for retail and 6 for classic due to the keyring
5050

5151
--Neuron Status Bar
5252
Neuron:RegisterBarClass("StatusBar", "StatusBar", L["Status Bar"], "Status Bar", DB.StatusBar, Neuron.STATUSBTN, 20, false)

Objects/BAGBTN.lua

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,30 @@
2323
local BAGBTN = setmetatable({}, {__index = Neuron.BUTTON})
2424
Neuron.BAGBTN = BAGBTN
2525

26+
if Neuron.isWoWClassic then
27+
Neuron.NUM_BAG_BUTTONS = 6
28+
else
29+
Neuron.NUM_BAG_BUTTONS = 5
30+
end
31+
32+
local bagElements
33+
34+
if Neuron.isWoWClassic then
35+
bagElements = {
36+
KeyRingButton, --wow classic has a keyring button
37+
CharacterBag3Slot,
38+
CharacterBag2Slot,
39+
CharacterBag1Slot,
40+
CharacterBag0Slot,
41+
MainMenuBarBackpackButton}
42+
else
43+
bagElements = {
44+
CharacterBag3Slot,
45+
CharacterBag2Slot,
46+
CharacterBag1Slot,
47+
CharacterBag0Slot,
48+
MainMenuBarBackpackButton}
49+
end
2650

2751
---------------------------------------------------------
2852

@@ -46,22 +70,18 @@ end
4670

4771
--------------------------------------------------------
4872

49-
local bagElements = {
50-
CharacterBag3Slot,
51-
CharacterBag2Slot,
52-
CharacterBag1Slot,
53-
CharacterBag0Slot,
54-
MainMenuBarBackpackButton}
55-
56-
5773
function BAGBTN:SetType()
5874

5975
if (bagElements[self.id]) then
6076
self.element = bagElements[self.id]
6177
self.element:ClearAllPoints()
6278
self.element:SetParent(self)
6379
self.element:Show()
64-
self.element:SetPoint("CENTER", self, "CENTER")
80+
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
81+
self.element:SetPoint("RIGHT", self, "RIGHT")
82+
else
83+
self.element:SetPoint("CENTER", self, "CENTER")
84+
end
6585
end
6686

6787
self:SetSkinned()

0 commit comments

Comments
 (0)