Skip to content

Commit

Permalink
NEVERHOOD: Fix bug #7116 ("Crash upon clicking ...")
Browse files Browse the repository at this point in the history
Don't crash when clicking a read-only text widget. In the original,
the load game dialog's text widget isn't read-only, but since we
allow multiple games to have the same name it's probably for the
best that we don't quite match the original behavior here.
  • Loading branch information
Torbjörn Andersson committed Apr 15, 2016
1 parent 53e02c4 commit fc55a8f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions engines/neverhood/menumodule.cpp
Expand Up @@ -609,7 +609,8 @@ void TextEditWidget::onClick() {
++newCursorPos;
_cursorPos = MIN((int)_entryString.size(), newCursorPos);
}
_cursorSurface->setVisible(true);
if (!_readOnly)
_cursorSurface->setVisible(true);
refresh();
}
Widget::onClick();
Expand Down Expand Up @@ -1089,12 +1090,21 @@ static const NRect kLoadGameMenuButtonCollisionBounds[] = {

static const NRect kLoadGameMenuListBoxRect = { 0, 0, 320, 272 };
static const NRect kLoadGameMenuTextEditRect = { 0, 0, 320, 17 };

#if 0
// Unlike the original game, the text widget in our load dialog is read-only so
// don't change the mouse cursor to indicate that you can type the name of the
// game to load.
//
// Since we allow multiple saved games to have the same name, it's probably
// better this way.
static const NRect kLoadGameMenuMouseRect = { 263, 48, 583, 65 };
#endif

LoadGameMenu::LoadGameMenu(NeverhoodEngine *vm, Module *parentModule, SavegameList *savegameList)
: GameStateMenu(vm, parentModule, savegameList, kLoadGameMenuButtonFileHashes, kLoadGameMenuButtonCollisionBounds,
0x98620234, 0x201C2474,
0x2023098E, &kLoadGameMenuMouseRect,
0x2023098E, NULL /* &kLoadGameMenuMouseRect */,
0x04040409, 263, 142, kLoadGameMenuListBoxRect,
0x10924C03, 0, 263, 48, kLoadGameMenuTextEditRect,
0x0BC600A3, 0x0F960021) {
Expand Down

0 comments on commit fc55a8f

Please sign in to comment.