aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2015-05-19 09:35:53 -0400
committerPaul Gilbert2015-05-19 09:35:53 -0400
commit6f9693102f99843501822f27431d839777fb43d5 (patch)
tree52fe45394376d8faea84b5e8ef6beac7e9296686
parent033241eb434ff4916c140885a6cda84a593406d5 (diff)
downloadscummvm-rg350-6f9693102f99843501822f27431d839777fb43d5.tar.gz
scummvm-rg350-6f9693102f99843501822f27431d839777fb43d5.tar.bz2
scummvm-rg350-6f9693102f99843501822f27431d839777fb43d5.zip
SHERLOCK: Further minor cleanups
-rw-r--r--engines/sherlock/journal.cpp7
-rw-r--r--engines/sherlock/saveload.cpp1
-rw-r--r--engines/sherlock/saveload.h1
-rw-r--r--engines/sherlock/user_interface.cpp2
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;
}