diff options
Diffstat (limited to 'engines/sherlock')
-rw-r--r-- | engines/sherlock/journal.cpp | 7 | ||||
-rw-r--r-- | engines/sherlock/saveload.cpp | 1 | ||||
-rw-r--r-- | engines/sherlock/saveload.h | 1 | ||||
-rw-r--r-- | engines/sherlock/user_interface.cpp | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp index 7afa60d396..f3754db95f 100644 --- a/engines/sherlock/journal.cpp +++ b/engines/sherlock/journal.cpp @@ -1114,13 +1114,14 @@ int Journal::getSearchString(bool printError) { xp -= screen.charWidth(name.lastChar()); screen.vgaBar(Common::Rect(xp, yp, xp + 8, yp + 9), INV_FOREGROUND); name.deleteLastChar(); - } - - if (keyState.keycode == Common::KEYCODE_RETURN) { + + } else if (keyState.keycode == Common::KEYCODE_RETURN) { done = 1; + } else if (keyState.keycode == Common::KEYCODE_ESCAPE) { screen.vgaBar(Common::Rect(xp, yp, xp + 8, yp + 9), BUTTON_MIDDLE); done = -1; + } else if (keyState.ascii >= ' ' && keyState.ascii <= 'z' && keyState.keycode != Common::KEYCODE_AT && name.size() < JOURNAL_SEACRH_MAX_CHARS && (xp + screen.charWidth(keyState.ascii)) < JOURNAL_SEARCH_RIGHT) { char ch = toupper(keyState.ascii); diff --git a/engines/sherlock/saveload.cpp b/engines/sherlock/saveload.cpp index 3c8f3e4f60..9848f8160f 100644 --- a/engines/sherlock/saveload.cpp +++ b/engines/sherlock/saveload.cpp @@ -41,7 +41,6 @@ const int ENV_POINTS[6][3] = { static const char *const EMPTY_SAVEGAME_SLOT = "-EMPTY-"; static const char *const SAVEGAME_STR = "SHLK"; #define SAVEGAME_STR_SIZE 4 -#define ONSCREEN_FILES_COUNT 5 /*----------------------------------------------------------------*/ diff --git a/engines/sherlock/saveload.h b/engines/sherlock/saveload.h index a86d5be035..066d983b26 100644 --- a/engines/sherlock/saveload.h +++ b/engines/sherlock/saveload.h @@ -33,6 +33,7 @@ namespace Sherlock { #define MAX_SAVEGAME_SLOTS 99 +#define ONSCREEN_FILES_COUNT 5 #define SHERLOCK_SAVEGAME_VERSION 1 enum SaveMode { SAVEMODE_NONE = 0, SAVEMODE_LOAD = 1, SAVEMODE_SAVE = 2 }; diff --git a/engines/sherlock/user_interface.cpp b/engines/sherlock/user_interface.cpp index 7ac44ee99e..fbedbb9005 100644 --- a/engines/sherlock/user_interface.cpp +++ b/engines/sherlock/user_interface.cpp @@ -714,7 +714,7 @@ void UserInterface::doEnvControl() { // Handle selecting buttons, if any saves.highlightButtons(found); - if (found == 0 || found == 5) + if (found == 0 || found == ONSCREEN_FILES_COUNT) saves._envMode = SAVEMODE_NONE; } |