Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
SignData Class Reference

One sign on the current map: its tile position and text id. More...

#include <signdata.h>

Inheritance diagram for SignData:
Collaboration diagram for SignData:

Public Member Functions

 SignData (SaveFile *saveFile=nullptr, var8 index=0)
 < Sign tile X.
virtual ~SignData ()
void load (SaveFile *saveFile=nullptr, var8 index=0)
 Expand sign index from the save.
void save (SaveFile *saveFile, var8 index)
 Flatten sign index to the save.
protected::void xChanged ()
void yChanged ()
void txtIdChanged ()
void reset ()
 Blank this sign.
void randomize (QVector< TmpSignPos * > *tmpPos=nullptr)
 Randomize position (avoiding tmpPos clashes).
void setTo (MapDBEntrySign *signData)
 Copy values from a map-defined sign.

Static Public Member Functions

static QVector< SignData * > randomizeAll (QVector< MapDBEntrySign * > mapSigns)
 Randomize a whole map's signs.
static QVector< SignData * > setToAll (QVector< MapDBEntrySign * > mapSigns)
 Build signs from a map's sign list.

Public Attributes

int x
int y
int txtId

Detailed Description

One sign on the current map: its tile position and text id.

A small leaf in the area's sign list. Holds the sign's x / y tile coordinates and the txtId that selects which message it shows. Can be populated from map DB data (setTo / setToAll) or randomized, with ...All static helpers that operate over a whole map's worth of signs at once.

See also
AreaSign (the container), MapDBEntrySign (map-defined sign data).

Definition at line 36 of file signdata.h.

Constructor & Destructor Documentation

◆ SignData()

SignData::SignData ( SaveFile * saveFile = nullptr,
var8 index = 0 )

< Sign tile X.

Sign tile Y. Text id shown when read.

Definition at line 35 of file signdata.cpp.

References load().

Referenced by randomizeAll(), and setToAll().

◆ ~SignData()

SignData::~SignData ( )
virtual

Definition at line 40 of file signdata.cpp.

Member Function Documentation

◆ load()

void SignData::load ( SaveFile * saveFile = nullptr,
var8 index = 0 )

Expand sign index from the save.

Definition at line 42 of file signdata.cpp.

References SaveFile::iterator(), SaveFileIterator::offsetTo(), reset(), txtId, txtIdChanged(), x, xChanged(), y, and yChanged().

Referenced by SignData().

◆ randomize()

void SignData::randomize ( QVector< TmpSignPos * > * tmpPos = nullptr)

Randomize position (avoiding tmpPos clashes).

Definition at line 151 of file signdata.cpp.

References Random::inst(), Random::rangeExclusive(), x, xChanged(), y, and yChanged().

Referenced by txtIdChanged().

◆ randomizeAll()

QVector< SignData * > SignData::randomizeAll ( QVector< MapDBEntrySign * > mapSigns)
static

Randomize a whole map's signs.

Definition at line 87 of file signdata.cpp.

References SignData(), and TmpSignPos::x.

Referenced by AreaSign::randomize(), and txtIdChanged().

◆ reset()

void SignData::reset ( )

Blank this sign.

Definition at line 75 of file signdata.cpp.

References txtId, txtIdChanged(), x, xChanged(), y, and yChanged().

Referenced by load(), setTo(), and txtIdChanged().

◆ save()

void SignData::save ( SaveFile * saveFile,
var8 index )

Flatten sign index to the save.

Definition at line 63 of file signdata.cpp.

References SaveFile::iterator(), SaveFileIterator::offsetTo(), SaveFileIterator::setByte(), txtId, x, and y.

◆ setTo()

void SignData::setTo ( MapDBEntrySign * signData)

Copy values from a map-defined sign.

Definition at line 118 of file signdata.cpp.

References MapDBEntrySign::getTextID(), MapDBEntrySign::getX(), MapDBEntrySign::getY(), reset(), txtId, txtIdChanged(), x, xChanged(), y, and yChanged().

Referenced by txtIdChanged().

◆ setToAll()

QVector< SignData * > SignData::setToAll ( QVector< MapDBEntrySign * > mapSigns)
static

Build signs from a map's sign list.

Definition at line 135 of file signdata.cpp.

References SignData().

Referenced by AreaSign::setTo(), and txtIdChanged().

◆ txtIdChanged()

void SignData::txtIdChanged ( )

References randomize(), randomizeAll(), reset(), setTo(), and setToAll().

Referenced by load(), reset(), and setTo().

◆ xChanged()

protected::void SignData::xChanged ( )

Referenced by load(), randomize(), reset(), and setTo().

◆ yChanged()

void SignData::yChanged ( )

Referenced by load(), randomize(), reset(), and setTo().

Member Data Documentation

◆ txtId

int SignData::txtId
See also
txtId property.

Definition at line 67 of file signdata.h.

Referenced by load(), reset(), save(), and setTo().

◆ x

int SignData::x
See also
x property.

Definition at line 65 of file signdata.h.

Referenced by load(), randomize(), reset(), save(), and setTo().

◆ y

int SignData::y
See also
y property.

Definition at line 66 of file signdata.h.

Referenced by load(), randomize(), reset(), save(), and setTo().


The documentation for this class was generated from the following files:
  • projects/savefile/src/pse-savefile/expanded/fragments/signdata.h
  • projects/savefile/src/pse-savefile/expanded/fragments/signdata.cpp