Cidan / BetterBags

A total replacement AddOn for World of Warcraft bag frames, inspired by AdiBags.
MIT License
89 stars 38 forks source link

[Bug] Right Click Refresh Bags not working + incorrect stack count #357

Closed XiconQoo closed 5 months ago

XiconQoo commented 6 months ago

Addon Version

v0.1.36

World of Warcraft Version

Classic Era (And SoD/Hardcore)

Describe the bug

Right clicking the Bag Icon does nothing. Also moving stacks around or getting new items of same type does not correctly update the stacks.

I have BugSack and Buggrabber, no lua errors.

Steps to reproduce

Refresh Bug

  1. have recent items in bag
  2. right click bag icon
  3. nothing happens

Stack Bug

  1. have these options: image
  2. Initial state: image
  3. Moving 80 stack to 15 stack results in: image
Cidan commented 6 months ago

Thanks, I'll take a look and get this fixed.

Cidan commented 6 months ago

I am able to replicate this on any WoW version -- will update here with progress.

Cidan commented 6 months ago

Fixed in .37, which is rolling out now. Note, there's still a bug in the oneview view, which I'll fix at a later date. Section view is good to go though.

Thanks for the report!

XiconQoo commented 6 months ago

Just tested .37

Stacking seems to show correct number, but breaks the "Don't Merge Partial". It results in turning it into merging it all.

Before: image

After: image

Refresh right click still does not sort "Recent Items":

image

In previous versions "Recent Items" would be sorted in the respective categories.

Cidan commented 6 months ago

Yes, I just discovered the first one as well.

The second one should work -- do you have the SortBags addon installed?

XiconQoo commented 6 months ago

Yes, I just discovered the first one as well.

The second one should work -- do you have the SortBags addon installed?

I just tested it with all addons disabled but image and the refresh still wont work

Cidan commented 6 months ago

You need to have the addon SortBags installed -- Cata does not have an item sort API like retail does. The addon SortBags provides the sort feature for Cata.

XiconQoo commented 6 months ago

SavedVariables_BetterBags.zip

Here is my WTF for reference.

XiconQoo commented 6 months ago

You need to have the addon SortBags installed -- Cata does not have an item sort API like retail does. The addon SortBags provides the sort feature for Cata.

This is Classic Era SOD Client I am testing from. Previously I did not need SortBags to be installed for this feature to work,

Cidan commented 6 months ago

Thank you! I don't need your variables at the moment, I know where the bug is -- solving it is somewhat tricky.

This is Classic Era SOD Client I am testing from. Previously I did not need SortBags to be installed for this feature to work,

Same thing -- Cata and SOD/Era do not have a sort API. Blizzard did not backport that API from retail. You need to install SortBags -- BetterBags has never sorted bags in Era or Cata (though it did clear new items), and the feature to have a true sort was added a few versions ago via SortBags.

XiconQoo commented 6 months ago

This is kinda misleading.. I do not want to sort my bags. I do not care wether my items are sorted in the default bags. I expect "Recent Items" to be "sorted" into their categories, which is not a real sort... mere a representation BetterBags gives.

Cidan commented 6 months ago

I understand. It is, however, how I decided to go about this to remain consistent across versions. This will not change.

Cidan commented 6 months ago

Reopening this issue until I resolve the other bug of dragging a full stack into a partial stack.

XiconQoo commented 6 months ago

I understand. It is, however, how I decided to go about this to remain consistent across versions. This will not change.

From a developer perspective I can understand you want to streamline it throughout many wow-versions. From a user experience this is nonintuitive. As a user I am very used to the refresh button updating category representation (BetterBags & AdiBags) without the need of another addon.

I don't understand how SortBags has any impact on category representation. I can create a lot of custom categories resulting in completely ignoring the sort order of items in the real bags.

Cidan commented 6 months ago

I don't understand how SortBags has any impact on category representation. I can create a lot of custom categories resulting in completely ignoring the sort order of items in the real bags.

It doesn't. It does, however, merge stacks, put items in reagent bags and/or quivers, etc, which does have a real, material affect on gameplay mechanics. There have been a non-trivial amount of people who have asked for this feature as a result. Instead of supporting two modes, only one single flow will be supported from now on.

This isn't something that will change. Thanks.

XiconQoo commented 6 months ago

All I'm saying, it needs to be more conclusive for the classic versions. Either adding it as a library within BetterBags or adding a dependency in the classic client. Or telling the user to download SortBags when they right click the BagIcon as a popup or adding a clarification in the tooltip: image

Cidan commented 6 months ago

Indeed -- I already pushed a change to remove the help text unless SortBags is installed.

XiconQoo commented 6 months ago

Thanks for the addon btw: I was a big fan of AdiBags and love customizing categories. Can't wait for BetterBags first v1 release =)

Cidan commented 6 months ago

You're very welcome :)

XiconQoo commented 6 months ago

So I just installed SortBags, but the "Recent Items" are not being put in their categories either and just stay flagged as "Recent Items" after right clicking the BagIcon.

XiconQoo commented 6 months ago

image Also some random free spaces pop up.

XiconQoo commented 6 months ago

stacktrace:

1x BetterBags/views/views.lua:400: attempt to perform arithmetic on field 'stackedCount' (a nil value)
[string "@BetterBags/views/views.lua"]:400: in function `UpdateCount'
[string "@BetterBags/views/views.lua"]:390: in function `RemoveItem'
[string "@BetterBags/views/views.lua"]:255: in function `RemoveButton'
[string "@BetterBags/views/gridview.lua"]:143: in function `Render'
[string "@BetterBags/frames/bag.lua"]:218: in function `Draw'
[string "@BetterBags/core/init.lua"]:224: in function `cb'
[string "@BetterBags/core/events.lua"]:49: in function <BetterBags/core/events.lua:44>
[string "=[C]"]: ?
[string "@AtlasLootClassic/Libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:19: in function <...sic/Libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:15>
[string "@AtlasLootClassic/Libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:54: in function `SendMessage'
[string "@BetterBags/core/events.lua"]:156: in function <BetterBags/core/events.lua:155>

Locals:
self = <table> {
 hash = "14047|h[Runecloth]|h|r50"
 subItems = <table> {
 }
 item = "1_7"
 dirty = false
}
itemData = <table> {
 isItemEmpty = true
 slotkey = "1_7"
 bagid = 1
 basic = false
 kind = 0
 itemInfo = <table> {
 }
 slotid = 7
}
(for generator) = <function> defined =[C]:-1
(for state) = <table> {
 1_1 = true
 1_5 = true
}
(for control) = "1_1"
subItemSlotKey = "1_1"
subItemData = <table> {
 slotkey = "1_1"
 bagid = 1
 basic = false
 isItemEmpty = true
 kind = 0
 itemInfo = <table> {
 }
 slotid = 1
}
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to perform arithmetic on field 'stackedCount' (a nil value)"
items = <table> {
 SetDefaultModuleLibraries = <function> defined @AutoLayer_Vanilla/Lib/Ace3/AceAddon-3.0/AceAddon-3.0.lua:363
 GenerateItemHash = <function> defined @BetterBags/data/items.lua:657
 RefreshBackpack = <function> defined @BetterBags/data/items.lua:296
 RemoveNewItemFromAllItems = <function> defined @BetterBags/data/items.lua:190
 EnableModule = <function> defined @AutoLayer_Vanilla/Lib/Ace3/AceAddon-3.0/AceAddon-3.0.lua:328
 modules = <table> {
 }
 baseName = "BetterBags"
 IterateEmbeds = <function> defined @AutoLayer_Vanilla/Lib/Ace3/AceAddon-3.0/AceAddon-3.0.lua:438
 ItemChanged = <function> defined @BetterBags/data/items.lua:331
 ResetSlotInfo = <function> defined @BetterBags/data/items.lua:185
 DoRefreshAll = <function> defined @BetterBags/data/items.lua:249
 ItemAdded = <function> defined @BetterBags/data/items.lua:313
 ClearNewItem = <function> defined @BetterBags/data/items.lua:557
 SetDefaultModulePrototype = <function> defined @AutoLayer_Vanilla/Lib/Ace3/AceAddon-3.0/AceAddon-3.0.lua:405
 GetSlotKey = <function> defined @BetterBags/data/items.lua:369
 defaultModuleState = true
 GetBagKindFromSlotKey = <function> defined @BetterBags/data/items.lua:889
 IsEnabled = <function> defined @AutoLayer_Vanilla/Lib/Ace3/AceAddon-3.0/AceAddon-3.0.lua:447
 RefreshReagentBank = <function> defined @BetterBags/data/items.lua:262
 GetItemDataFromSlotKey = <function> defined @BetterBags/data/items.lua:899
 ItemHashChanged = <function> defined @BetterBags/data/items.lua:362
 SetEnabledState = <function> defined @AutoLayer_Vanilla/Lib/Ace3/AceAddon-3.0/AceAddon-3.0.lua:420
 enabledState = true
 IsNewItem = <function> defined @BetterBags/data/items.lua:546
 ItemGUIDChanged = <function> defined @BetterBags/data/items.lua:353
 ClearBankCache = <function> defined @BetterBags/data/items.lua:226
 ClearNewItems = <function> defined @BetterBags/data/items.lua:565
 IterateModules = <function> defined @AutoLayer_Vanilla/Lib/Ace3/AceAddon-3.0/AceAddon-3.0.lua:433
 NewSlotInfo = <function> defined @BetterBags/data/slots.lua:32
 UpdateFreeSlots = <function> defined @BetterBags/data/items.lua:382
 RefreshBank = <function> defined @BetterBags/data/items.lua:274
 Enable = <function> defined @AutoLayer_Vanilla/Lib/Ace3/AceAddon-3.0/AceAddon-3.0.lua:290
 NewModule = <function> defined @AutoLayer_Vanilla/Lib/Ace3/AceAddon-3.0/AceAddon-3.0.lua:231
 previousItemGUID = <table> {
 }
 GetModule = <function> defined @AutoLayer_Vanilla/Lib/Ace3/AceAddon-3.0/AceAddon-3.0.lua:206
 defaultModuleLibraries = <table> {
 }
 WipeAndRefreshAll = <function> defined @BetterBags/data/items.lua:236
 AttachBasicItemInfo = <function> defined @BetterBags/data/items.lua:840
 loadCount = 20
 AttachItemInfo = <function> defined @BetterBags/data/items.lua:763
 NewLoader = <function> defined @BetterBags/data/loader.lua:33
 ClearItemCache = <function> defined @Interfac
Cidan commented 6 months ago

Oh cool, nice find -- will debug.

XiconQoo commented 6 months ago

I got another error with a function UnlockItem, sadly lost the stacktrace. Will try to reproduce.

Myrroddin commented 5 months ago

Here is some more information. You need to install the SortBags addon in Classic and use the right-click, Sort Bags feature in BetterBags. You get the error below, and the virtual bags stop sorting until you reload your UI. I am using BetterBags 0.1.42 and SortBags 1.3.3.

1x BetterBags/views/views.lua:402: attempt to perform arithmetic on field 'stackedCount' (a nil value)
[string "@BetterBags/views/views.lua"]:402: in function `UpdateCount'
[string "@BetterBags/views/views.lua"]:391: in function `RemoveItem'
[string "@BetterBags/views/views.lua"]:255: in function `RemoveButton'
[string "@BetterBags/views/gridview.lua"]:143: in function `Render'
[string "@BetterBags/frames/bag.lua"]:218: in function `Draw'
[string "@BetterBags/core/init.lua"]:219: in function `cb'
[string "@BetterBags/core/events.lua"]:49: in function <BetterBags/core/events.lua:44>
[string "=[C]"]: ?
[string "@AllTheThings/lib/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:19: in function <...ings/lib/CallbackHandler-1.0/CallbackHandler-1.0.lua:15>
[string "@AllTheThings/lib/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:54: in function `SendMessage'
[string "@BetterBags/core/events.lua"]:156: in function <BetterBags/core/events.lua:155>

Locals:
self = <table> {
 hash = "7941|h[Heavy Mithril Axe]|h|r42"
 subItems = <table> {
 }
 item = "0_16"
 dirty = false
}
itemData = <table> {
 isItemEmpty = true
 slotkey = "0_16"
 bagid = 0
 basic = false
 kind = 0
 itemInfo = <table> {
 }
 slotid = 16
}
(for generator) = <function> defined =[C]:-1
(for state) = <table> {
 0_13 = true
}
(for control) = "0_13"
subItemSlotKey = "0_13"
subItemData = <table> {
 containerInfo = <table> {
 }
 bagid = 0
 forceClear = false
 slotkey = "0_13"
 itemLinkInfo = <table> {
 }
 stacks = 0
 itemHash = "7941|h[Heavy Mithril Axe]|h|r42"
 questInfo = <table> {
 }
 slotid = 13
 basic = false
 stackedCount = 1
 kind = 0
 itemInfo = <table> {
 }
 isItemEmpty = false
}
(*temporary) = nil
(*temporary) = 1
(*temporary) = "attempt to perform arithmetic on field 'stackedCount' (a nil value)"
items = <table> {
 SetDefaultModuleLibraries = <function> defined @Masque/Libs/AceAddon-3.0/AceAddon-3.0.lua:363
 GenerateItemHash = <function> defined @BetterBags/data/items.lua:672
 RefreshBackpack = <function> defined @BetterBags/data/items.lua:296
 RemoveNewItemFromAllItems = <function> defined @BetterBags/data/items.lua:190
 EnableModule = <function> defined @Masque/Libs/AceAddon-3.0/AceAddon-3.0.lua:328
 modules = <table> {
 }
 baseName = "BetterBags"
 IterateEmbeds = <function> defined @Masque/Libs/AceAddon-3.0/AceAddon-3.0.lua:438
 ItemChanged = <function> defined @BetterBags/data/items.lua:331
 ResetSlotInfo = <function> defined @BetterBags/data/items.lua:185
 DoRefreshAll = <function> defined @BetterBags/data/items.lua:249
 ItemAdded = <function> defined @BetterBags/data/items.lua:313
 ClearNewItem = <function> defined @BetterBags/data/items.lua:572
 SetDefaultModulePrototype = <function> defined @Masque/Libs/AceAddon-3.0/AceAddon-3.0.lua:405
 GetSlotKey = <function> defined @BetterBags/data/items.lua:369
 defaultModuleState = true
 GetBagKindFromSlotKey = <function> defined @BetterBags/data/items.lua:904
 IsEnabled = <function> defined @Masque/Libs/AceAddon-3.0/AceAddon-3.0.lua:447
 RefreshReagentBank = <function> defined @BetterBags/data/items.lua:262
 GetItemDataFromSlotKey = <function> defined @BetterBags/data/items.lua:914
 ItemHashChanged = <function> defined @BetterBags/data/items.lua:362
 SetEnabledState = <function> defined @Masque/Libs/AceAddon-3.0/AceAddon-3.0.lua:420
 enabledState = true
 IsNewItem = <function> defined @BetterBags/data/items.lua:561
 ItemGUIDChanged = <function> defined @BetterBags/data/items.lua:353
 ClearBankCache = <function> defined @BetterBags/data/items.lua:226
 ClearNewItems = <function> defined @BetterBags/data/items.lua:580
 IterateModules = <function> defined @Masque/Libs/AceAddon-3.0/AceAddon-3.0.lua:433
 NewSlotInfo = <function> defined @BetterBags/data/slots.lua:32
 UpdateFreeSlots = <function> defined @BetterBags/data/items.lua:382
 RefreshBank = <function> defined @BetterBags/data/items.lua:274
 Enable = <function> defined @Masque/Libs/AceAddon-3.0/AceAddon-3.0.lua:290
 NewModule = <function> defined @Masque/Libs/AceAddon-3.0/AceAddon-3.0.lua:231
 previousItemGUID = <table> {
 }
 GetModule = <function> defined @Masque/Libs/AceAddon-3.0/AceAddon-3.0.lua:206
 defaultModuleLibraries = <table> {
 }
 WipeAndRefreshAll = <function> defined @BetterBags/data/items.lua:236
 AttachBasicItemInfo = <function> defined @BetterBags/data/items.lua:855
 loadCount = 54
 AttachItemInfo = <function> defined @BetterBags/data/items.lua:778
 NewLoader = <function> defined @BetterBags/data/loader.lua:33
 ClearItemCac
Myrroddin commented 5 months ago

I have not seen this error for the last few updates to BetterBags. It may be safe to call it fixed.

MGraefe commented 5 months ago

@Cidan would be great to get "reset recent items" feature working in Cata Classic, that is my biggest gripe with your addon. Otherwise it's awesome!

Cidan commented 5 months ago

@MGraefe Install 'SortBags' from Curse, and the reset recent items/right click bag icon to sort will work as expected. This is because Blizzard has opted to remove the sort API from all Classic versions.

m4gnify commented 4 months ago

@MGraefe Install 'SortBags' from Curse, and the reset recent items/right click bag icon to sort will work as expected. This is because Blizzard has opted to remove the sort API from all Classic versions.

Just wanted to say that I wondered this as well. Is there any link or mention of SortBags within BetterBags? I couldn't find it at least. Thanks for the addon, it's wonderful

MGraefe commented 4 months ago

@MGraefe Install 'SortBags' from Curse, and the reset recent items/right click bag icon to sort will work as expected. This is because Blizzard has opted to remove the sort API from all Classic versions.

Just wanted to say that I wondered this as well. Is there any link or mention of SortBags within BetterBags? I couldn't find it at least. Thanks for the addon, it's wonderful

Problem is that "Sort Bags" is not a real replacement for just "forgetting" the recent items. Sorting the bags takes quite a while, it clink clanks over all items in your bags and shifts them around. Yes, it touches all items and thus they are removed from recent items. But it's not a good replacement for the little reset button which AdiBags had.