Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
worldhidden.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 hidden item bits, 112 in total forming
24
// 14 bytes. But given they are all unused it makes no sense to load entire
25
// unused bytes
26
constexpr
var8
hiddenItemCount
= 54;
27
constexpr
var8
hiddenCoinCount
= 12;
28
constexpr
var8
hiddenItemByteCount
= 7;
29
constexpr
var8
hiddenCoinByteCount
= 2;
30
41
class
SAVEFILE_AUTOPORT
WorldHidden
:
public
QObject
42
{
43
Q_OBJECT
44
45
public
:
46
WorldHidden
(
SaveFile
* saveFile =
nullptr
);
47
virtual
~WorldHidden
();
48
49
void
load
(
SaveFile
* saveFile =
nullptr
);
50
void
save
(
SaveFile
* saveFile);
51
52
Q_INVOKABLE
int
hItemsCount
();
53
Q_INVOKABLE
bool
hItemsAt
(
int
ind);
54
Q_INVOKABLE
void
hItemsSet
(
int
ind,
bool
val);
55
56
Q_INVOKABLE
int
hCoinsCount
();
57
Q_INVOKABLE
bool
hCoinsAt
(
int
ind);
58
Q_INVOKABLE
void
hCoinsSet
(
int
ind,
bool
val);
59
60
signals:
61
void
hiddenItemsChanged
();
62
void
hiddenCoinsChanged
();
63
64
public
slots:
65
void
reset
();
66
void
randomize
();
67
68
public
:
69
bool
hiddenItems
[
hiddenItemCount
];
70
bool
hiddenCoins
[
hiddenCoinCount
];
71
};
SaveFile
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition
savefile.h:46
WorldHidden::reset
void reset()
Clear all hidden flags.
Definition
worldhidden.cpp:116
WorldHidden::hItemsCount
int hItemsCount()
Number of hidden-item flags.
Definition
worldhidden.cpp:84
WorldHidden::hiddenCoins
bool hiddenCoins[hiddenCoinCount]
Hidden-coin collected flags.
Definition
worldhidden.h:70
WorldHidden::randomize
void randomize()
Randomize the hidden flags.
Definition
worldhidden.cpp:126
WorldHidden::hiddenItemsChanged
protected::void hiddenItemsChanged()
WorldHidden::load
void load(SaveFile *saveFile=nullptr)
Expand the hidden-item/coin flags from the save.
Definition
worldhidden.cpp:38
WorldHidden::hCoinsCount
int hCoinsCount()
Number of hidden-coin flags.
Definition
worldhidden.cpp:100
WorldHidden::hItemsSet
void hItemsSet(int ind, bool val)
Set/clear hidden item ind.
Definition
worldhidden.cpp:94
WorldHidden::hiddenItems
bool hiddenItems[hiddenItemCount]
Hidden-item collected flags.
Definition
worldhidden.h:69
WorldHidden::hCoinsAt
bool hCoinsAt(int ind)
Is hidden coin ind collected?
Definition
worldhidden.cpp:105
WorldHidden::hItemsAt
bool hItemsAt(int ind)
Is hidden item ind collected?
Definition
worldhidden.cpp:89
WorldHidden::WorldHidden
WorldHidden(SaveFile *saveFile=nullptr)
Definition
worldhidden.cpp:31
WorldHidden::hCoinsSet
void hCoinsSet(int ind, bool val)
Set/clear hidden coin ind.
Definition
worldhidden.cpp:110
WorldHidden::hiddenCoinsChanged
void hiddenCoinsChanged()
WorldHidden::save
void save(SaveFile *saveFile)
Flatten the hidden-item/coin flags to the save.
Definition
worldhidden.cpp:64
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
hiddenCoinCount
constexpr var8 hiddenCoinCount
Hidden-coin collected flags actually used.
Definition
worldhidden.h:27
hiddenCoinByteCount
constexpr var8 hiddenCoinByteCount
4 Bits of 16 unused
Definition
worldhidden.h:29
hiddenItemByteCount
constexpr var8 hiddenItemByteCount
2 Bits of 56 unused
Definition
worldhidden.h:28
hiddenItemCount
constexpr var8 hiddenItemCount
Hidden-item collected flags actually used.
Definition
worldhidden.h:26
projects
savefile
src
pse-savefile
expanded
world
worldhidden.h
Generated by
1.17.0