mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-29 04:50:42 +00:00
- hooked up the automap bindings.
Now, with centralized state management these can finally work.
This commit is contained in:
parent
e158775e67
commit
092fb55db3
1 changed files with 43 additions and 8 deletions
|
@ -39,6 +39,43 @@
|
||||||
#include "d_gui.h"
|
#include "d_gui.h"
|
||||||
#include "inputstate.h"
|
#include "inputstate.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
|
#include "gamestate.h"
|
||||||
|
#include "gamecontrol.h"
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
// AM_Responder
|
||||||
|
// Handle automap exclusive bindings.
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
|
bool AM_Responder (event_t *ev, bool last)
|
||||||
|
{
|
||||||
|
if (ev->type == EV_KeyDown || ev->type == EV_KeyUp)
|
||||||
|
{
|
||||||
|
#if 0 // this feature does not exist yet.
|
||||||
|
if (automapFollow)
|
||||||
|
{
|
||||||
|
// check for am_pan* and ignore in follow mode
|
||||||
|
const char *defbind = AutomapBindings.GetBind(ev->data1);
|
||||||
|
if (defbind && !strnicmp(defbind, "+am_pan", 7)) return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool res = C_DoKey(ev, &AutomapBindings, nullptr);
|
||||||
|
if (res && ev->type == EV_KeyUp && !last)
|
||||||
|
{
|
||||||
|
// If this is a release event we also need to check if it released a button in the main Bindings
|
||||||
|
// so that that button does not get stuck.
|
||||||
|
const char *defbind = Bindings.GetBind(ev->data1);
|
||||||
|
return (!defbind || defbind[0] != '+'); // Let G_Responder handle button releases
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
|
@ -49,16 +86,17 @@
|
||||||
|
|
||||||
bool G_Responder (event_t *ev)
|
bool G_Responder (event_t *ev)
|
||||||
{
|
{
|
||||||
FKeyBindings* binds = &Bindings;
|
if (gamestate == GS_LEVEL && automapMode == am_full && AM_Responder(ev, false)) return true;
|
||||||
|
|
||||||
switch (ev->type)
|
switch (ev->type)
|
||||||
{
|
{
|
||||||
case EV_KeyDown:
|
case EV_KeyDown:
|
||||||
if (C_DoKey (ev, binds, &DoubleBindings))
|
if (C_DoKey (ev, &Bindings, &DoubleBindings))
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EV_KeyUp:
|
case EV_KeyUp:
|
||||||
C_DoKey (ev, binds, &DoubleBindings);
|
C_DoKey (ev, &Bindings, &DoubleBindings);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -71,13 +109,10 @@ bool G_Responder (event_t *ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
// [RH] If the view is active, give the automap a chance at
|
// [RH] If the view is active, give the automap a chance at
|
||||||
// the events *last* so that any bound keys get precedence.
|
// the events *last* so that any bound keys get precedence.
|
||||||
// An option for later. Currently the automap is insufficiently separated from the game loop
|
if (gamestate == GS_LEVEL && automapMode == am_overlay)
|
||||||
if (gamestate == GS_LEVEL && viewactive && primaryLevel->automap)
|
return AM_Responder (ev, true);
|
||||||
return primaryLevel->automap->Responder (ev, true);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return (ev->type == EV_KeyDown ||
|
return (ev->type == EV_KeyDown ||
|
||||||
ev->type == EV_Mouse);
|
ev->type == EV_Mouse);
|
||||||
|
|
Loading…
Reference in a new issue