Add in-game reload message

This commit is contained in:
GriffinR 2025-02-19 11:39:45 -05:00
parent 43d5e32b96
commit 1ab8b830d8
3 changed files with 14 additions and 0 deletions

View File

@ -87,6 +87,7 @@ public:
this->lastUpdateCheckVersion = porymapVersion;
this->rateLimitTimes.clear();
this->eventSelectionShapeMode = QGraphicsPixmapItem::MaskShape;
this->shownInGameReloadMessage = false;
}
void addRecentProject(QString project);
void setRecentProjects(QStringList projects);
@ -146,6 +147,7 @@ public:
QByteArray wildMonChartGeometry;
QByteArray newMapDialogGeometry;
QByteArray newLayoutDialogGeometry;
bool shownInGameReloadMessage;
protected:
virtual QString getConfigFilepath() override;

View File

@ -422,6 +422,8 @@ void PorymapConfig::parseConfigKeyValue(QString key, QString value) {
} else {
logWarn(QString("Invalid config value for %1: '%2'. Must be 'mask' or 'bounding_rect'.").arg(key).arg(value));
}
} else if (key == "shown_in_game_reload_message") {
this->shownInGameReloadMessage = getConfigBool(key, value);
} else {
logWarn(QString("Invalid config key found in config file %1: '%2'").arg(this->getConfigFilepath()).arg(key));
}
@ -492,6 +494,7 @@ QMap<QString, QString> PorymapConfig::getKeyValueMap() {
map.insert("rate_limit_time/" + i.key().toString(), time.toUTC().toString());
}
map.insert("event_selection_shape_mode", (this->eventSelectionShapeMode == QGraphicsPixmapItem::MaskShape) ? "mask" : "bounding_rect");
map.insert("shown_in_game_reload_message", this->shownInGameReloadMessage ? "1" : "0");
return map;
}

View File

@ -1565,6 +1565,15 @@ void MainWindow::save(bool currentOnly) {
}
updateWindowTitle();
updateMapList();
if (!porymapConfig.shownInGameReloadMessage) {
// Show a one-time warning that the user may need to reload their map to see their new changes.
static const QString message = QStringLiteral("Reload your map in-game!\n\nIf your game is currently saved on a map you have edited, "
"the changes may not appear until you leave the map and return.");
InfoMessage::show(message, this);
porymapConfig.shownInGameReloadMessage = true;
}
saveGlobalConfigs();
}