Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
signdata.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 <QVector>
19#include <pse-common/types.h>
21
22class SaveFile;
23class MapDBEntrySign;
24struct TmpSignPos;
25
36class SAVEFILE_AUTOPORT SignData : public QObject
37{
38 Q_OBJECT
39
40 Q_PROPERTY(int x MEMBER x NOTIFY xChanged)
41 Q_PROPERTY(int y MEMBER y NOTIFY yChanged)
42 Q_PROPERTY(int txtId MEMBER txtId NOTIFY txtIdChanged)
43
44public:
45 SignData(SaveFile* saveFile = nullptr, var8 index = 0);
46 virtual ~SignData();
47
48 void load(SaveFile* saveFile = nullptr, var8 index = 0);
49 void save(SaveFile* saveFile, var8 index);
50
51signals:
52 void xChanged();
53 void yChanged();
55
56public slots:
57 void reset();
58 void randomize(QVector<TmpSignPos*>* tmpPos = nullptr);
59 static QVector<SignData*> randomizeAll(QVector<MapDBEntrySign*> mapSigns);
60
61 void setTo(MapDBEntrySign* signData);
62 static QVector<SignData*> setToAll(QVector<MapDBEntrySign*> mapSigns);
63
64public:
65 int x;
66 int y;
67 int txtId;
68};
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition savefile.h:46
void setTo(MapDBEntrySign *signData)
Copy values from a map-defined sign.
Definition signdata.cpp:118
void load(SaveFile *saveFile=nullptr, var8 index=0)
Expand sign index from the save.
Definition signdata.cpp:42
void yChanged()
void randomize(QVector< TmpSignPos * > *tmpPos=nullptr)
Randomize position (avoiding tmpPos clashes).
Definition signdata.cpp:151
void txtIdChanged()
protected::void xChanged()
int txtId
Definition signdata.h:67
void save(SaveFile *saveFile, var8 index)
Flatten sign index to the save.
Definition signdata.cpp:63
SignData(SaveFile *saveFile=nullptr, var8 index=0)
< Sign tile X.
Definition signdata.cpp:35
int y
Definition signdata.h:66
void reset()
Blank this sign.
Definition signdata.cpp:75
static QVector< SignData * > randomizeAll(QVector< MapDBEntrySign * > mapSigns)
Randomize a whole map's signs.
Definition signdata.cpp:87
int x
Definition signdata.h:65
static QVector< SignData * > setToAll(QVector< MapDBEntrySign * > mapSigns)
Build signs from a map's sign list.
Definition signdata.cpp:135
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 sign defined on a map: its position and text id.