diff options
author | Paul Gilbert | 2014-06-08 16:57:51 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-06-08 16:57:51 -0400 |
commit | a8d1454e165fa2178a0463e96a2ee40bd9487627 (patch) | |
tree | 3e6a38b05d95eda6f36748d00bc6c94835ad6e2d /engines/tsage | |
parent | 8d70dd68ac887df8593eb139edaa8f2a084be085 (diff) | |
download | scummvm-rg350-a8d1454e165fa2178a0463e96a2ee40bd9487627.tar.gz scummvm-rg350-a8d1454e165fa2178a0463e96a2ee40bd9487627.tar.bz2 scummvm-rg350-a8d1454e165fa2178a0463e96a2ee40bd9487627.zip |
TSAGE: Fix for R2R game/help dialog not accepting Fn keys
Diffstat (limited to 'engines/tsage')
-rw-r--r-- | engines/tsage/graphics.cpp | 2 | ||||
-rw-r--r-- | engines/tsage/graphics.h | 2 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_dialogs.cpp | 32 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_dialogs.h | 2 |
4 files changed, 37 insertions, 1 deletions
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index fa5d1a3b6a..ce24c76290 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -1229,6 +1229,8 @@ GfxButton *GfxDialog::execute(GfxButton *defaultButton) { selectedButton = defaultButton; breakFlag = true; break; + } else if (event.eventType == EVENT_KEYPRESS && handleKeypress(event, selectedButton)) { + breakFlag = true; } } } diff --git a/engines/tsage/graphics.h b/engines/tsage/graphics.h index cdb4826528..d65d0bcf8b 100644 --- a/engines/tsage/graphics.h +++ b/engines/tsage/graphics.h @@ -343,6 +343,8 @@ public: virtual void draw(); static void setPalette(); + + virtual bool handleKeypress(Event &evt, GfxButton *&btn) { return false; } }; GfxSurface *surfaceGetArea(GfxSurface &src, const Rect &bounds); diff --git a/engines/tsage/ringworld2/ringworld2_dialogs.cpp b/engines/tsage/ringworld2/ringworld2_dialogs.cpp index dfbb281cfb..99f88a1687 100644 --- a/engines/tsage/ringworld2/ringworld2_dialogs.cpp +++ b/engines/tsage/ringworld2/ringworld2_dialogs.cpp @@ -365,7 +365,7 @@ void HelpDialog::show() { HelpDialog *dlg = new HelpDialog(); dlg->draw(); - // Show the character selection dialog + // Show the help dialog GfxButton *btn = dlg->execute(&dlg->_btnResume); // If a function button was selected, take care of it @@ -458,6 +458,36 @@ HelpDialog::HelpDialog() { setCenter(160, 100); } +bool HelpDialog::handleKeypress(Event &event, GfxButton *&btn) { + switch (event.kbd.keycode) { + case Common::KEYCODE_F2: + btn = &_btnList[0]; + break; + case Common::KEYCODE_F3: + btn = &_btnList[1]; + break; + case Common::KEYCODE_F4: + btn = &_btnList[2]; + break; + case Common::KEYCODE_F5: + btn = &_btnList[3]; + break; + case Common::KEYCODE_F7: + btn = &_btnList[4]; + break; + case Common::KEYCODE_F8: + btn = &_btnList[5]; + break; + case Common::KEYCODE_F10: + btn = &_btnList[6]; + break; + default: + return false; + } + + return true; +} + } // End of namespace Ringworld2 } // End of namespace TsAGE diff --git a/engines/tsage/ringworld2/ringworld2_dialogs.h b/engines/tsage/ringworld2/ringworld2_dialogs.h index 8ef35c9024..3d1e1ad48c 100644 --- a/engines/tsage/ringworld2/ringworld2_dialogs.h +++ b/engines/tsage/ringworld2/ringworld2_dialogs.h @@ -83,6 +83,8 @@ public: virtual ~HelpDialog() {} static void show(); + + virtual bool handleKeypress(Event &event, GfxButton *&btn); }; } // End of namespace Ringworld2 |