AGS: Fix quitting via abort key

This commit is contained in:
Paul Gilbert 2021-08-21 10:49:05 -07:00
parent 292c095582
commit 31bf101af1
2 changed files with 5 additions and 6 deletions

View File

@ -152,9 +152,8 @@ QuitReason quit_check_for_error_state(const char *&qmsg, String &alertis) {
}
void quit_message_on_exit(const String &qmsg, String &alertis, QuitReason qreason) {
// successful exit displays no messages (because Windoze closes the dos-box
// if it is empty).
if ((qreason & kQuitKind_NormalExit) == 0 && !_G(handledErrorInEditor)) {
// successful exit or user abort displays no messages
if ((qreason & (kQuitKind_NormalExit | kQuit_UserAbort)) == 0 && !_G(handledErrorInEditor)) {
// Display the message (at this point the window still exists)
sprintf(_G(pexbuf), "%s\n", qmsg.GetCStr());
alertis.Append(_G(pexbuf));

View File

@ -315,9 +315,6 @@ AGS3::eAGSKeyCode EventsManager::scummvm_key_to_ags_key(const Common::Event &eve
if (event.type != Common::EVENT_KEYDOWN)
return AGS3::eAGSKeyCodeNone;
if (event.kbd.ascii >= 32 && event.kbd.ascii <= 127)
return static_cast<AGS3::eAGSKeyCode>(event.kbd.ascii);
const Common::KeyCode sym = event.kbd.keycode;
const uint16 mod = event.kbd.flags;
@ -329,6 +326,9 @@ AGS3::eAGSKeyCode EventsManager::scummvm_key_to_ags_key(const Common::Event &eve
return static_cast<AGS3::eAGSKeyCode>(AGS_EXT_KEY_SHIFT + (sym - Common::KEYCODE_a) + 1);
}
if (event.kbd.ascii >= 32 && event.kbd.ascii <= 127)
return static_cast<AGS3::eAGSKeyCode>(event.kbd.ascii);
// Remaining codes may match or not, but we use a big table anyway.
// TODO: this is code by [sonneveld],
// double check that we must use scan codes here, maybe can use sdl key (sym) too?