Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/loadgame/SavegameWriter.js
Show All 13 Lines | constructor(savedGameData) | ||||
this.confirmButton = Engine.GetGUIObjectByName("confirmButton"); | this.confirmButton = Engine.GetGUIObjectByName("confirmButton"); | ||||
this.confirmButton.caption = translate("Save"); | this.confirmButton.caption = translate("Save"); | ||||
this.confirmButton.onPress = saveNew; | this.confirmButton.onPress = saveNew; | ||||
this.saveGameDesc = Engine.GetGUIObjectByName("saveGameDesc"); | this.saveGameDesc = Engine.GetGUIObjectByName("saveGameDesc"); | ||||
this.saveGameDesc.hidden = false; | this.saveGameDesc.hidden = false; | ||||
this.saveGameDesc.onPress = saveNew; | this.saveGameDesc.onPress = saveNew; | ||||
this.descriptionChanged = false; | |||||
this.saveGameDesc.onTextEdit = () => { | |||||
this.descriptionChanged = true; | |||||
}; | |||||
} | } | ||||
onSelectionChange(gameID, metadata, label) | onSelectionChange(gameID, metadata, label) | ||||
{ | { | ||||
this.confirmButton.enabled = !!metadata || Engine.IsGameStarted(); | this.confirmButton.enabled = !!metadata || Engine.IsGameStarted(); | ||||
if (!this.descriptionChanged && typeof metadata.description === "string") | |||||
this.saveGameDesc.caption = metadata.description; | |||||
this.confirmButton.onPress = () => { | this.confirmButton.onPress = () => { | ||||
this.saveGame(gameID, label); | this.saveGame(gameID, label); | ||||
}; | }; | ||||
} | } | ||||
saveGame(gameID, label) | saveGame(gameID, label) | ||||
{ | { | ||||
let desc = this.saveGameDesc.caption; | let desc = this.saveGameDesc.caption; | ||||
Show All 31 Lines |
Wildfire Games · Phabricator