Read/write MAPSEC values using the region map json

This commit is contained in:
GriffinR
2024-11-04 21:49:49 -05:00
parent 7d89031273
commit d448765d63
18 changed files with 143 additions and 241 deletions

View File

@@ -57,8 +57,8 @@ public:
bool loadLayout(poryjson::Json);
bool loadEntries();
void setEntries(tsl::ordered_map<QString, MapSectionEntry> *entries) { this->region_map_entries = entries; }
void setEntries(tsl::ordered_map<QString, MapSectionEntry> entries) { *(this->region_map_entries) = entries; }
void setEntries(QMap<QString, MapSectionEntry> *entries) { this->region_map_entries = entries; }
void setEntries(const QMap<QString, MapSectionEntry> &entries) { *(this->region_map_entries) = entries; }
void clearEntries() { this->region_map_entries->clear(); }
MapSectionEntry getEntry(QString section);
void setEntry(QString section, MapSectionEntry entry);
@@ -114,8 +114,6 @@ public:
void setLayer(QString layer) { this->current_layer = layer; }
QString getLayer() { return this->current_layer; }
QString fixCase(QString);
int padLeft() { return this->offset_left; }
int padTop() { return this->offset_top; }
int padRight() { return this->tilemap_width - this->layout_width - this->offset_left; }
@@ -149,14 +147,12 @@ public:
const QString section_prefix;
const QString default_map_section;
const QString count_map_section;
signals:
void mapNeedsDisplaying();
private:
// TODO: defaults needed?
tsl::ordered_map<QString, MapSectionEntry> *region_map_entries = nullptr;
QMap<QString, MapSectionEntry> *region_map_entries = nullptr;
QString alias = "";

View File

@@ -153,7 +153,7 @@ private:
/// ClearEntries
class ClearEntries : public QUndoCommand {
public:
ClearEntries(RegionMap *map, tsl::ordered_map<QString, MapSectionEntry>, QUndoCommand *parent = nullptr);
ClearEntries(RegionMap *map, QMap<QString, MapSectionEntry>, QUndoCommand *parent = nullptr);
void undo() override;
void redo() override;
@@ -163,7 +163,7 @@ public:
private:
RegionMap *map;
tsl::ordered_map<QString, MapSectionEntry> entries;
QMap<QString, MapSectionEntry> entries;
};
#endif // REGIONMAPEDITCOMMANDS_H

View File

@@ -8,7 +8,7 @@
struct WildPokemon {
int minLevel = 5;
int maxLevel = 5;
QString species = "SPECIES_NONE";
QString species = "SPECIES_NONE"; // TODO: Use define_species_prefix
};
struct WildMonInfo {