mirror of
https://github.com/ZDoom/Raze.git
synced 2024-12-01 16:42:16 +00:00
- fixed ESC pressing on Duke's monitors.
This got busted by an update from GZDoom.
This commit is contained in:
parent
b931a960ed
commit
e75448b56c
3 changed files with 16 additions and 7 deletions
|
@ -44,8 +44,6 @@
|
||||||
#include "gamestate.h"
|
#include "gamestate.h"
|
||||||
#include "i_interface.h"
|
#include "i_interface.h"
|
||||||
|
|
||||||
bool G_Responder(event_t* ev);
|
|
||||||
|
|
||||||
int eventhead;
|
int eventhead;
|
||||||
int eventtail;
|
int eventtail;
|
||||||
event_t events[MAXEVENTS];
|
event_t events[MAXEVENTS];
|
||||||
|
@ -86,12 +84,16 @@ void D_ProcessEvents (void)
|
||||||
if (ev->type == EV_DeviceChange)
|
if (ev->type == EV_DeviceChange)
|
||||||
UpdateJoystickMenu(I_UpdateDeviceList());
|
UpdateJoystickMenu(I_UpdateDeviceList());
|
||||||
|
|
||||||
if (gamestate != GS_INTRO) // GS_INTRO blocks the UI.
|
// allow the game to intercept Escape before dispatching it.
|
||||||
|
if (ev->type != EV_KeyDown || ev->data1 != KEY_ESCAPE || !sysCallbacks.WantEscape())
|
||||||
{
|
{
|
||||||
if (C_Responder(ev))
|
if (gamestate != GS_INTRO) // GS_INTRO blocks the UI.
|
||||||
continue; // console ate the event
|
{
|
||||||
if (M_Responder(ev))
|
if (C_Responder(ev))
|
||||||
continue; // menu ate the event
|
continue; // console ate the event
|
||||||
|
if (M_Responder(ev))
|
||||||
|
continue; // menu ate the event
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sysCallbacks.G_Responder(ev) && ev->type == EV_KeyDown) keywasdown.Set(ev->data1);
|
if (sysCallbacks.G_Responder(ev) && ev->type == EV_KeyDown) keywasdown.Set(ev->data1);
|
||||||
|
|
|
@ -46,6 +46,7 @@ struct SystemCallbacks
|
||||||
void (*LanguageChanged)(const char*);
|
void (*LanguageChanged)(const char*);
|
||||||
bool (*OkForLocalization)(FTextureID, const char*);
|
bool (*OkForLocalization)(FTextureID, const char*);
|
||||||
FConfigFile* (*GetConfig)();
|
FConfigFile* (*GetConfig)();
|
||||||
|
bool (*WantEscape)();
|
||||||
};
|
};
|
||||||
|
|
||||||
extern SystemCallbacks sysCallbacks;
|
extern SystemCallbacks sysCallbacks;
|
||||||
|
|
|
@ -543,6 +543,11 @@ static void System_SetTransition(int type)
|
||||||
nextwipe = type;
|
nextwipe = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WantEscape()
|
||||||
|
{
|
||||||
|
return gi->WantEscape();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void I_StartupJoysticks();
|
void I_StartupJoysticks();
|
||||||
|
@ -592,6 +597,7 @@ int GameMain()
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
[]() ->FConfigFile* { return GameConfig; },
|
[]() ->FConfigFile* { return GameConfig; },
|
||||||
|
WantEscape,
|
||||||
};
|
};
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
Loading…
Reference in a new issue