aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/scalpel/scalpel_screen.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2016-01-30 16:23:23 +0100
committerMartin Kiewitz2016-01-30 16:23:23 +0100
commit9257597160bf70b6c7e323d27f3f8b6a47daa182 (patch)
treef88669cd088fa791dc2067361a0c4953772b32cd /engines/sherlock/scalpel/scalpel_screen.cpp
parent741b868e70f48e73ba71078cc486ed20bf23a73f (diff)
downloadscummvm-rg350-9257597160bf70b6c7e323d27f3f8b6a47daa182.tar.gz
scummvm-rg350-9257597160bf70b6c7e323d27f3f8b6a47daa182.tar.bz2
scummvm-rg350-9257597160bf70b6c7e323d27f3f8b6a47daa182.zip
SHERLOCK: SS: make inventory hotkeys multilingual
Diffstat (limited to 'engines/sherlock/scalpel/scalpel_screen.cpp')
-rw-r--r--engines/sherlock/scalpel/scalpel_screen.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/sherlock/scalpel/scalpel_screen.cpp b/engines/sherlock/scalpel/scalpel_screen.cpp
index 433d773e4f..18aa56fe38 100644
--- a/engines/sherlock/scalpel/scalpel_screen.cpp
+++ b/engines/sherlock/scalpel/scalpel_screen.cpp
@@ -62,12 +62,13 @@ void ScalpelScreen::buttonPrint(const Common::Point &pt, uint color, bool slamIt
// Hotkey needs to be highlighted
if (textContainsHotkey) {
Common::String prefixText = Common::String(str.c_str() + 1);
+ uint16 prefixTextLen = prefixText.size();
uint16 prefixTextPos = 0;
// Hotkey was passed additionally, we search for the hotkey inside the button text and
// remove it from there. We then draw the whole text as highlighted and afterward
// the processed text again as regular text (without the hotkey)
- while (prefixTextPos < prefixText.size()) {
+ while (prefixTextPos < prefixTextLen) {
if (prefixText[prefixTextPos] == hotkey) {
// Hotkey found, remove remaining text
while (prefixTextPos < prefixText.size()) {
@@ -78,7 +79,7 @@ void ScalpelScreen::buttonPrint(const Common::Point &pt, uint color, bool slamIt
prefixTextPos++;
}
- if (prefixTextPos < prefixText.size()) {
+ if (prefixTextPos < prefixTextLen) {
// only adjust in case hotkey character was actually found
prefixOffsetX = stringWidth(prefixText);
}