From d0205ce99eb0957182e13edc8614bdc6244c95f7 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Tue, 13 Nov 2018 04:00:49 -0600 Subject: [PATCH] Fix loadhud command not applying hud menu hacks Using loadhud command to reload HUD (instead of vid_restart) resulted in menu hacks not being applied to fix voice menu and power up area screen placement for widescreen. Ported from mint-arena. --- code/cgame/cg_consolecmds.c | 1 + code/cgame/cg_local.h | 1 + code/cgame/cg_main.c | 13 ++++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/code/cgame/cg_consolecmds.c b/code/cgame/cg_consolecmds.c index 4c8b075e..9a6c51ad 100644 --- a/code/cgame/cg_consolecmds.c +++ b/code/cgame/cg_consolecmds.c @@ -134,6 +134,7 @@ static void CG_LoadHud_f( void) { } CG_LoadMenus(hudSet); + CG_HudMenuHacks(); menuScoreboard = NULL; } diff --git a/code/cgame/cg_local.h b/code/cgame/cg_local.h index 5bb85fe3..0763e94d 100644 --- a/code/cgame/cg_local.h +++ b/code/cgame/cg_local.h @@ -1220,6 +1220,7 @@ void CG_UpdateCvars( void ); int CG_CrosshairPlayer( void ); int CG_LastAttacker( void ); void CG_LoadMenus(const char *menuFile); +void CG_HudMenuHacks( void ); void CG_KeyEvent(int key, qboolean down); void CG_MouseEvent(int x, int y); void CG_EventHandling(int type); diff --git a/code/cgame/cg_main.c b/code/cgame/cg_main.c index 5f5a7865..0d457dee 100644 --- a/code/cgame/cg_main.c +++ b/code/cgame/cg_main.c @@ -1765,7 +1765,6 @@ CG_LoadHudMenu(); void CG_LoadHudMenu( void ) { char buff[1024]; const char *hudSet; - menuDef_t *menu; cgDC.registerShaderNoMip = &trap_R_RegisterShaderNoMip; cgDC.setColor = &trap_R_SetColor; @@ -1831,6 +1830,18 @@ void CG_LoadHudMenu( void ) { } CG_LoadMenus(hudSet); + CG_HudMenuHacks(); +} + +/* +================= +CG_HudMenuHacks +================= +*/ +void CG_HudMenuHacks( void ) { + menuDef_t *menu; + + Init_Display(&cgDC); // make voice chat head stick to left side in widescreen menu = Menus_FindByName( "voiceMenu" );