diff options
Diffstat (limited to 'engines')
-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 |