diff options
author | Torbjörn Andersson | 2016-04-15 07:10:13 +0200 |
---|---|---|
committer | Torbjörn Andersson | 2016-04-15 07:29:43 +0200 |
commit | fc55a8fb1a7eeb8788aed60e16db197b8d678ce4 (patch) | |
tree | c3bfb53d40a6fd4ec4c2d2a296380009bb33feb5 | |
parent | 53e02c477027d23c16afed6e79ea5e862d904a9b (diff) | |
download | scummvm-rg350-fc55a8fb1a7eeb8788aed60e16db197b8d678ce4.tar.gz scummvm-rg350-fc55a8fb1a7eeb8788aed60e16db197b8d678ce4.tar.bz2 scummvm-rg350-fc55a8fb1a7eeb8788aed60e16db197b8d678ce4.zip |
NEVERHOOD: Fix bug #7116 ("Crash upon clicking ...")
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.
-rw-r--r-- | engines/neverhood/menumodule.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/engines/neverhood/menumodule.cpp b/engines/neverhood/menumodule.cpp index 7b50bbfcda..457c7ff481 100644 --- a/engines/neverhood/menumodule.cpp +++ b/engines/neverhood/menumodule.cpp @@ -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(); @@ -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) { |