Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
areatileset.h
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#pragma once
17#include <QObject>
18#include <pse-common/types.h>
20
21class SaveFile;
22struct MapDBEntry;
23
25
37class SAVEFILE_AUTOPORT AreaTileset : public QObject
38{
39 Q_OBJECT
40
41 Q_PROPERTY(int current MEMBER current NOTIFY currentChanged)
42 Q_PROPERTY(int grassTile MEMBER grassTile NOTIFY grassTileChanged)
43 Q_PROPERTY(int boulderIndex MEMBER boulderIndex NOTIFY boulderIndexChanged)
44 Q_PROPERTY(int boulderColl MEMBER boulderColl NOTIFY boulderCollChanged)
45 Q_PROPERTY(int type MEMBER type NOTIFY typeChanged)
46 Q_PROPERTY(int bank MEMBER bank NOTIFY bankChanged)
47 Q_PROPERTY(int blockPtr MEMBER blockPtr NOTIFY blockPtrChanged)
48 Q_PROPERTY(int gfxPtr MEMBER gfxPtr NOTIFY gfxPtrChanged)
49 Q_PROPERTY(int collPtr MEMBER collPtr NOTIFY collPtrChanged)
50
51public:
52 AreaTileset(SaveFile* saveFile = nullptr);
53 virtual ~AreaTileset();
54
55 void load(SaveFile* saveFile = nullptr);
56 void save(SaveFile* saveFile);
57
58 Q_INVOKABLE int talkingOverTilesCount();
59 Q_INVOKABLE int talkingOverTilesAt(int ind);
60 Q_INVOKABLE void talkingOverTilesSwap(int from, int to);
61
62signals:
73
74public slots:
75 void reset();
76 void randomize();
77 void loadFromData(MapDBEntry* map, bool randomType = false);
78
79public:
80 // Which tileset to use. Changing this will make the map
81 // unplayable unless you know what your doing.
83
84 // Which tiles can you talk over when 1 tile sits between you and an NPC
85 // Mainly used for Pokemon Centers
87
90
91 // These are somewhat abstract, they're used when your adjancent to boulders
92 // or when your interacting/interacted with boulders. I don't think I've seen
93 // them used in a sav file
96
97 // This is something that can be freely changed, there are 3 tilesets and they
98 // are treated differently on gameplay. "Outside" animates flower and water
99 // tiles replacing whatever tiles were there so changing SS anne to outside
100 // causes the windows to be animated flowers ~_^ but the types do other stuff
101 // as well
102 int type;
103
104 // Tileset location, bank and pointers. Changing these will make the map
105 // unplayable unless you know what your doing.
106 // For a tileset
107 // * GFX & Blocks are always on the same bank, the bank number tells you where
108 // * Collision is always in bank 0 (Home Bank)
109 int bank;
113};
constexpr var8 maxTalkingOverTiles
Number of "talk-over" tile slots.
Definition areatileset.h:24
void reset()
Blank the tileset block.
void boulderCollChanged()
void talkingOverTilesSwap(int from, int to)
Reorder talk-over tiles.
void loadFromData(MapDBEntry *map, bool randomType=false)
Set from map (optionally random type).
void grassTileChanged()
void typeChanged()
void save(SaveFile *saveFile)
Flatten the tileset block to the save.
void randomize()
Randomize the tileset.
void boulderIndexChanged()
protected::void currentChanged()
int talkingOverTilesAt(int ind)
Talk-over tile at ind.
void collPtrChanged()
int talkingOverTilesCount()
Number of talk-over tile slots.
AreaTileset(SaveFile *saveFile=nullptr)
< Active tileset id (risky to change).
void load(SaveFile *saveFile=nullptr)
Expand the tileset block from the save.
void bankChanged()
void gfxPtrChanged()
var8 talkingOverTiles[maxTalkingOverTiles]
Definition areatileset.h:86
int grassTile
Which tile is a grass tile? In testing I got odd results changing this.
Definition areatileset.h:89
void talkingOverTilesChanged()
void blockPtrChanged()
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition savefile.h:46
Project-wide fixed-width integer aliases (var8, var16, ...).
var8e var8
Everyday 8-bit alias. Exact (not "fastest") to dodge the pointer-width bug noted above.
Definition types.h:124
Import/export macro for the savefile library, plus the central list of QObject types kept deliberatel...
#define SAVEFILE_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
One map's complete static definition – the root of the MapDBEntry family.
Definition mapdbentry.h:56