[Scummvm-git-logs] scummvm master -> 61593a0a9f06f8683f375007f98de115918e8d44

dreammaster paulfgilbert at gmail.com
Sat Jun 20 16:28:31 UTC 2020


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:
61593a0a9f XEEN: Do auto-capitalization of input text like original


Commit: 61593a0a9f06f8683f375007f98de115918e8d44
    https://github.com/scummvm/scummvm/commit/61593a0a9f06f8683f375007f98de115918e8d44
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-06-20T09:27:47-07:00

Commit Message:
XEEN: Do auto-capitalization of input text like original

Thanks to FrostyHitoshura

Changed paths:
    engines/xeen/dialogs/dialogs_input.cpp


diff --git a/engines/xeen/dialogs/dialogs_input.cpp b/engines/xeen/dialogs/dialogs_input.cpp
index d78fc56dde..6f5b348a17 100644
--- a/engines/xeen/dialogs/dialogs_input.cpp
+++ b/engines/xeen/dialogs/dialogs_input.cpp
@@ -53,7 +53,19 @@ int Input::getString(Common::String &line, uint maxLen, int maxWidth, bool isNum
 		} else if (line.size() < maxLen && (line.size() > 0 || keyCode != Common::KEYCODE_SPACE)
 				&& ((isNumeric && keyState.ascii >= '0' && keyState.ascii <= '9') ||
 				   (!isNumeric && keyState.ascii >= ' ' && keyState.ascii <= (char)127))) {
-			line += keyState.ascii;
+			if (!isNumeric && Common::isAlpha(keyState.ascii)) {
+				// The original game doesn't care about Shift or Caps Locks. The
+				// capitalization is done for the user automatically at the beginning of
+				// words.
+				if (line.empty() || line.hasSuffix(" ")) {
+					line += toupper(keyState.ascii);
+				} else {
+					line += tolower(keyState.ascii);
+				}
+			} else {
+				line += keyState.ascii;
+			}
+
 			refresh = true;
 		} else if (keyCode == Common::KEYCODE_RETURN || keyCode == Common::KEYCODE_KP_ENTER) {
 			break;




More information about the Scummvm-git-logs mailing list