Repository navigation
Fix(Bags): set categories missing after login until a set is saved - #3581
Merged
Merged
Conversation
## What does this PR do? Fixes per-set categories disappearing after a relog when Split Set Gear by Set is on ([bug EllesmereGaming#448](https://ellesmereui.com/bugs/448/bank-forgets-equipment-sets-after-logout)). The bank fell back to Item Set Gear split by equipment slot, and the bags to one combined Item Set Gear section, until a set was saved again. Cause: the per-set categories are created once, when the category list is first built, and the list is then cached. At login that first build can run before the client has delivered the equipment sets, so the list caches without them. The only rebuild trigger is `EQUIPMENT_SETS_CHANGED`, which does not fire again until a set is saved. Item-to-set matching is rebuilt on every sort, so set items were still recognised and fell back to the shared Item Set Gear category. Fix: - In `ClassifyItem`, during a split-mode `ClassifyAll` pass, a set item whose set has no category of its own means the list was built too early. It queues one rebuild through `EUI_Bags.InvalidateSetCategories()` (keeps the selected category) and repaints. - The rebuild runs on the next frame from a one-shot frame, since callers hold the category list during the pass. - It retries once per set list; `OnEquipmentSetsChanged` re-arms it. Known limit: if the client ever reports a set with no name after login, its category still waits for the next set change. Cost: nothing while Split Set Gear by Set is off. When on, one table lookup on the existing Item Set Gear fallback path; the one-shot frame is created only the first time a rebuild is needed. ## How was it tested? Client: Retail and Forever - Saved an equipment set, put its items in the bank, OneBank view: items grouped under the set's category. - Relogged: the set category is still there in the bank and in the bags sidebar without saving the set again. - Toggled Split Set Gear by Set off and on: the set categories are removed and re-added. Guardrails and the locale-key check pass. ## Checklist - [x] New settings default **OFF** (no behavior change without opt-in) - N/A: no new settings - [x] Zero cost while disabled: no events registered, no polling, no hooks doing work, no tickers; nothing built beyond an inert event frame or combat queue - the check only runs in split mode - [x] Cheap while enabled: event-driven (no polling, no timer-based logic, no per-frame allocations) - one-shot next-frame rebuild, hides itself after one run - [x] No writes onto Blizzard-owned frames (weak-table pattern used); `HookScript`/`hooksecurefunc` only, never `SetScript` on Blizzard frames - N/A: no Blizzard frames touched - [x] Tested in-game on live; no version gates or pre-Midnight APIs added
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes per-set categories disappearing after a relog when Split Set Gear by Set is on (bug #448). The bank fell back to Item Set Gear split by equipment slot, and the bags to one combined Item Set Gear section, until a set was saved again.
Cause: the per-set categories are created once, when the category list is first built, and the list is then cached. At login that first build can run before the client has delivered the equipment sets, so the list caches without them. The only rebuild trigger is
EQUIPMENT_SETS_CHANGED, which does not fire again until a set is saved. Item-to-set matching is rebuilt on every sort, so set items were still recognised and fell back to the shared Item Set Gear category.Fix:
ClassifyItem, during a split-modeClassifyAllpass, a set item whose set has no category of its own means the list was built too early. It queues one rebuild throughEUI_Bags.InvalidateSetCategories()(keeps the selected category) and repaints.OnEquipmentSetsChangedre-arms it.Known limit: if the client ever reports a set with no name after login, its category still waits for the next set change.
Cost: nothing while Split Set Gear by Set is off. When on, one table lookup on the existing Item Set Gear fallback path; the one-shot frame is created only the first time a rebuild is needed.
How was it tested?
Client: Retail and Forever
Guardrails and the locale-key check pass.
Checklist
HookScript/hooksecurefunconly, neverSetScripton Blizzard frames - N/A: no Blizzard frames touched