add json saving to wild encounter editor
This commit is contained in:
parent
4b0e0b0bff
commit
5a62df9f55
8 changed files with 309 additions and 66 deletions
|
@ -2701,17 +2701,79 @@
|
|||
<item>
|
||||
<widget class="QFrame" name="frame_WildMonInfo">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="tabWidget_WildMons">
|
||||
<property name="currentIndex">
|
||||
<number>-1</number>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Group</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox_EncounterGroupLabel">
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_NewWildMonGroup">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Create a new group for wild pokemon data on this map.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/images.qrc">
|
||||
<normaloff>:/icons/add.ico</normaloff>:/icons/add.ico</iconset>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_ConfigureEncountersJSON">
|
||||
<property name="text">
|
||||
<string>Configure JSON...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stackedWidget_WildMons">
|
||||
<widget class="QWidget" name="page"/>
|
||||
<widget class="QWidget" name="page_2"/>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
@ -43,6 +43,8 @@ public:
|
|||
void redo();
|
||||
void closeProject();
|
||||
bool setMap(QString map_name);
|
||||
void saveUiFields();
|
||||
void saveEncounterTabData();
|
||||
void displayMap();
|
||||
void displayMetatileSelector();
|
||||
void displayMapMetatiles();
|
||||
|
@ -71,6 +73,7 @@ public:
|
|||
void setConnectionMap(QString mapName);
|
||||
void addNewConnection();
|
||||
void removeCurrentConnection();
|
||||
void addNewWildMonGroup();
|
||||
void updateDiveMap(QString mapName);
|
||||
void updateEmergeMap(QString mapName);
|
||||
void setSelectedConnectionFromMap(QString mapName);
|
||||
|
@ -78,6 +81,7 @@ public:
|
|||
void updateSecondaryTileset(QString tilesetLabel, bool forceLoad = false);
|
||||
void toggleBorderVisibility(bool visible);
|
||||
void updateCustomMapHeaderValues(QTableWidget *);
|
||||
void configureEncounterJSON();
|
||||
Tileset *getCurrentMapPrimaryTileset();
|
||||
|
||||
DraggablePixmapItem *addMapEvent(Event *event);
|
||||
|
|
|
@ -145,6 +145,8 @@ private slots:
|
|||
void on_pushButton_DeleteCustomHeaderField_clicked();
|
||||
void on_tableWidget_CustomHeaderFields_cellChanged(int row, int column);
|
||||
void on_horizontalSlider_MetatileZoom_valueChanged(int value);
|
||||
void on_pushButton_NewWildMonGroup_clicked();
|
||||
void on_pushButton_ConfigureEncountersJSON_clicked();
|
||||
|
||||
void on_actionRegion_Map_Editor_triggered();
|
||||
|
||||
|
|
|
@ -87,8 +87,8 @@ public:
|
|||
QString readMapLocation(QString map_name);
|
||||
|
||||
void readWildMonData();
|
||||
QMap<QString, WildPokemonHeader> wildMonData;// "MAP_CONSTANT": wild_encounter_json
|
||||
QMap<QString, QString> encounterMapToBaseLabel;
|
||||
QMap<QString, QMap<QString, WildPokemonHeader>> wildMonData;// "MAP_CONSTANT": {base_label: wild_encounter_json
|
||||
QMap<QString, QString> encounterMapToBaseLabel;// delete this?
|
||||
// when saving, preserve the extra fields for gBattlePyramidWildMonHeaders, gBattlePikeWildMonHeaders
|
||||
void readSpeciesIconPaths();
|
||||
QMap<QString, QString> speciesToIconPath;
|
||||
|
|
|
@ -87,15 +87,19 @@ void createSpeciesTableRow(Project *project, QTableWidget *table, WildPokemon mo
|
|||
table->setCellWidget(index - 1, 2, minLevelFrame);
|
||||
table->setCellWidget(index - 1, 3, maxLevelFrame);
|
||||
table->setCellWidget(index - 1, 4, percentLabel);
|
||||
|
||||
// TODO: lock max spinbox to min spinbox
|
||||
}
|
||||
|
||||
void populateWildMonTabWidget(QTabWidget *tabWidget, QVector<QPair<QString, QVector<int>>> fields) {
|
||||
QPushButton *newTabButton = new QPushButton("Configure JSON...");
|
||||
QObject::connect(newTabButton, &QPushButton::clicked, [=](){
|
||||
// TODO
|
||||
qDebug() << "configure json pressed";
|
||||
});
|
||||
tabWidget->setCornerWidget(newTabButton);
|
||||
//QPushButton *newTabButton = new QPushButton("Configure JSON...");
|
||||
//QObject::connect(newTabButton, &QPushButton::clicked, [=](){
|
||||
// // TODO
|
||||
// qDebug() << "configure json pressed";
|
||||
//});
|
||||
//tabWidget->setCornerWidget(newTabButton);
|
||||
|
||||
// delete everything in the tab widget here? no
|
||||
|
||||
for (QPair<QString, QVector<int>> field : fields) {
|
||||
QTableWidget *table = new QTableWidget;
|
||||
|
|
193
src/editor.cpp
193
src/editor.cpp
|
@ -24,6 +24,7 @@ Editor::Editor(Ui::MainWindow* ui)
|
|||
|
||||
void Editor::saveProject() {
|
||||
if (project) {
|
||||
saveUiFields();
|
||||
project->saveAllMaps();
|
||||
project->saveAllDataStructures();
|
||||
}
|
||||
|
@ -31,11 +32,17 @@ void Editor::saveProject() {
|
|||
|
||||
void Editor::save() {
|
||||
if (project && map) {
|
||||
saveUiFields();
|
||||
project->saveMap(map);
|
||||
project->saveAllDataStructures();
|
||||
}
|
||||
}
|
||||
|
||||
void Editor::saveUiFields() {
|
||||
//
|
||||
saveEncounterTabData();
|
||||
}
|
||||
|
||||
void Editor::undo() {
|
||||
if (current_view && map_item->paintingEnabled) {
|
||||
map->undo();
|
||||
|
@ -154,60 +161,166 @@ void Editor::setEditingWildMons() {
|
|||
// nothing for now
|
||||
}
|
||||
|
||||
// TODO: figure out why this is being called twice
|
||||
void Editor::displayWildMonTables() {
|
||||
WildPokemonHeader header = project->wildMonData.value(map->constantName);
|
||||
QStackedWidget *stack = ui->stackedWidget_WildMons;
|
||||
QComboBox *labelCombo = ui->comboBox_EncounterGroupLabel;
|
||||
// TODO: temp. instead do a for loop here
|
||||
//WildPokemonHeader header = project->wildMonData.value(map->constantName).first();
|
||||
|
||||
int tabIndex = 0;
|
||||
for (QPair<QString, QVector<int>> monField : project->wildMonFields) {
|
||||
QString field = monField.first;
|
||||
QTableWidget *speciesTable = static_cast<QTableWidget *>(ui->tabWidget_WildMons->widget(tabIndex++));
|
||||
clearTable(speciesTable);
|
||||
//speciesTable->horizontalHeader()->hide();
|
||||
// TODO: return when there is no data for the map
|
||||
while (stack->count()) {
|
||||
//
|
||||
QWidget *oldWidget = stack->widget(0);
|
||||
stack->removeWidget(oldWidget);
|
||||
delete oldWidget;
|
||||
}
|
||||
|
||||
if (project->wildMonData.contains(map->constantName) && header.wildMons[field].active) {
|
||||
int i = 1;
|
||||
labelCombo->clear();
|
||||
|
||||
speciesTable->setRowCount(header.wildMons[field].wildPokemon.size());
|
||||
speciesTable->setColumnCount(6);// TODO: stretch last column?
|
||||
if (!project->wildMonData.contains(map->constantName)) {
|
||||
return;
|
||||
}
|
||||
|
||||
QStringList landMonTableHeaders;
|
||||
landMonTableHeaders << "Index" << "Species" << "Min Level" << "Max Level" << "Index Percentage" << "Encounter Rate";
|
||||
speciesTable->setHorizontalHeaderLabels(landMonTableHeaders);
|
||||
speciesTable->horizontalHeader()->show();
|
||||
speciesTable->verticalHeader()->hide();
|
||||
speciesTable->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
speciesTable->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
// do I have to disconnect this signal? or set it up only once?
|
||||
connect(labelCombo, QOverload<int>::of(&QComboBox::activated), [=](int index){
|
||||
stack->setCurrentIndex(index);//setCurrentWidget(tabWidget);
|
||||
});
|
||||
labelCombo->addItems(project->wildMonData[map->constantName].keys());
|
||||
labelCombo->setCurrentText(project->wildMonData[map->constantName].firstKey());
|
||||
|
||||
speciesTable->setShowGrid(false);
|
||||
// TODO: instance of this map, use .value()
|
||||
for (int labelIndex = 0; labelIndex < project->wildMonData[map->constantName].keys().size(); labelIndex++) {
|
||||
|
||||
// set encounter rate slider
|
||||
// don't forget to add number label next to it
|
||||
QFrame *encounterFrame = new QFrame;
|
||||
QHBoxLayout *encounterLayout = new QHBoxLayout;
|
||||
QString label = project->wildMonData.value(map->constantName).keys().at(labelIndex);
|
||||
|
||||
QSlider *encounterRate = new QSlider(Qt::Horizontal);
|
||||
encounterRate->setMinimum(1);
|
||||
encounterRate->setMaximum(100);
|
||||
WildPokemonHeader header = project->wildMonData.value(map->constantName).value(label);
|
||||
|
||||
QLabel *encounterLabel = new QLabel;
|
||||
connect(encounterRate, &QSlider::valueChanged, [=](int value){
|
||||
encounterLabel->setText(QString::number(value));
|
||||
});
|
||||
encounterRate->setValue(header.wildMons[field].encounterRate);
|
||||
//QTableWidget *speciesTable = new QTableWidget;
|
||||
//clearTable(speciesTable);
|
||||
QTabWidget *tabWidget = new QTabWidget;
|
||||
stack->insertWidget(labelIndex, tabWidget);
|
||||
populateWildMonTabWidget(tabWidget, project->wildMonFields);
|
||||
//stack->setCurrentWidget(tabWidget);
|
||||
|
||||
encounterLayout->addWidget(encounterLabel);
|
||||
encounterLayout->addWidget(encounterRate);
|
||||
int tabIndex = 0;
|
||||
for (QPair<QString, QVector<int>> monField : project->wildMonFields) {
|
||||
QString field = monField.first;
|
||||
|
||||
encounterFrame->setLayout(encounterLayout);
|
||||
// tabWidget_WildMons
|
||||
QTableWidget *speciesTable = static_cast<QTableWidget *>(tabWidget->widget(tabIndex++));//static_cast<QTableWidget *>(ui->tabWidget_WildMons->widget(tabIndex++));
|
||||
clearTable(speciesTable);
|
||||
//speciesTable->horizontalHeader()->hide();
|
||||
|
||||
speciesTable->setCellWidget(0, 5, encounterFrame);
|
||||
if (project->wildMonData.contains(map->constantName) && header.wildMons[field].active) {
|
||||
int i = 1;
|
||||
|
||||
for (WildPokemon mon : header.wildMons[field].wildPokemon) {
|
||||
createSpeciesTableRow(project, speciesTable, mon, i, field);
|
||||
i++;
|
||||
//ui->stackedWidget_WildMons->insertWidget(0, speciesTable);
|
||||
//return;
|
||||
|
||||
speciesTable->setRowCount(header.wildMons[field].wildPokemon.size());
|
||||
speciesTable->setColumnCount(6);// TODO: stretch last column?
|
||||
|
||||
QStringList landMonTableHeaders;
|
||||
landMonTableHeaders << "Index" << "Species" << "Min Level" << "Max Level" << "Index Percentage" << "Encounter Rate";
|
||||
speciesTable->setHorizontalHeaderLabels(landMonTableHeaders);
|
||||
speciesTable->horizontalHeader()->show();
|
||||
speciesTable->verticalHeader()->hide();
|
||||
speciesTable->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
speciesTable->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
|
||||
speciesTable->setShowGrid(false);
|
||||
|
||||
// set encounter rate slider
|
||||
// don't forget to add number label next to it
|
||||
QFrame *encounterFrame = new QFrame;
|
||||
QHBoxLayout *encounterLayout = new QHBoxLayout;
|
||||
|
||||
QSlider *encounterRate = new QSlider(Qt::Horizontal);
|
||||
encounterRate->setMinimum(1);
|
||||
encounterRate->setMaximum(100);
|
||||
|
||||
QLabel *encounterLabel = new QLabel;
|
||||
connect(encounterRate, &QSlider::valueChanged, [=](int value){
|
||||
encounterLabel->setText(QString::number(value));
|
||||
});
|
||||
encounterRate->setValue(header.wildMons[field].encounterRate);
|
||||
|
||||
encounterLayout->addWidget(encounterLabel);
|
||||
encounterLayout->addWidget(encounterRate);
|
||||
|
||||
encounterFrame->setLayout(encounterLayout);
|
||||
|
||||
speciesTable->setCellWidget(0, 5, encounterFrame);
|
||||
|
||||
for (WildPokemon mon : header.wildMons[field].wildPokemon) {
|
||||
createSpeciesTableRow(project, speciesTable, mon, i, field);
|
||||
i++;
|
||||
}
|
||||
} else {
|
||||
// create button to add this field to this map
|
||||
}
|
||||
} else {
|
||||
// create button to add this field to this map
|
||||
}
|
||||
}
|
||||
stack->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
// TODO: move this funciton
|
||||
void Editor::addNewWildMonGroup() {
|
||||
//
|
||||
qDebug() << "new wild encounter group to map" << map->name;
|
||||
}
|
||||
|
||||
void Editor::configureEncounterJSON() {
|
||||
//
|
||||
qDebug() << "configure wild encounter json";
|
||||
}
|
||||
|
||||
// TODO: move this?
|
||||
void Editor::saveEncounterTabData() {
|
||||
if (!project->wildMonData.contains(map->constantName)) {
|
||||
qDebug() << "don't save encounters for this map";
|
||||
return;
|
||||
}
|
||||
//
|
||||
QStackedWidget *stack = ui->stackedWidget_WildMons;
|
||||
QComboBox *labelCombo = ui->comboBox_EncounterGroupLabel;
|
||||
|
||||
// TODO: verify that this exists before accsessing so no seg fault
|
||||
QMap<QString, WildPokemonHeader> &encounterMap = project->wildMonData[map->constantName];
|
||||
|
||||
for (int groupIndex = 0; groupIndex < encounterMap.keys().size(); groupIndex++) {
|
||||
//
|
||||
QTabWidget *tabWidget = static_cast<QTabWidget *>(stack->widget(groupIndex));
|
||||
|
||||
// TODO: verify this exists before so no segfault
|
||||
WildPokemonHeader &encounterHeader = encounterMap[labelCombo->itemText(groupIndex)];
|
||||
|
||||
//qDebug() << encounterHeader.wildMons.keys();
|
||||
|
||||
//for (int tabIndex = 0; tabIndex < tabWidget->count(); tabIndex++) {
|
||||
// QTableWidget *monTable =
|
||||
//}
|
||||
int fieldIndex = 0;
|
||||
for (QPair<QString, QVector<int>> monField : project->wildMonFields) {
|
||||
// project->wildMonData
|
||||
//qDebug() << monField.first << "mons";
|
||||
QTableWidget *monTable = static_cast<QTableWidget *>(tabWidget->widget(fieldIndex++));
|
||||
|
||||
QVector<WildPokemon> newWildMons;
|
||||
|
||||
//for (auto *speciesCombo : monTable->findChildren<QComboBox *>()) {
|
||||
for (int row = 0; row < monTable->rowCount(); row++) {
|
||||
// cellWidget(row, column)
|
||||
WildPokemon newWildMon;
|
||||
newWildMon.species = monTable->cellWidget(row, 1)->findChild<QComboBox *>()->currentText();
|
||||
newWildMon.minLevel = monTable->cellWidget(row, 2)->findChild<QSpinBox *>()->value();//static_cast<QSpinBox *>(monTable->cellWidget(row, 2))->value();
|
||||
newWildMon.maxLevel = monTable->cellWidget(row, 3)->findChild<QSpinBox *>()->value();//static_cast<QSpinBox *>(monTable->cellWidget(row, 3))->value();
|
||||
newWildMons.append(newWildMon);//(speciesCombo->currentText());
|
||||
}
|
||||
encounterHeader.wildMons[monField.first].wildPokemon = newWildMons;
|
||||
encounterHeader.wildMons[monField.first].encounterRate = monTable->findChild<QSlider *>()->value();
|
||||
//fieldIndex++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -261,13 +261,13 @@ bool MainWindow::openProject(QString dir) {
|
|||
setWindowTitle(editor->project->getProjectTitle());
|
||||
loadDataStructures();
|
||||
populateMapList();
|
||||
populateWildMonTabWidget(ui->tabWidget_WildMons, editor->project->wildMonFields);
|
||||
//populateWildMonTabWidget(ui->tabWidget_WildMons, editor->project->wildMonFields);
|
||||
success = setMap(getDefaultMap(), true);
|
||||
} else {
|
||||
setWindowTitle(editor->project->getProjectTitle());
|
||||
loadDataStructures();
|
||||
populateMapList();
|
||||
populateWildMonTabWidget(ui->tabWidget_WildMons, editor->project->wildMonFields);
|
||||
//populateWildMonTabWidget(ui->tabWidget_WildMons, editor->project->wildMonFields);
|
||||
}
|
||||
|
||||
if (success) {
|
||||
|
@ -1967,6 +1967,16 @@ void MainWindow::on_pushButton_RemoveConnection_clicked()
|
|||
editor->removeCurrentConnection();
|
||||
}
|
||||
|
||||
void MainWindow::on_pushButton_NewWildMonGroup_clicked() {
|
||||
//
|
||||
editor->addNewWildMonGroup();
|
||||
}
|
||||
|
||||
void MainWindow::on_pushButton_ConfigureEncountersJSON_clicked() {
|
||||
//
|
||||
editor->configureEncounterJSON();
|
||||
}
|
||||
|
||||
void MainWindow::on_comboBox_DiveMap_activated(const QString &mapName)
|
||||
{
|
||||
editor->updateDiveMap(mapName);
|
||||
|
|
|
@ -522,8 +522,8 @@ void Project::saveMapGroups() {
|
|||
|
||||
void Project::saveWildMonData() {
|
||||
//
|
||||
//QString wildEncountersJsonFilepath = QString("%1/src/data/wild_encounters.json").arg(root);
|
||||
QString wildEncountersJsonFilepath = QString("%1/src/data/wild_encounters_test.json").arg(root);
|
||||
QString wildEncountersJsonFilepath = QString("%1/src/data/wild_encounters.json").arg(root);
|
||||
//QString wildEncountersJsonFilepath = QString("%1/src/data/wild_encounters_test.json").arg(root);
|
||||
QFile wildEncountersFile(wildEncountersJsonFilepath);
|
||||
if (!wildEncountersFile.open(QIODevice::WriteOnly)) {
|
||||
logError(QString("Error: Could not open %1 for writing").arg(wildEncountersJsonFilepath));
|
||||
|
@ -537,15 +537,60 @@ void Project::saveWildMonData() {
|
|||
QJsonObject monHeadersObject;
|
||||
monHeadersObject["label"] = "gWildMonHeaders";
|
||||
monHeadersObject["for_maps"] = true;
|
||||
|
||||
QJsonArray fieldsInfoArray;
|
||||
for (QPair<QString, QVector<int>> fieldInfo : wildMonFields) {
|
||||
QJsonObject fieldObject;
|
||||
QJsonArray rateArray;
|
||||
|
||||
for (int rate : fieldInfo.second)
|
||||
rateArray.append(rate);
|
||||
|
||||
fieldObject["type"] = fieldInfo.first;
|
||||
fieldObject["encounter_rates"] = rateArray;
|
||||
|
||||
fieldsInfoArray.append(fieldObject);
|
||||
}
|
||||
monHeadersObject["fields"] = fieldsInfoArray;
|
||||
|
||||
QJsonArray encountersArray = QJsonArray();
|
||||
for (QString key : wildMonData.keys()) {
|
||||
QJsonObject encounterObject;
|
||||
encounterObject["map"] = key;
|
||||
encounterObject["base_label"] = encounterMapToBaseLabel[key];
|
||||
//
|
||||
//text += key + "\n";
|
||||
// ["base_label"] = encounterMapToBaseLabel[mapConstant]
|
||||
encountersArray.append(encounterObject);
|
||||
for (QString groupLabel : wildMonData.value(key).keys()) {
|
||||
QJsonObject encounterObject;
|
||||
encounterObject["map"] = key;
|
||||
encounterObject["base_label"] = groupLabel;//encounterMapToBaseLabel[key];
|
||||
//
|
||||
|
||||
WildPokemonHeader encounterHeader = wildMonData.value(key).value(groupLabel);
|
||||
for (QString fieldName : encounterHeader.wildMons.keys()) {
|
||||
//
|
||||
QJsonObject fieldObject;
|
||||
WildMonInfo monInfo = encounterHeader.wildMons.value(fieldName);
|
||||
fieldObject["encounter_rate"] = monInfo.encounterRate;
|
||||
QJsonArray monArray;
|
||||
for (WildPokemon wildMon : monInfo.wildPokemon) {
|
||||
//
|
||||
QJsonObject monEntry;
|
||||
monEntry["min_level"] = wildMon.minLevel;
|
||||
monEntry["max_level"] = wildMon.maxLevel;
|
||||
monEntry["species"] = wildMon.species;
|
||||
monArray.append(monEntry);
|
||||
}
|
||||
fieldObject["mons"] = monArray;//fieldObject;
|
||||
encounterObject[fieldName] = fieldObject;
|
||||
}
|
||||
//encounterObject[];
|
||||
// QMap<QString, WildMonInfo> wildMons;
|
||||
|
||||
//QJsonArray
|
||||
//for (auto fieldItem : wildMonFields) {
|
||||
// QString fieldLabel = fieldItem.first;
|
||||
// encounterObject[fieldLabel] = ;
|
||||
//}
|
||||
|
||||
encountersArray.append(encounterObject);
|
||||
}
|
||||
// TODO: save fields json data
|
||||
}
|
||||
monHeadersObject["encounters"] = encountersArray;
|
||||
wildEncounterGroups.append(monHeadersObject);
|
||||
|
@ -1397,7 +1442,10 @@ void Project::readWildMonData() {
|
|||
}
|
||||
}
|
||||
}
|
||||
wildMonData.insert(mapConstant, header);
|
||||
//if (!wildMonData.contains(mapConstant))
|
||||
// wildMonData.insert(mapConstant, header);
|
||||
//else
|
||||
wildMonData[mapConstant].insert(encounter["base_label"].toString(), header);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue