Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
bridge.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2020 Twilight
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15*/
16
22
23#include "./bridge.h"
32
34 : file(file),
36 pokedexModel(new PokedexModel(file->data->dataExpanded->player->pokedex, router)),
37 bagItemsModel(new ItemStorageModel(file->data->dataExpanded->player->items, router)),
38 pcItemsModel(new ItemStorageModel(file->data->dataExpanded->storage->items, router)),
39 itemOverviewModel(new ItemOverviewModel(file->data->dataExpanded->player->items, file->data->dataExpanded->storage->items)),
40 pokemonOverviewModel(new PokemonOverviewModel(file->data->dataExpanded->player->pokemon, file->data->dataExpanded->storage, file->data->dataExpanded->player->basics)),
42 file->data->dataExpanded->player->items,
43 file->data->dataExpanded->storage->items,
44 file->data->dataExpanded->player->basics,
45 router,
46 file->data->dataExpanded->player->pokemon,
47 file->data->dataExpanded->storage,
48 file->data
49 )),
52 pokemonStorageModel1(new PokemonStorageModel(router, file->data->dataExpanded->storage, file->data->dataExpanded->player->pokemon)),
53 pokemonStorageModel2(new PokemonStorageModel(router, file->data->dataExpanded->storage, file->data->dataExpanded->player->pokemon)),
54 mapSelectModel(new MapSelectModel(file->data->dataExpanded->area->map))
55{
56 // Link the two
59
60 // Link the two item models too (for drag-to-transfer between the bag and the
61 // PC item box).
62 bagItemsModel->otherModel = pcItemsModel;
63 pcItemsModel->otherModel = bagItemsModel;
64
65 // Switch the second half to box 0, the two halves don't need to show the same
66 // box
67 pokemonStorageModel2->switchBox(0);
68
69 // Setup paired select boxes after storage models are created and init
72}
PokemonStorageModel * pokemonStorageModel2
Definition bridge.h:174
ItemMarketModel * marketModel
Definition bridge.h:170
ItemStorageModel * bagItemsModel
Definition bridge.h:166
ItemOverviewModel * itemOverviewModel
Definition bridge.h:168
ItemMarketViewModel * marketViewModel
Definition bridge.h:172
ItemMarketCartModel * marketCartModel
Definition bridge.h:171
FileManagement * file
Definition bridge.h:149
PokemonStorageModel * pokemonStorageModel1
Definition bridge.h:173
PokemonOverviewModel * pokemonOverviewModel
Definition bridge.h:169
Router * router
Definition bridge.h:154
Bridge(FileManagement *file)
Definition bridge.cpp:33
RecentFilesModel * recentFilesModel
Definition bridge.h:164
PokemonBoxSelectModel * pokemonBoxSelectModel2
Definition bridge.h:176
PokemonBoxSelectModel * pokemonBoxSelectModel1
Definition bridge.h:175
MapSelectModel * mapSelectModel
Definition bridge.h:185
ItemStorageModel * pcItemsModel
Definition bridge.h:167
PokedexModel * pokedexModel
Definition bridge.h:165
Owns the on-disk side of a save: the current path, the recent-files list, and the live SaveFile.
The "cart" view of ItemMarketModel – only the rows actually on the cart.
The Poke-mart / Game Corner "market" model – buy and sell with a cart.
The left-list VIEW of ItemMarketModel – the Buy or Sell slice.
Read-only "where are my items" overview for the Bag screen's View All pane.
Editable list model for an item box (the bag or a PC item box).
Map picker model, tied to the current AreaMap.
The Pokedex grid model – seen/owned state, with cycling sort orders.
The "which PC box" selector model (Party + 12 boxes).
Read-only "where are my Pokemon" overview for the Pokemon screen's View All pane – the Pokemon analog...
Editable list model for a PC box (or the party), with checkbox selection.
Recent-files list model for the start screen.