1
0
forked from 0ad/0ad

Inherit comment of previous save when overwriting.

Reported by: @allalongthetower at
https://wildfiregames.com/forum/topic/64768-save-game-name-erasing/
Patch by: @nwtour
Differential revision: https://code.wildfiregames.com/D4372
Comments by: @Silier, @Stan
This was SVN commit r26088.
This commit is contained in:
Freagarach 2021-12-21 06:07:48 +00:00
parent bc461838ee
commit a8c6d7a82b

View File

@ -19,11 +19,17 @@ class SavegameWriter
this.saveGameDesc = Engine.GetGUIObjectByName("saveGameDesc");
this.saveGameDesc.hidden = false;
this.saveGameDesc.onPress = saveNew;
this.descriptionChanged = false;
this.saveGameDesc.onTextEdit = () => {
this.descriptionChanged = true;
};
}
onSelectionChange(gameID, metadata, label)
{
this.confirmButton.enabled = !!metadata || Engine.IsGameStarted();
if (!this.descriptionChanged && typeof metadata.description === "string")
this.saveGameDesc.caption = metadata.description;
this.confirmButton.onPress = () => {
this.saveGame(gameID, label);
};