Can't Split Stacks in Guild Bank (TBC)
mgalliou opened this issue ยท 6 comments
Running Software (issues missing this information will be deleted):
- Addon version: 9.1.4
- Server patch: 2.5.2
Have you read the changelog? (please don't waste our time)
I did.
Describe the bug
When shift clicking (left of right) a stack of items in the guild bank the stack split frame does not show up.
To Reproduce
Steps to reproduce the behaviour:
- Open guild bank
- Shift + Left/Right Click on a item stack
- See error
Expected behaviour
Th stack split frame should show up when shift clicking a stack of item in the guild bank
Error Logs
Type /console scriptErrors 1
in the chat and reload the game. If an error window appears, write here the message with ID: 1
(labelled 1/X). This is generally NOT the message that the window shows by default.
Message: Interface\AddOns\Bagnon\addons\guild\item.lua:35: attempt to call method 'OpenStackSplitFrame' (a nil value)
Time: Sun Dec 5 19:30:17 2021
Count: 1
Stack: Interface\AddOns\Bagnon\addons\guild\item.lua:35: attempt to call method 'OpenStackSplitFrame' (a nil value)
[string "=[C]"]: in function `OpenStackSplitFrame'
[string "@Interface\AddOns\Bagnon\addons\guild\item.lua"]:35: in function <Interface\AddO
You can attempt the following.
It's rudimentary and rigid until >= 3.0.0 comes around but it will stick for the remainder of TBC.
In:
'~\Bagnon\addons\guild\item.lua'
Replace:
StackSplitFrame:OpenStackSplitFrame(self.info.count, self, 'BOTTOMLEFT', 'TOPLEFT')
With:
local v, b, d, t = GetBuildInfo()
if v >= '2.0.0' and v < '3.0.0' then
OpenStackSplitFrame(self.info.count, self, 'BOTTOMLEFT', 'TOPLEFT')
else
StackSplitFrame:OpenStackSplitFrame(self.info.count, self, 'BOTTOMLEFT', 'TOPLEFT')
end
I imagine there's a way to to code this depending on game TOC / reported version to use one or the other for what it sees or is reported. Unfortunately I'm not very in tune with Lua development myself, but just an idea I had. I'm sure people smarter than myself could come up with a better way though, a part from just separate builds for each game version.
The pull request I created was closed because the code is agnostic for Classic / BC / Retail, and apparently crashes Retail
So for the time being, BC players can modify the files themselves to resolve this with the code posted, but will need to do it for every subsequent release.
Method is incorrect in current version of TBC Classic.
Edit 'Bagnon\addons\guild\item.lua':
Change:
StackSplitFrame:OpenStackSplitFrame(self.info.count, self, 'BOTTOMLEFT', 'TOPLEFT')
To:
OpenStackSplitFrame(self.info.count, self, 'BOTTOMLEFT', 'TOPLEFT')
@colonelsevendot excellent, thank you! I can verify that this worked perfectly for me after the change.
Maybe it makes sense for a pull request for this? I am not sure if there are any implications of doing this for Retail, but it certainly works for TBC. It would be nice to see this fix in the next release if possible, if there's anything I learned about patch 2.5.4 and TBC - it's that a lot of people that play BC Classic are running Bagnon, so this would be an excellent fix!
Addendum:
For TBC Classic we use:
https://github.com/Gethe/wow-ui-source/blob/classic/Interface/FrameXML/StackSplitFrame.lua
For Retail we use:
https://github.com/Gethe/wow-ui-source/blob/live/Interface/FrameXML/StackSplitFrame.lua