Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
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>
20
21class 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
26constexpr var8 missableCount = 228;
27constexpr var8 missableByteCount = 29;
28
39class SAVEFILE_AUTOPORT WorldMissables : public QObject
40{
41 Q_OBJECT
42
43public:
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
54signals:
56
57public slots:
58 void reset();
59 void randomize();
60
61public:
63};
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition savefile.h:46
void reset()
Clear all missable flags.
void missablesSet(int ind, bool val)
Set/clear missable ind.
WorldMissables(SaveFile *saveFile=nullptr)
protected::void missablesChanged()
int missablesCount()
Number of missable flags.
bool missablesAt(int ind)
Is missable ind set (shown/hidden)?
bool missables[missableCount]
Per-missable visibility flags.
void save(SaveFile *saveFile)
Flatten the missable flags to the save.
void load(SaveFile *saveFile=nullptr)
Expand the missable flags from the save.
void randomize()
Randomize the missable flags.
Project-wide fixed-width integer aliases (var8, var16, ...).
var8e var8
Everyday 8-bit alias. Exact (not "fastest") to dodge the pointer-width bug noted above.
Definition types.h:124
Import/export macro for the savefile library, plus the central list of QObject types kept deliberatel...
#define SAVEFILE_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
constexpr var8 missableCount
Missable-sprite flags actually used.
constexpr var8 missableByteCount
4 bits unused of 232