mirror of
https://github.com/huderlem/porymap.git
synced 2026-06-22 07:39:48 -05:00
Fix map symbol editing regression, save new map/layout dialog geometry
This commit is contained in:
parent
cfb6f70580
commit
fe8f978a6b
|
|
@ -137,6 +137,8 @@ public:
|
|||
QVersionNumber lastUpdateCheckVersion;
|
||||
QMap<QUrl, QDateTime> rateLimitTimes;
|
||||
QByteArray wildMonChartGeometry;
|
||||
QByteArray newMapDialogGeometry;
|
||||
QByteArray newLayoutDialogGeometry;
|
||||
|
||||
protected:
|
||||
virtual QString getConfigFilepath() override;
|
||||
|
|
|
|||
|
|
@ -349,6 +349,10 @@ void PorymapConfig::parseConfigKeyValue(QString key, QString value) {
|
|||
this->customScriptsEditorState = bytesFromString(value);
|
||||
} else if (key == "wild_mon_chart_geometry") {
|
||||
this->wildMonChartGeometry = bytesFromString(value);
|
||||
} else if (key == "new_map_dialog_geometry") {
|
||||
this->newMapDialogGeometry = bytesFromString(value);
|
||||
} else if (key == "new_layout_dialog_geometry") {
|
||||
this->newLayoutDialogGeometry = bytesFromString(value);
|
||||
} else if (key == "metatiles_zoom") {
|
||||
this->metatilesZoom = getConfigInteger(key, value, 10, 100, 30);
|
||||
} else if (key == "collision_zoom") {
|
||||
|
|
@ -441,6 +445,8 @@ QMap<QString, QString> PorymapConfig::getKeyValueMap() {
|
|||
map.insert("custom_scripts_editor_geometry", stringFromByteArray(this->customScriptsEditorGeometry));
|
||||
map.insert("custom_scripts_editor_state", stringFromByteArray(this->customScriptsEditorState));
|
||||
map.insert("wild_mon_chart_geometry", stringFromByteArray(this->wildMonChartGeometry));
|
||||
map.insert("new_map_dialog_geometry", stringFromByteArray(this->newMapDialogGeometry));
|
||||
map.insert("new_layout_dialog_geometry", stringFromByteArray(this->newLayoutDialogGeometry));
|
||||
map.insert("mirror_connecting_maps", this->mirrorConnectingMaps ? "1" : "0");
|
||||
map.insert("show_dive_emerge_maps", this->showDiveEmergeMaps ? "1" : "0");
|
||||
map.insert("dive_emerge_map_opacity", QString::number(this->diveEmergeMapOpacity));
|
||||
|
|
|
|||
|
|
@ -104,7 +104,6 @@ QStandardItem *MapListModel::createMapItem(const QString &mapName, QStandardItem
|
|||
map->setData(mapName, MapListUserRoles::NameRole);
|
||||
map->setData("map_name", MapListUserRoles::TypeRole);
|
||||
map->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemNeverHasChildren);
|
||||
map->setEditable(this->editable); // Will override flags if necessary
|
||||
map->setToolTip(this->project->mapNamesToMapConstants.value(mapName));
|
||||
this->mapItems.insert(mapName, map);
|
||||
return map;
|
||||
|
|
|
|||
|
|
@ -42,11 +42,18 @@ NewLayoutDialog::NewLayoutDialog(Project *project, const Layout *layoutToCopy, Q
|
|||
connect(ui->buttonBox, &QDialogButtonBox::clicked, this, &NewLayoutDialog::dialogButtonClicked);
|
||||
|
||||
refresh();
|
||||
adjustSize();
|
||||
|
||||
if (porymapConfig.newLayoutDialogGeometry.isEmpty()){
|
||||
// On first display resize to fit contents a little better
|
||||
adjustSize();
|
||||
} else {
|
||||
restoreGeometry(porymapConfig.newLayoutDialogGeometry);
|
||||
}
|
||||
}
|
||||
|
||||
NewLayoutDialog::~NewLayoutDialog()
|
||||
{
|
||||
porymapConfig.newLayoutDialogGeometry = saveGeometry();
|
||||
saveSettings();
|
||||
delete ui;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ NewMapDialog::NewMapDialog(Project *project, const Map *mapToCopy, QWidget *pare
|
|||
connect(ui->buttonBox, &QDialogButtonBox::clicked, this, &NewMapDialog::dialogButtonClicked);
|
||||
|
||||
refresh();
|
||||
restoreGeometry(porymapConfig.newMapDialogGeometry);
|
||||
}
|
||||
|
||||
// Adding new map to an existing map list folder. Initialize settings accordingly.
|
||||
|
|
@ -91,6 +92,7 @@ NewMapDialog::NewMapDialog(Project *project, int mapListTab, const QString &mapL
|
|||
|
||||
NewMapDialog::~NewMapDialog()
|
||||
{
|
||||
porymapConfig.newMapDialogGeometry = saveGeometry();
|
||||
saveSettings();
|
||||
delete ui;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user