Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
worldmissables.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
// There's actually significantly more missable bits, 256 in total forming
24
// 32 bytes. But given they are all unused it makes no sense to load entire
25
// unused bytes
26
constexpr
var8
missableCount
= 228;
27
constexpr
var8
missableByteCount
= 29;
28
39
class
SAVEFILE_AUTOPORT
WorldMissables
:
public
QObject
40
{
41
Q_OBJECT
42
43
public
:
44
WorldMissables
(
SaveFile
* saveFile =
nullptr
);
45
virtual
~WorldMissables
();
46
47
void
load
(
SaveFile
* saveFile =
nullptr
);
48
void
save
(
SaveFile
* saveFile);
49
50
Q_INVOKABLE
int
missablesCount
();
51
Q_INVOKABLE
bool
missablesAt
(
int
ind);
52
Q_INVOKABLE
void
missablesSet
(
int
ind,
bool
val);
53
54
signals:
55
void
missablesChanged
();
56
57
public
slots:
58
void
reset
();
59
void
randomize
();
60
61
public
:
62
bool
missables
[
missableCount
];
63
};
SaveFile
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition
savefile.h:46
WorldMissables::reset
void reset()
Clear all missable flags.
Definition
worldmissables.cpp:87
WorldMissables::missablesSet
void missablesSet(int ind, bool val)
Set/clear missable ind.
Definition
worldmissables.cpp:81
WorldMissables::WorldMissables
WorldMissables(SaveFile *saveFile=nullptr)
Definition
worldmissables.cpp:33
WorldMissables::missablesChanged
protected::void missablesChanged()
WorldMissables::missablesCount
int missablesCount()
Number of missable flags.
Definition
worldmissables.cpp:71
WorldMissables::missablesAt
bool missablesAt(int ind)
Is missable ind set (shown/hidden)?
Definition
worldmissables.cpp:76
WorldMissables::missables
bool missables[missableCount]
Per-missable visibility flags.
Definition
worldmissables.h:62
WorldMissables::save
void save(SaveFile *saveFile)
Flatten the missable flags to the save.
Definition
worldmissables.cpp:58
WorldMissables::load
void load(SaveFile *saveFile=nullptr)
Expand the missable flags from the save.
Definition
worldmissables.cpp:40
WorldMissables::randomize
void randomize()
Randomize the missable flags.
Definition
worldmissables.cpp:100
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
missableCount
constexpr var8 missableCount
Missable-sprite flags actually used.
Definition
worldmissables.h:26
missableByteCount
constexpr var8 missableByteCount
4 bits unused of 232
Definition
worldmissables.h:27
projects
savefile
src
pse-savefile
expanded
world
worldmissables.h
Generated by
1.17.0