Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
areasign.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
>
20
#include "
../../savefile_autoport.h
"
21
22
class
SaveFile
;
23
class
SignData
;
24
class
MapDBEntry
;
25
26
constexpr
var8
maxSigns
= 16;
27
37
class
SAVEFILE_AUTOPORT
AreaSign
:
public
QObject
38
{
39
Q_OBJECT
40
41
public
:
42
AreaSign
(
SaveFile
* saveFile =
nullptr
);
43
virtual
~AreaSign
();
44
45
void
load
(
SaveFile
* saveFile =
nullptr
);
46
void
save
(
SaveFile
* saveFile);
47
48
Q_INVOKABLE
int
signCount
();
49
Q_INVOKABLE
int
signMax
();
50
Q_INVOKABLE
SignData
*
signAt
(
int
ind);
51
Q_INVOKABLE
void
signSwap
(
int
from,
int
to);
52
Q_INVOKABLE
void
signRemove
(
int
ind);
53
Q_INVOKABLE
void
signNew
();
54
55
signals:
56
void
signsChanged
();
57
58
public
slots:
59
void
reset
();
60
void
randomize
(
MapDBEntry
* mapData);
61
void
setTo
(
MapDBEntry
* mapData);
62
63
public
:
64
QVector<SignData*>
signs
;
65
};
maxSigns
constexpr var8 maxSigns
Maximum signs on a map.
Definition
areasign.h:26
AreaSign::signSwap
void signSwap(int from, int to)
Reorder signs.
Definition
areasign.cpp:58
AreaSign::save
void save(SaveFile *saveFile)
Flatten the sign list to the save.
Definition
areasign.cpp:104
AreaSign::AreaSign
AreaSign(SaveFile *saveFile=nullptr)
Definition
areasign.cpp:32
AreaSign::signNew
void signNew()
Add a fresh sign.
Definition
areasign.cpp:79
AreaSign::signRemove
void signRemove(int ind)
Remove sign ind.
Definition
areasign.cpp:69
AreaSign::load
void load(SaveFile *saveFile=nullptr)
Expand the sign list from the save.
Definition
areasign.cpp:88
AreaSign::randomize
void randomize(MapDBEntry *mapData)
Randomize signs for mapData.
Definition
areasign.cpp:124
AreaSign::signMax
int signMax()
Capacity (maxSigns).
Definition
areasign.cpp:48
AreaSign::signs
QVector< SignData * > signs
The map's signs.
Definition
areasign.h:64
AreaSign::signAt
SignData * signAt(int ind)
Sign ind (GC-protected return).
Definition
areasign.cpp:53
AreaSign::setTo
void setTo(MapDBEntry *mapData)
Rebuild the list from mapData's signs.
Definition
areasign.cpp:137
AreaSign::signCount
int signCount()
Number of signs.
Definition
areasign.cpp:43
AreaSign::signsChanged
protected::void signsChanged()
AreaSign::reset
void reset()
Empty the sign list.
Definition
areasign.cpp:114
SaveFile
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition
savefile.h:46
SignData
One sign on the current map: its tile position and text id.
Definition
signdata.h:37
types.h
Project-wide fixed-width integer aliases (var8, var16, ...).
var8
var8e var8
Everyday 8-bit alias. Exact (not "fastest") to dodge the pointer-width bug noted above.
Definition
types.h:124
savefile_autoport.h
Import/export macro for the savefile library, plus the central list of QObject types kept deliberatel...
SAVEFILE_AUTOPORT
#define SAVEFILE_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
Definition
savefile_autoport.h:38
MapDBEntry
One map's complete static definition – the root of the MapDBEntry family.
Definition
mapdbentry.h:56
projects
savefile
src
pse-savefile
expanded
area
areasign.h
Generated by
1.17.0