Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
missabledbentry.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 <QJsonValue>
19
#include <QString>
20
#include <QHash>
21
22
#include "
../db_autoport.h
"
23
24
struct
MapDBEntry
;
25
struct
MapDBEntrySprite
;
26
class
QQmlEngine;
27
class
MissablesDB
;
28
29
// With amazing help of Quicktype!!!
30
// https://app.quicktype.io
31
32
// Missable flags set in-game, a missable is simply a script and/or sprite
33
// that never loads (Is surpressed). Allows the game to hide things you
34
// shouldn't see or encounter yet or show a new map "state" after you progressed
35
// in the games.
36
37
// The starter you and your rival pick are both missable activated and the
38
// guy blocking the path in Pewter City is a missable that's hiden once you beat
39
// Brock.
40
51
struct
DB_AUTOPORT
MissableDBEntry
:
public
QObject {
52
Q_OBJECT
53
Q_PROPERTY(QString
getName
READ
getName
CONSTANT)
54
Q_PROPERTY(
int
getInd
READ
getInd
CONSTANT)
55
Q_PROPERTY(QString
getMap
READ
getMap
CONSTANT)
56
Q_PROPERTY(
int
getSprite
READ
getSprite
CONSTANT)
57
Q_PROPERTY(
bool
getDefShow
READ
getDefShow
CONSTANT)
58
Q_PROPERTY(
MapDBEntry
*
getToMap
READ
getToMap
CONSTANT)
59
Q_PROPERTY(
MapDBEntrySprite
*
getToMapSprite
READ
getToMapSprite
CONSTANT)
60
61
public
:
62
const
QString
getName
()
const
;
63
int
getInd
()
const
;
64
const
QString
getMap
()
const
;
65
int
getSprite
()
const
;
66
bool
getDefShow
()
const
;
67
MapDBEntry
*
getToMap
()
const
;
68
MapDBEntrySprite
*
getToMapSprite
()
const
;
69
70
public
slots:
71
void
qmlProtect
(
const
QQmlEngine*
const
engine)
const
;
72
73
protected
:
74
MissableDBEntry
();
75
MissableDBEntry
(QJsonValue& data);
76
void
deepLink
();
77
void
qmlRegister
()
const
;
78
79
// Missable Name & Index
80
QString
name
=
""
;
81
int
ind
= 0;
82
83
// Map & Sprite on map Missable References
84
QString
map
=
""
;
85
int
sprite
= 0;
86
87
// Is this missable shown or hidden by default
88
bool
defShow
=
false
;
89
90
// Deep link to associated map and sprite on map
91
// There are 2 exceptions to this
92
// * There's one missable that references a sprite on an incomplete map with
93
// no sprites
94
// * There's one missable that references an extra sprite which isn't there
95
//
96
// In both cases one or both of these will be nullptr
97
MapDBEntry
*
toMap
=
nullptr
;
98
MapDBEntrySprite
*
toMapSprite
=
nullptr
;
99
100
friend
class
MissablesDB
;
101
};
MissablesDB
The missables database – metadata for the missable-sprite flags, keyed by name.
Definition
missablesdb.h:36
db_autoport.h
Import/export macro for the db library, plus the central list of DB entry pointer types declared opaq...
DB_AUTOPORT
#define DB_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
Definition
db_autoport.h:37
MapDBEntrySprite
A map's sprite definition – base class for the four sprite kinds.
Definition
mapdbentrysprite.h:44
MapDBEntry
One map's complete static definition – the root of the MapDBEntry family.
Definition
mapdbentry.h:56
MissableDBEntry::MissableDBEntry
MissableDBEntry()
Empty entry (built by MissablesDB).
Definition
missabledbentry.cpp:35
MissableDBEntry::toMap
MapDBEntry * toMap
Resolved map (may be null; see note above).
Definition
missabledbentry.h:97
MissableDBEntry::deepLink
void deepLink()
Resolve the map + map-sprite links.
Definition
missabledbentry.cpp:50
MissableDBEntry::getSprite
int getSprite() const
Definition
missabledbentry.cpp:113
MissableDBEntry::defShow
bool defShow
Backing field (read via getDefShow()).
Definition
missabledbentry.h:88
MissableDBEntry::name
QString name
Backing field (read via getName()).
Definition
missabledbentry.h:80
MissableDBEntry::qmlRegister
void qmlRegister() const
Register with QML.
Definition
missabledbentry.cpp:82
MissableDBEntry::getToMap
MapDBEntry * getToMap() const
Definition
missabledbentry.cpp:103
MissableDBEntry::getName
const QString getName() const
< Missable name.
Definition
missabledbentry.cpp:128
MissableDBEntry::getDefShow
bool getDefShow() const
Definition
missabledbentry.cpp:108
MissableDBEntry::sprite
int sprite
Backing field (read via getSprite()).
Definition
missabledbentry.h:85
MissableDBEntry::ind
int ind
Backing field (read via getInd()).
Definition
missabledbentry.h:81
MissableDBEntry::MissablesDB
friend class MissablesDB
Owning DB constructs/populates entries.
Definition
missabledbentry.h:100
MissableDBEntry::getInd
int getInd() const
Definition
missabledbentry.cpp:123
MissableDBEntry::map
QString map
Backing field (read via getMap()).
Definition
missabledbentry.h:84
MissableDBEntry::getMap
const QString getMap() const
Definition
missabledbentry.cpp:118
MissableDBEntry::getToMapSprite
MapDBEntrySprite * getToMapSprite() const
Definition
missabledbentry.cpp:93
MissableDBEntry::qmlProtect
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
Definition
missabledbentry.cpp:98
MissableDBEntry::toMapSprite
MapDBEntrySprite * toMapSprite
Resolved map sprite (may be null; see note above).
Definition
missabledbentry.h:98
projects
db
src
pse-db
entries
missabledbentry.h
Generated by
1.17.0