This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian/master
in repository openjk.

commit 7f23591f11dbb144709db9dd1d823587e7f8ff40
Author: Razish <mrraz...@gmail.com>
Date:   Wed Dec 6 23:42:20 2017 +1100

    [Shared] Add loadhud to MP, make SP reload strings and menus
---
 code/cgame/cg_consolecmds.cpp | 15 +++++++--------
 codemp/cgame/cg_consolecmds.c | 13 +++++++++++++
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/code/cgame/cg_consolecmds.cpp b/code/cgame/cg_consolecmds.cpp
index a990b79..d400ab3 100644
--- a/code/cgame/cg_consolecmds.cpp
+++ b/code/cgame/cg_consolecmds.cpp
@@ -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;
@@ -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 {
diff --git a/codemp/cgame/cg_consolecmds.c b/codemp/cgame/cg_consolecmds.c
index 2f2c8b2..564da91 100644
--- a/codemp/cgame/cg_consolecmds.c
+++ b/codemp/cgame/cg_consolecmds.c
@@ -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"
 
 /*
 =================
@@ -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);
@@ -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 
},

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-games/openjk.git

_______________________________________________
Pkg-games-commits mailing list
Pkg-games-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

Reply via email to