Skip to content
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 itemExchangeModel(new ItemExchangeModel(file->data->dataExpanded->player->items, file->data->dataExpanded->storage->items, file->data->dataExpanded->player->basics)),
41 pokemonOverviewModel(new PokemonOverviewModel(file->data->dataExpanded->player->pokemon, file->data->dataExpanded->storage, file->data->dataExpanded->player->basics)),
43 file->data->dataExpanded->player->items,
44 file->data->dataExpanded->storage->items,
45 file->data->dataExpanded->player->basics,
46 router,
47 file->data->dataExpanded->player->pokemon,
48 file->data->dataExpanded->storage,
49 file->data
50 )),
53 pokemonStorageModel1(new PokemonStorageModel(router, file->data->dataExpanded->storage, file->data->dataExpanded->player->pokemon)),
54 pokemonStorageModel2(new PokemonStorageModel(router, file->data->dataExpanded->storage, file->data->dataExpanded->player->pokemon)),
55 mapSelectModel(new MapSelectModel(file->data->dataExpanded->area->map))
56{
57 // Link the two
60
61 // Link the two item models too (for drag-to-transfer between the bag and the
62 // PC item box).
63 bagItemsModel->otherModel = pcItemsModel;
64 pcItemsModel->otherModel = bagItemsModel;
65
66 // Switch the second half to box 0, the two halves don't need to show the same
67 // box
68 pokemonStorageModel2->switchBox(0);
69
70 // Setup paired select boxes after storage models are created and init
73}
PokemonStorageModel * pokemonStorageModel2
Definition bridge.h:174
ItemMarketModel * marketModel
Definition bridge.h:170
ItemStorageModel * bagItemsModel
Definition bridge.h:165
ItemOverviewModel * itemOverviewModel
Definition bridge.h:167
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:153
Bridge(FileManagement *file)
Definition bridge.cpp:33
RecentFilesModel * recentFilesModel
Definition bridge.h:163
PokemonBoxSelectModel * pokemonBoxSelectModel2
Definition bridge.h:176
PokemonBoxSelectModel * pokemonBoxSelectModel1
Definition bridge.h:175
MapSelectModel * mapSelectModel
Definition bridge.h:185
ItemExchangeModel * itemExchangeModel
Definition bridge.h:168
ItemStorageModel * pcItemsModel
Definition bridge.h:166
PokedexModel * pokedexModel
Definition bridge.h:164
Owns the on-disk side of a save: the current path, the recent-files list, and the live SaveFile.
Item<->item exchange for the Market's Exchange tab (Healing + Custom).
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.