|
Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
|
Read-only "where are my Pokemon" overview for the Pokemon screen's View All pane – the Pokemon analogue of ItemOverviewModel. More...
#include <pokemonoverviewmodel.h>
Public Types | |
| enum | OverviewRoles { NameRole = Qt::UserRole + 1 , CountsRole , TooltipsRole } |
| Column header labels, in display order (e.g. More... | |
| enum | SortSelect { SortBegin , SortDex , SortName , SortInternal , SortEnd } |
| Species-column sort orders – the SAME set the Pokedex screen cycles (PokedexModel::PokemonSortSelect): dex number, alphabetical, internal id. More... | |
Public Member Functions | |
| PokemonOverviewModel (PokemonStorageBox *party, Storage *storage, PlayerBasics *basics) | |
| virtual int | rowCount (const QModelIndex &parent) const override |
| Row count. | |
| virtual QVariant | data (const QModelIndex &index, int role) const override |
| Row+role value. | |
| virtual QHash< int, QByteArray > | roleNames () const override |
| Role -> QML name. | |
| QStringList | columns () const |
| QString | sortLabel () const |
| QString | sortIcon () const |
| void | sortCycle () |
| Advance to the next species sort order (re-sorts in place). | |
| void | rebuild () |
| Re-aggregate the party + boxes (full model reset). Wired to pokemonChanged. | |
| protected::void | columnsChanged () |
| void | sortSelectChanged () |
Read-only "where are my Pokemon" overview for the Pokemon screen's View All pane – the Pokemon analogue of ItemOverviewModel.
Aggregates the party and the 12 PC boxes into one alphabetized species table. Each row is a distinct species (keyed by raw species id, displayed by species name – NOT nickname); the columns are the party first, then only the boxes that actually hold Pokemon (empty boxes are omitted entirely, keeping the table clean). Each cell carries the count of that species in that column plus a precomputed hover tooltip listing the differing nicknames in that cell, an "...and xN others" tail for the un-nicknamed remainder, and a caught/traded breakdown (a mon is "traded" when its OT name/ID differs from the player's – PokemonBox::hasTradeStatus). A zero cell carries an empty tooltip so the view can hide just that number. Rebuilds (full reset) whenever the party or any box changes, plus an explicit rebuild-on-open. Exposed as brg.pokemonOverviewModel.
The column headers are exposed separately as the columns string list so the QML header row and the per-row count cells stay aligned.
Definition at line 50 of file pokemonoverviewmodel.h.
Column header labels, in display order (e.g.
"Party", "Box 1", ...). One per entry in each row's counts/tooltips. Changes on every rebuild. Current species-column sort order (see SortSelect). Cycled by sortCycle(). Human-readable label for the current sort (kept for reference/debug). qrc path of the icon for the current sort (so the header button shows which order is active, instead of one static icon + a tooltip). Roles (mapped in roleNames()).
| Enumerator | |
|---|---|
| NameRole | Species display name. |
| CountsRole | Per-column counts (QVariantList<int>, aligned to columns). |
| TooltipsRole | Per-column hover tooltips (QVariantList<QString>; empty when count 0). |
Definition at line 68 of file pokemonoverviewmodel.h.
Species-column sort orders – the SAME set the Pokedex screen cycles (PokedexModel::PokemonSortSelect): dex number, alphabetical, internal id.
| Enumerator | |
|---|---|
| SortBegin | |
| SortDex | Pokedex number order. |
| SortName | Alphabetical by species name. |
| SortInternal | Internal / creation (raw species id) order. |
| SortEnd | |
Definition at line 76 of file pokemonoverviewmodel.h.
| PokemonOverviewModel::PokemonOverviewModel | ( | PokemonStorageBox * | party, |
| Storage * | storage, | ||
| PlayerBasics * | basics ) |
| party | the player's party; |
| storage | the PC (12 boxes); |
| basics | the player's basics (for trade-status comparison). |
Definition at line 50 of file pokemonoverviewmodel.cpp.
References PokemonStorageBox::pokemonChanged(), and rebuild().
| QStringList PokemonOverviewModel::columns | ( | ) | const |
Definition at line 79 of file pokemonoverviewmodel.cpp.
| protected::void PokemonOverviewModel::columnsChanged | ( | ) |
Referenced by rebuild().
|
overridevirtual |
Row+role value.
Definition at line 84 of file pokemonoverviewmodel.cpp.
References CountsRole, NameRole, and TooltipsRole.
| void PokemonOverviewModel::rebuild | ( | ) |
Re-aggregate the party + boxes (full model reset). Wired to pokemonChanged.
Definition at line 194 of file pokemonoverviewmodel.cpp.
References columnsChanged(), PokemonStorageBox::pokemon, and PokemonStorageBox::pokemonCount().
Referenced by PokemonOverviewModel().
|
overridevirtual |
Role -> QML name.
Definition at line 113 of file pokemonoverviewmodel.cpp.
References CountsRole, NameRole, and TooltipsRole.
|
overridevirtual |
Row count.
Definition at line 73 of file pokemonoverviewmodel.cpp.
| void PokemonOverviewModel::sortCycle | ( | ) |
Advance to the next species sort order (re-sorts in place).
Definition at line 280 of file pokemonoverviewmodel.cpp.
References SortBegin, SortEnd, and sortSelectChanged().
| QString PokemonOverviewModel::sortIcon | ( | ) | const |
Definition at line 305 of file pokemonoverviewmodel.cpp.
References SortDex, SortInternal, and SortName.
| QString PokemonOverviewModel::sortLabel | ( | ) | const |
Definition at line 295 of file pokemonoverviewmodel.cpp.
References SortDex, SortInternal, and SortName.
| void PokemonOverviewModel::sortSelectChanged | ( | ) |
Referenced by sortCycle().