mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-04 01:46:42 +00:00
TSAGE: Fix for R2R game/help dialog not accepting Fn keys
This commit is contained in:
parent
8d70dd68ac
commit
a8d1454e16
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -83,6 +83,8 @@ public:
|
||||
virtual ~HelpDialog() {}
|
||||
|
||||
static void show();
|
||||
|
||||
virtual bool handleKeypress(Event &event, GfxButton *&btn);
|
||||
};
|
||||
|
||||
} // End of namespace Ringworld2
|
||||
|
Loading…
x
Reference in New Issue
Block a user