aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/menu.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2010-04-20 15:10:27 +0000
committerMartin Kiewitz2010-04-20 15:10:27 +0000
commite70a48441537dd628e94edd3d5468e387de9772f (patch)
tree0c6b1d0e87b892f03c449d0c528f58a55825ce88 /engines/sci/graphics/menu.cpp
parent45833f7e9a497391e1720ba7e3ff10e4d21691d0 (diff)
downloadscummvm-rg350-e70a48441537dd628e94edd3d5468e387de9772f.tar.gz
scummvm-rg350-e70a48441537dd628e94edd3d5468e387de9772f.tar.bz2
scummvm-rg350-e70a48441537dd628e94edd3d5468e387de9772f.zip
SCI: remove lone spaces at the end of right aligned menu items. fixes "wrongly" aligned menu items in some games
svn-id: r48746
Diffstat (limited to 'engines/sci/graphics/menu.cpp')
-rw-r--r--engines/sci/graphics/menu.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp
index 48ff2d5cce..ed5a034250 100644
--- a/engines/sci/graphics/menu.cpp
+++ b/engines/sci/graphics/menu.cpp
@@ -218,6 +218,9 @@ void GfxMenu::kernelAddEntry(Common::String title, Common::String content, reg_t
if (tagPos && tagPos >= rightAlignedPos)
tempPos = tagPos;
itemEntry->textRightAligned = Common::String(content.c_str() + rightAlignedPos, tempPos - rightAlignedPos);
+ // Remove ending space, if there is one. Strangely sometimes there are lone spaces at the end in some games
+ if (itemEntry->textRightAligned.hasSuffix(" "))
+ itemEntry->textRightAligned.deleteLastChar();
// - and + are used sometimes for volume control
if (itemEntry->textRightAligned == "-") {
itemEntry->keyPress = '-';