|
Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
|
Reworked the two box-header affordances that were "clean UI but not clean UX." (1) Fill circle removed from the box dropdown — PokemonBoxSelectModel::getDecoratedName no longer prepends ●/○/blank; the (N/Max) count conveys fullness better (unused box*Sym members deleted). (2) Current-box marker moved + flipped — was a trailing ◁, now a leading ▷ (where the circle sat, pointing at the label); non-current rows pad to stay aligned. (3) The "set current box" dot → an Active FlatToggle on both panes: On (filled) when this pane's box is the game's active box, Off otherwise; enabled: !active (a save always has exactly one active box), hidden on Party panes. (4) FlatToggle color-parameterized (defaults unchanged) so the header instance can invert colors to read on the accent bar. Files: mvc/pokemonboxselectmodel.cpp/.h, fragments/general/FlatToggle.qml, fragments/screens/pokemon/PokemonPane.qml. Convention: ../../reference/ui-patterns.md → "Pokémon storage screen layout".
Added a new "AI Assistance" credits section (Claude — 2026 revival/debug/test/notes; ChatGPT — dev & design help) and credited ChatGPT under Icons for the in-app status symbol icons. Data is in projects/db/assets/data/credits.json; the new section is wired into CreditDBEntry::process() in display order (…Framework → AI Assistance → Tools Used…). Rebuild required (JSON baked into db.qrc). Going forward the credits screen is kept up to date by default — see CLAUDE.md → "Keep the Credits Screen Living".
Replaced the trainer image on the Trainer Card front (the grayscale Gen-1 Red sprite) with the new colored two-trainer illustration. The PNG was staged at assets/staging/trainer.png; copied into projects/app/assets/icons/trainer.png, registered in app.qrc, and CardFront.qml's Image.source repointed. Layout untouched. New asset in qrc → rebuild (done). red-larger.png left in place (no longer referenced).
Brought the Pokémon-grid drag interaction to the items LIST. New C++ on ItemStorageModel (mirrors PokemonStorageModel): dragReorder/dragTransfer/deleteItem Q_INVOKABLEs + otherModel pairing wired in bridge.cpp. QML (ItemBoxView.qml, ItemsPane.qml): each row is a DropArea whose content reparents to the overlay while dragging (ghost floats across both panes); drag starts only from a new left grip handle (grip-lines.svg) because the row's combo/count controls must keep their clicks (the grip was chosen over press-hold); reorder within a list + cross-pane transfer (bag↔PC); footer bulk-action bar removed; per-row delete chip; group drag/delete via checkboxes. Full ctest green 57/57 incl. new tst_item_storage_model drag tests. Convention: ../../reference/ui-patterns.md → "Drag & drop on the items LIST".
(1) Auto-stack, never lossy: ItemStorageModel::dragTransfer folds a moved item onto an existing same-id dst row (the last duplicate) — but only when the whole amount fits under 99. If it would overflow it becomes its own 2nd row (full amount kept, no clamp); if there's no room for that row the transfer is refused (item stays put). Never clamps/loses items (a correction to the earlier clamp-to-99). (2) Duplicate-pick guard: the SelectItem dropdown greys out item names already present in the same pane (except the row's own current item). (3) Owned total: each dropdown entry shows the total owned across both panes in parens, e.g. POTION (x12). New Q_INVOKABLEs on ItemStorageBox: hasItemInd, amountOfInd. All three leave pre-existing duplicate save data untouched. Tests: dragTransfer_autoStacksOntoExisting/_stacksOntoLastDuplicate/ _overflowAddsSecondRow/_overflowRefusedWhenDstFull/amountOfInd_sumsAcrossRows.
The per-row delete chip now has no background at rest (just an accent X that reads on the white row); hover-fill / press / white-X effects unchanged. Fixed the recurring "button under the scrollbar" problem: the row layout reserves the 16px scrollbar lane (rowEntry spans to right - 16) and the SelectItem combo is fillWidth (capped at normal width) so it shrinks on tight rows. Follow-up: the chip used visible: which collapsed its layout slot → the fillWidth combo grew/shrank and the whole row reflowed on every hover. Fixed by reserving the slot permanently and fading opacity (+enabled) instead of visible. General fix: ../../reference/ui-patterns.md → "Scrollable forms".
New View All button slides in a left panel with a condensed alphabetized table of every item the save holds: Item | Bag | Storage, two right-aligned count columns, 0 hidden. Backed by a new read-only ItemOverviewModel (mvc/itemoverviewmodel.*, brg.itemOverviewModel) that aggregates both item boxes by index (summing duplicate rows), drops both-zero rows, sorts by name (QCollator), and iterates the boxes so glitch items still show. Started as a Material Drawer but it kept leaving a white frame that nothing could kill → replaced with a hand-rolled slide-in Rectangle panel + dimming scrim (full pixel control); panel width min(page.width*0.45, 330); panel + scrim block input pass-through. signed off. Test: itemOverview_aggregatesSortsHidesZeros. Convention: ../../reference/ui-patterns.md → "View All overview drawer".