[Scummvm-git-logs] scummvm master -> 7d0dd6cab77fe9942a5cbcdffd7f38ae5e9aa42e

antoniou79 noreply at scummvm.org
Mon Jan 17 20:50:49 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7d0dd6cab7 BLADERUNNER: Don't allow empty save name from KIA


Commit: 7d0dd6cab77fe9942a5cbcdffd7f38ae5e9aa42e
    https://github.com/scummvm/scummvm/commit/7d0dd6cab77fe9942a5cbcdffd7f38ae5e9aa42e
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2022-01-17T22:48:36+02:00

Commit Message:
BLADERUNNER: Don't allow empty save name from KIA

Made behavior similar to original game

Also the original game on attempting to overwrite a saved game with empty game, shows the confirmation dialogue if the player clicks on the save icon, but then returns back to the normal save screen even if the user clicks on the OK button or presses the Enter key.

Changed paths:
    engines/bladerunner/ui/kia_section_save.cpp


diff --git a/engines/bladerunner/ui/kia_section_save.cpp b/engines/bladerunner/ui/kia_section_save.cpp
index fc823a01b41..ae738b4c788 100644
--- a/engines/bladerunner/ui/kia_section_save.cpp
+++ b/engines/bladerunner/ui/kia_section_save.cpp
@@ -334,6 +334,7 @@ void KIASectionSave::onButtonPressed(int buttonId, void *callbackData) {
 	} else if (buttonId == 2) {
 		if (self->_state == kStateOverwrite) {
 			self->save();
+			self->changeState(kStateNormal);
 		} else if (self->_state == kStateDelete) {
 			self->deleteSave();
 		}
@@ -341,6 +342,9 @@ void KIASectionSave::onButtonPressed(int buttonId, void *callbackData) {
 }
 
 void KIASectionSave::changeState(State state) {
+	if (_state == state)
+		return;
+
 	_state = state;
 	if (state == kStateNormal) {
 		_buttons->resetImages();
@@ -376,6 +380,13 @@ void KIASectionSave::changeState(State state) {
 
 void KIASectionSave::save() {
 	int slot = -1;
+	// Do not allow empty string for saved game name
+	// Note: We do allow a series of blank spaces for name, though
+	//       (this is the behavior in the original game).
+	Common::String inpBoxTextStr = _inputBox->getText();
+	if (inpBoxTextStr.empty()) {
+		return;
+	}
 
 	if (_selectedLineId < (int)_saveList.size()) {
 		slot = _saveList[_selectedLineId].getSaveSlot();
@@ -403,7 +414,7 @@ void KIASectionSave::save() {
 	}
 
 	BladeRunner::SaveFileHeader header;
-	header._name = Common::U32String(_inputBox->getText()).encode(Common::kUtf8);
+	header._name = Common::U32String(inpBoxTextStr).encode(Common::kUtf8);
 	header._playTime = _vm->getTotalPlayTime();
 
 	BladeRunner::SaveFileManager::writeHeader(*saveFile, header);




More information about the Scummvm-git-logs mailing list