Skip to content

Commit

Permalink
Fix loadhud command not applying hud menu hacks
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zturtleman committed Nov 13, 2018
1 parent c837677 commit d0205ce
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions code/cgame/cg_consolecmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ static void CG_LoadHud_f( void) {
}

CG_LoadMenus(hudSet);
CG_HudMenuHacks();
menuScoreboard = NULL;
}

Expand Down
1 change: 1 addition & 0 deletions code/cgame/cg_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 12 additions & 1 deletion code/cgame/cg_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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" );
Expand Down

0 comments on commit d0205ce

Please sign in to comment.