Skip to content

Commit

Permalink
[Shared] Add loadhud to MP, make SP reload strings and menus
Browse files Browse the repository at this point in the history
  • Loading branch information
Razish committed Dec 6, 2017
1 parent 1d125c7 commit 7f23591
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
15 changes: 7 additions & 8 deletions code/cgame/cg_consolecmds.cpp
Expand Up @@ -27,6 +27,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "cg_headers.h"

#include "cg_media.h" //just for cgs....
#include "ui/ui_shared.h"

void CG_TargetCommand_f( void );
extern qboolean player_locked;
Expand Down Expand Up @@ -196,17 +197,15 @@ void CG_ToggleLAGoggles( void )
}
}

void CG_LoadHud_f( void )
{
const char *hudSet;

hudSet = cg_hudFiles.string;
if (hudSet[0] == '\0')
{
void CG_LoadHud_f( void ) {
const char *hudSet = cg_hudFiles.string;
if ( hudSet[0] == '\0' ) {
hudSet = "ui/jahud.txt";
}

CG_LoadMenus(hudSet);
String_Init();
Menu_Reset();
CG_LoadMenus( hudSet );
}

typedef struct {
Expand Down
13 changes: 13 additions & 0 deletions codemp/cgame/cg_consolecmds.c
Expand Up @@ -27,6 +27,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.

#include "cg_local.h"
#include "game/bg_saga.h"
#include "ui/ui_shared.h"

/*
=================
Expand Down Expand Up @@ -271,6 +272,17 @@ static void CG_SiegeCompleteCvarUpdate_f(void)
CG_SiegeBriefingDisplay(SIEGETEAM_TEAM2, 1);
}

static void CG_LoadHud_f( void ) {
const char *hudSet = cg_hudFiles.string;
if ( hudSet[0] == '\0' ) {
hudSet = "ui/jahud.txt";
}

String_Init();
Menu_Reset();
CG_LoadMenus( hudSet );
}

typedef struct consoleCommand_s {
const char *cmd;
void (*func)(void);
Expand All @@ -290,6 +302,7 @@ static consoleCommand_t commands[] = {
{ "invnext", CG_NextInventory_f },
{ "invprev", CG_PrevInventory_f },
{ "loaddeferred", CG_LoadDeferredPlayers },
{ "loadhud", CG_LoadHud_f },
{ "nextframe", CG_TestModelNextFrame_f },
{ "nextskin", CG_TestModelNextSkin_f },
{ "prevframe", CG_TestModelPrevFrame_f },
Expand Down

0 comments on commit 7f23591

Please sign in to comment.