diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 4953f58f5..ad25a0d20 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -6755,6 +6755,8 @@ void NetUpdate(void) I_unlock_mutex(k_menu_mutex); #endif CON_Ticker(); + + M_ScreenshotTicker(); } FileSendTicker(); diff --git a/src/d_main.c b/src/d_main.c index 03df9b60d..9f5c15e5e 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -248,10 +248,6 @@ void D_ProcessEvents(void) HandleGamepadDeviceEvents(ev); - // Screenshots over everything so that they can be taken anywhere. - if (M_ScreenshotResponder(ev)) - continue; // ate the event - if (gameaction == ga_nothing && gamestate == GS_TITLESCREEN) { if (cht_Responder(ev)) diff --git a/src/k_menu.h b/src/k_menu.h index fa4b1e8ed..5a343f0f7 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -541,7 +541,10 @@ typedef enum MBT_Z = 1<<5, MBT_L = 1<<6, MBT_R = 1<<7, - MBT_START = 1<<8 + MBT_START = 1<<8, + MBT_SCREENSHOT = 1<<9, + MBT_STARTMOVIE = 1<<10, + MBT_STARTLOSSLESS = 1<<11, } menuButtonCode_t; struct menucmd_t diff --git a/src/m_misc.cpp b/src/m_misc.cpp index c6f23a056..f5b1594ba 100644 --- a/src/m_misc.cpp +++ b/src/m_misc.cpp @@ -1846,24 +1846,16 @@ failure: #endif } -boolean M_ScreenshotResponder(event_t *ev) +void M_ScreenshotTicker(void) { - INT32 ch = -1; - if (dedicated || ev->type != ev_keydown) - return false; + const UINT8 pid = 0; // TODO: should splitscreen players be allowed to use this too? - ch = ev->data1; - - if (ch >= NUMKEYS && menuactive) // If it's not a keyboard key, then don't allow it in the menus! - return false; - - switch (ch) + if (M_MenuButtonPressed(pid, MBT_SCREENSHOT)) { - case KEY_F8: M_ScreenShot(); - break; - - case KEY_F9: + } + else if (M_MenuButtonPressed(pid, MBT_STARTMOVIE)) + { if (moviemode) { M_StopMovie(); @@ -1872,9 +1864,9 @@ boolean M_ScreenshotResponder(event_t *ev) { M_StartMovie(MM_AVRECORDER); } - break; - - case KEY_F10: + } + else if (M_MenuButtonPressed(pid, MBT_STARTLOSSLESS)) + { if (moviemode) { M_StopMovie(); @@ -1883,13 +1875,7 @@ boolean M_ScreenshotResponder(event_t *ev) { M_StartMovie(static_cast(cv_lossless_recorder.value)); } - break; - - default: - return false; } - - return true; } void M_MinimapGenerate(void) diff --git a/src/m_misc.h b/src/m_misc.h index f11617612..b56f307a3 100644 --- a/src/m_misc.h +++ b/src/m_misc.h @@ -98,7 +98,7 @@ void M_ScreenShot(void); #ifdef HWRENDER void M_DoLegacyGLScreenShot(void); #endif -boolean M_ScreenshotResponder(event_t *ev); +void M_ScreenshotTicker(void); void M_MinimapGenerate(void);