Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
worldscripts.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
// Can't have a total byte count given scripts are a bit more complicated to
24
// read
25
constexpr
var8
scriptCount
= 97;
26
37
class
SAVEFILE_AUTOPORT
WorldScripts
:
public
QObject
38
{
39
Q_OBJECT
40
41
public
:
42
WorldScripts
(
SaveFile
* saveFile =
nullptr
);
43
virtual
~WorldScripts
();
44
45
void
load
(
SaveFile
* saveFile =
nullptr
);
46
void
save
(
SaveFile
* saveFile);
47
48
Q_INVOKABLE
int
scriptsCount
();
49
Q_INVOKABLE
int
scriptsAt
(
int
ind);
50
Q_INVOKABLE
void
scriptsSet
(
int
ind,
int
val);
51
52
signals:
53
void
curScriptsChanged
();
54
55
public
slots:
56
void
reset
();
57
void
randomize
();
58
59
public
:
60
var16
curScripts
[
scriptCount
];
61
};
SaveFile
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition
savefile.h:46
WorldScripts::scriptsAt
int scriptsAt(int ind)
Script value for map index ind.
Definition
worldscripts.cpp:87
WorldScripts::curScriptsChanged
protected::void curScriptsChanged()
WorldScripts::reset
void reset()
Zero all script values.
Definition
worldscripts.cpp:98
WorldScripts::curScripts
var16 curScripts[scriptCount]
Per-map script-progress values.
Definition
worldscripts.h:60
WorldScripts::load
void load(SaveFile *saveFile=nullptr)
Expand the script values from the save.
Definition
worldscripts.cpp:37
WorldScripts::randomize
void randomize()
Randomize the script values.
Definition
worldscripts.cpp:105
WorldScripts::save
void save(SaveFile *saveFile)
Flatten the script values to the save.
Definition
worldscripts.cpp:63
WorldScripts::scriptsCount
int scriptsCount()
Number of script values (scriptCount).
Definition
worldscripts.cpp:82
WorldScripts::scriptsSet
void scriptsSet(int ind, int val)
Set the script value for ind.
Definition
worldscripts.cpp:92
WorldScripts::WorldScripts
WorldScripts(SaveFile *saveFile=nullptr)
Definition
worldscripts.cpp:30
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
var16
var16e var16
Everyday 16-bit alias. Exact width to avoid the "fastest" widening bug.
Definition
types.h:125
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
scriptCount
constexpr var8 scriptCount
Number of per-map script-progress values.
Definition
worldscripts.h:25
projects
savefile
src
pse-savefile
expanded
world
worldscripts.h
Generated by
1.17.0