From: vortex Date: Sun, 31 Oct 2010 23:04:24 +0000 (+0000) Subject: new m_newmap() MenuQC function which gets executed each time client goes new level... X-Git-Tag: xonotic-v0.1.0preview~84 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d5fb0730ad9bb24b3d006efdc35c87e1036c4e89;p=xonotic%2Fdarkplaces.git new m_newmap() MenuQC function which gets executed each time client goes new level. +Option for Blood Omnicide which lets menu QC to control keys while playing video. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10576 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=7e737da913d7dd502568fa32f3d72d30a971738d --- diff --git a/cl_parse.c b/cl_parse.c index 0c6d1c31..66dc588b 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "csprogs.h" #include "libcurl.h" #include "utf8lib.h" +#include "menu.h" char *svc_strings[128] = { @@ -486,6 +487,9 @@ static void CL_SetupWorldModel(void) // check memory integrity Mem_CheckSentinelsGlobal(); + // make menu know + MR_NewMap(); + // load the csqc now if (cl.loadcsqc) { diff --git a/keys.c b/keys.c index 8fe972c4..87663328 100644 --- a/keys.c +++ b/keys.c @@ -1887,7 +1887,10 @@ Key_Event (int key, int ascii, qboolean down) // ignore binds while a video is played, let the video system handle the key event if (cl_videoplaying) { - CL_Video_KeyEvent (key, ascii, keydown[key] != 0); + if (gamemode == GAME_BLOODOMNICIDE) // menu controls key events + MR_KeyEvent(key, ascii, down); + else + CL_Video_KeyEvent (key, ascii, keydown[key] != 0); return; } diff --git a/menu.c b/menu.c index 2f3855e7..0a403c06 100644 --- a/menu.c +++ b/menu.c @@ -5016,6 +5016,10 @@ void M_KeyEvent (int key, int ascii, qboolean downevent) } +void M_NewMap(void) +{ +} + void M_Shutdown(void) { // reset key_dest @@ -5136,6 +5140,15 @@ void MP_ToggleMenu(int mode) PRVM_End; } +void MP_NewMap(void) +{ + PRVM_Begin; + PRVM_SetProg(PRVM_MENUPROG); + if (prog->funcoffsets.m_newmap) + PRVM_ExecuteProgram(prog->funcoffsets.m_newmap,"m_newmap() required"); + PRVM_End; +} + void MP_Shutdown (void) { PRVM_Begin; @@ -5198,6 +5211,7 @@ void (*MR_KeyEvent) (int key, int ascii, qboolean downevent); void (*MR_Draw) (void); void (*MR_ToggleMenu) (int mode); void (*MR_Shutdown) (void); +void (*MR_NewMap) (void); void MR_SetRouting(qboolean forceold) { @@ -5211,6 +5225,7 @@ void MR_SetRouting(qboolean forceold) MR_Draw = M_Draw; MR_ToggleMenu = M_ToggleMenu; MR_Shutdown = M_Shutdown; + MR_NewMap = M_NewMap; // init if(!m_init) @@ -5228,6 +5243,7 @@ void MR_SetRouting(qboolean forceold) MR_Draw = MP_Draw; MR_ToggleMenu = MP_ToggleMenu; MR_Shutdown = MP_Shutdown; + MR_NewMap = MP_NewMap; if(!mp_init) { diff --git a/menu.h b/menu.h index 9147d5cb..9fe816d9 100644 --- a/menu.h +++ b/menu.h @@ -83,6 +83,7 @@ extern void (*MR_KeyEvent) (int key, int ascii, qboolean downevent); extern void (*MR_Draw) (void); extern void (*MR_ToggleMenu) (int mode); extern void (*MR_Shutdown) (void); +extern void (*MR_NewMap) (void); typedef struct video_resolution_s { diff --git a/progsvm.h b/progsvm.h index b49922b6..dc83dd8b 100644 --- a/progsvm.h +++ b/progsvm.h @@ -378,6 +378,7 @@ typedef struct prvm_prog_funcoffsets_s func_t m_keyup; // mqc func_t m_shutdown; // mqc func_t m_toggle; // mqc + func_t m_newmap; // mqc } prvm_prog_funcoffsets_t; diff --git a/prvm_edict.c b/prvm_edict.c index 910335fd..430fadc7 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -1751,6 +1751,7 @@ void PRVM_FindOffsets(void) prog->funcoffsets.m_keyup = PRVM_ED_FindFunctionOffset("m_keyup"); prog->funcoffsets.m_shutdown = PRVM_ED_FindFunctionOffset("m_shutdown"); prog->funcoffsets.m_toggle = PRVM_ED_FindFunctionOffset("m_toggle"); + prog->funcoffsets.m_newmap = PRVM_ED_FindFunctionOffset("m_newmap"); } // not used