Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
areawarps.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
WarpData
;
24
class
MapDBEntry
;
25
26
constexpr
var8
maxWarps
= 32;
27
39
class
SAVEFILE_AUTOPORT
AreaWarps
:
public
QObject
40
{
41
Q_OBJECT
42
43
Q_PROPERTY(
bool
scriptedWarp
MEMBER
scriptedWarp
NOTIFY
scriptedWarpChanged
)
44
Q_PROPERTY(
bool
isDungeonWarp
MEMBER
isDungeonWarp
NOTIFY
isDungeonWarpChanged
)
45
Q_PROPERTY(
bool
skipJoypadCheckWarps
MEMBER
skipJoypadCheckWarps
NOTIFY
skipJoypadCheckWarpsChanged
)
46
Q_PROPERTY(
int
warpDest
MEMBER
warpDest
NOTIFY
warpDestChanged
)
47
Q_PROPERTY(
int
dungeonWarpDestMap
MEMBER
dungeonWarpDestMap
NOTIFY
dungeonWarpDestMapChanged
)
48
Q_PROPERTY(
int
specialWarpDestMap
MEMBER
specialWarpDestMap
NOTIFY
specialWarpDestMapChanged
)
49
Q_PROPERTY(
bool
flyOrDungeonWarp
MEMBER
flyOrDungeonWarp
NOTIFY
flyOrDungeonWarpChanged
)
50
Q_PROPERTY(
bool
flyWarp
MEMBER
flyWarp
NOTIFY
flyWarpChanged
)
51
Q_PROPERTY(
bool
dungeonWarp
MEMBER
dungeonWarp
NOTIFY
dungeonWarpChanged
)
52
Q_PROPERTY(
int
whichDungeonWarp
MEMBER
whichDungeonWarp
NOTIFY
whichDungeonWarpChanged
)
53
Q_PROPERTY(
int
warpedFromWarp
MEMBER
warpedFromWarp
NOTIFY
warpedFromWarpChanged
)
54
Q_PROPERTY(
int
warpedfromMap
MEMBER
warpedfromMap
NOTIFY
warpedfromMapChanged
)
55
56
public
:
57
AreaWarps
(
SaveFile
* saveFile =
nullptr
);
58
virtual
~AreaWarps
();
59
60
void
load
(
SaveFile
* saveFile =
nullptr
);
61
void
save
(
SaveFile
* saveFile);
62
63
Q_INVOKABLE
int
warpCount
();
64
Q_INVOKABLE
int
warpMax
();
65
Q_INVOKABLE
WarpData
*
warpAt
(
int
ind);
66
Q_INVOKABLE
void
warpSwap
(
int
from,
int
to);
67
Q_INVOKABLE
void
warpRemove
(
int
ind);
68
Q_INVOKABLE
void
warpNew
();
69
70
signals:
71
void
scriptedWarpChanged
();
72
void
isDungeonWarpChanged
();
73
void
skipJoypadCheckWarpsChanged
();
74
void
warpDestChanged
();
75
void
dungeonWarpDestMapChanged
();
76
void
specialWarpDestMapChanged
();
77
void
flyOrDungeonWarpChanged
();
78
void
flyWarpChanged
();
79
void
dungeonWarpChanged
();
80
void
whichDungeonWarpChanged
();
81
void
warpedFromWarpChanged
();
82
void
warpedfromMapChanged
();
83
void
warpsChanged
();
84
85
public
slots:
86
void
reset
();
87
void
randomize
(
MapDBEntry
* map);
88
void
setTo
(
MapDBEntry
* map);
89
90
public
:
91
// Pre-Warp
92
bool
scriptedWarp
;
93
bool
isDungeonWarp
;
94
bool
skipJoypadCheckWarps
;
95
96
// Warping
97
int
warpDest
;
98
int
dungeonWarpDestMap
;
99
int
specialWarpDestMap
;
100
bool
flyOrDungeonWarp
;
101
bool
flyWarp
;
102
bool
dungeonWarp
;
103
104
// Warped
105
int
whichDungeonWarp
;
106
int
warpedFromWarp
;
107
int
warpedfromMap
;
108
109
QVector<WarpData*>
warps
;
110
};
maxWarps
constexpr var8 maxWarps
Maximum warps on a map.
Definition
areawarps.h:26
AreaWarps::warpNew
void warpNew()
Add a fresh warp.
Definition
areawarps.cpp:80
AreaWarps::scriptedWarpChanged
protected::void scriptedWarpChanged()
AreaWarps::flyOrDungeonWarpChanged
void flyOrDungeonWarpChanged()
AreaWarps::skipJoypadCheckWarps
bool skipJoypadCheckWarps
Skips check for warp after not collided (Forced Warp)??
Definition
areawarps.h:94
AreaWarps::warpedFromWarp
int warpedFromWarp
Warped from which warp.
Definition
areawarps.h:106
AreaWarps::warpAt
WarpData * warpAt(int ind)
Warp ind (GC-protected return).
Definition
areawarps.cpp:54
AreaWarps::whichDungeonWarp
int whichDungeonWarp
Warped from which dungeon warp.
Definition
areawarps.h:105
AreaWarps::dungeonWarpChanged
void dungeonWarpChanged()
AreaWarps::specialWarpDestMap
int specialWarpDestMap
Destination Map for special warps.
Definition
areawarps.h:99
AreaWarps::warpSwap
void warpSwap(int from, int to)
Reorder warps.
Definition
areawarps.cpp:59
AreaWarps::warpedfromMapChanged
void warpedfromMapChanged()
AreaWarps::AreaWarps
AreaWarps(SaveFile *saveFile=nullptr)
< Do a scripted warp.
Definition
areawarps.cpp:34
AreaWarps::isDungeonWarp
bool isDungeonWarp
On a dungeon warp.
Definition
areawarps.h:93
AreaWarps::whichDungeonWarpChanged
void whichDungeonWarpChanged()
AreaWarps::flyWarpChanged
void flyWarpChanged()
AreaWarps::warpsChanged
void warpsChanged()
AreaWarps::randomize
void randomize(MapDBEntry *map)
Randomize warps for map.
Definition
areawarps.cpp:210
AreaWarps::flyOrDungeonWarp
bool flyOrDungeonWarp
Is a fly or dungeon warp.
Definition
areawarps.h:100
AreaWarps::warpDest
int warpDest
Warp actively warping to or 0xFF to warp to same position.
Definition
areawarps.h:97
AreaWarps::warpedfromMap
int warpedfromMap
Warped from which map.
Definition
areawarps.h:107
AreaWarps::scriptedWarp
bool scriptedWarp
Do a scripted warp.
Definition
areawarps.h:92
AreaWarps::dungeonWarpDestMapChanged
void dungeonWarpDestMapChanged()
AreaWarps::warpMax
int warpMax()
Capacity (maxWarps).
Definition
areawarps.cpp:49
AreaWarps::warpCount
int warpCount()
Number of warps.
Definition
areawarps.cpp:44
AreaWarps::setTo
void setTo(MapDBEntry *map)
Rebuild warps from map.
Definition
areawarps.cpp:249
AreaWarps::save
void save(SaveFile *saveFile)
Flatten the warp list + state to the save.
Definition
areawarps.cpp:141
AreaWarps::dungeonWarpDestMap
int dungeonWarpDestMap
Destination Map for dungeon warps.
Definition
areawarps.h:98
AreaWarps::dungeonWarp
bool dungeonWarp
Is a dungeon warp.
Definition
areawarps.h:102
AreaWarps::warpDestChanged
void warpDestChanged()
AreaWarps::warpedFromWarpChanged
void warpedFromWarpChanged()
AreaWarps::load
void load(SaveFile *saveFile=nullptr)
Expand the warp list + state from the save.
Definition
areawarps.cpp:89
AreaWarps::specialWarpDestMapChanged
void specialWarpDestMapChanged()
AreaWarps::reset
void reset()
Empty warps + clear state.
Definition
areawarps.cpp:165
AreaWarps::isDungeonWarpChanged
void isDungeonWarpChanged()
AreaWarps::flyWarp
bool flyWarp
Is a fly warp.
Definition
areawarps.h:101
AreaWarps::warpRemove
void warpRemove(int ind)
Remove warp ind.
Definition
areawarps.cpp:70
AreaWarps::skipJoypadCheckWarpsChanged
void skipJoypadCheckWarpsChanged()
AreaWarps::warps
QVector< WarpData * > warps
The map's warp points.
Definition
areawarps.h:109
SaveFile
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition
savefile.h:46
WarpData
One warp point on the current map: its tile and where it leads.
Definition
warpdata.h:36
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
areawarps.h
Generated by
1.17.0