Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
worldother.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
>
19
#include "
../../savefile_autoport.h
"
20
21
class
SaveFile
;
22
23
// Counts playtime up to
24
// 10 days, 15 hours, 59 minutes, 59 seconds, and 59 frames
36
class
SAVEFILE_AUTOPORT
Playtime
:
public
QObject {
37
Q_OBJECT
38
39
Q_PROPERTY(
int
days READ getDays WRITE setDays NOTIFY hoursChanged)
40
Q_PROPERTY(
int
hours
MEMBER
hours
NOTIFY hoursChanged)
41
Q_PROPERTY(
int
hoursAdjusted READ getHoursAdjusted WRITE setHoursAdjusted NOTIFY hoursChanged)
42
Q_PROPERTY(
int
minutes
MEMBER
minutes
NOTIFY minutesChanged)
43
Q_PROPERTY(
int
seconds
MEMBER
seconds
NOTIFY secondsChanged)
44
Q_PROPERTY(
int
frames
MEMBER
frames
NOTIFY framesChanged)
45
Q_PROPERTY(
bool
clockMaxed
MEMBER
clockMaxed
NOTIFY clockMaxedChanged)
46
47
// Converts hours into days and allows converting back from days
48
Q_INVOKABLE
int
getDays();
49
Q_INVOKABLE
void
setDays(
int
val);
50
51
// Gets hours within the day,
52
Q_INVOKABLE
int
getHoursAdjusted();
53
Q_INVOKABLE
void
setHoursAdjusted(
int
val);
54
55
signals:
56
void
hoursChanged();
57
void
minutesChanged();
58
void
secondsChanged();
59
void
framesChanged();
60
void
clockMaxedChanged();
61
62
public
:
63
int
hours
;
64
int
minutes
;
65
int
seconds
;
66
int
frames
;
67
68
// Any value, it just stops the clock completely
69
bool
clockMaxed
;
70
};
71
82
class
SAVEFILE_AUTOPORT
WorldOther
:
public
QObject
83
{
84
Q_OBJECT
85
86
Q_PROPERTY(
bool
debugMode
MEMBER
debugMode
NOTIFY
debugModeChanged
)
87
Q_PROPERTY(
Playtime
*
playtime
MEMBER
playtime
NOTIFY
playtimeChanged
)
88
Q_PROPERTY(
int
fossilItemGiven
MEMBER
fossilItemGiven
NOTIFY
fossilItemGivenChanged
)
89
Q_PROPERTY(
int
fossilPkmnResult
MEMBER
fossilPkmnResult
NOTIFY
fossilPkmnResultChanged
)
90
91
public
:
92
WorldOther
(
SaveFile
* saveFile =
nullptr
);
93
virtual
~WorldOther
();
94
95
void
load
(
SaveFile
* saveFile =
nullptr
);
96
void
save
(
SaveFile
* saveFile);
97
98
signals:
99
void
debugModeChanged
();
100
void
playtimeChanged
();
101
void
fossilItemGivenChanged
();
102
void
fossilPkmnResultChanged
();
103
104
public
slots:
105
void
reset
();
106
void
randomize
();
107
void
randomizePlaytime
();
108
void
clearPlaytime
();
109
110
public
:
111
// Hold B to avoid wild battles
112
// It also skips most of Prof Oaks speech and sets default names however the
113
// latter two don't apply since loading a saveFile means all that is over with
114
// anyways
115
bool
debugMode
;
116
117
// Playtime
118
Playtime
*
playtime
;
119
120
// Fossils
121
int
fossilItemGiven
;
122
int
fossilPkmnResult
;
123
};
Playtime
The save's playtime clock, surfaced to QML as days/hours/minutes/seconds/frames.
Definition
worldother.h:36
Playtime::hours
int hours
Max 255.
Definition
worldother.h:63
Playtime::minutes
int minutes
Max 59, any higher will reset to zero and increment hr by 1.
Definition
worldother.h:64
Playtime::frames
int frames
Max 59, any higher will reset to zero and increment sec by 1.
Definition
worldother.h:66
Playtime::clockMaxed
bool clockMaxed
Any value; it just stops the clock completely.
Definition
worldother.h:69
Playtime::seconds
int seconds
Max 59, any higher will reset to zero and increment min by 1.
Definition
worldother.h:65
SaveFile
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition
savefile.h:46
WorldOther::fossilItemGiven
int fossilItemGiven
Definition
worldother.h:121
WorldOther::fossilItemGivenChanged
void fossilItemGivenChanged()
WorldOther::fossilPkmnResult
int fossilPkmnResult
Definition
worldother.h:122
WorldOther::load
void load(SaveFile *saveFile=nullptr)
Expand this region from the save.
Definition
worldother.cpp:39
WorldOther::randomize
void randomize()
Randomize this region.
Definition
worldother.cpp:119
WorldOther::playtimeChanged
void playtimeChanged()
WorldOther::debugMode
bool debugMode
Definition
worldother.h:115
WorldOther::WorldOther
WorldOther(SaveFile *saveFile=nullptr)
< In-game debug mode flag (see field note).
Definition
worldother.cpp:29
WorldOther::save
void save(SaveFile *saveFile)
Flatten this region to the save.
Definition
worldother.cpp:75
WorldOther::playtime
Playtime * playtime
Definition
worldother.h:118
WorldOther::debugModeChanged
protected::void debugModeChanged()
WorldOther::reset
void reset()
Blank this region.
Definition
worldother.cpp:92
WorldOther::clearPlaytime
void clearPlaytime()
Zero the playtime clock.
Definition
worldother.cpp:147
WorldOther::randomizePlaytime
void randomizePlaytime()
Randomize just the playtime clock.
Definition
worldother.cpp:130
WorldOther::fossilPkmnResultChanged
void fossilPkmnResultChanged()
types.h
Project-wide fixed-width integer aliases (var8, var16, ...).
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
projects
savefile
src
pse-savefile
expanded
world
worldother.h
Generated by
1.17.0