]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sbar.c
added cl_deathnoviewmodel, cl_deathscoreboard and cl_deathtilt cvars so that games...
[xonotic/darkplaces.git] / sbar.c
diff --git a/sbar.c b/sbar.c
index 13f46e7b35ca1c3bf26d3d23adc7dcf755ea045f..fd544d8f577e18f7979c386e7d28a969f64dd5fe 100644 (file)
--- a/sbar.c
+++ b/sbar.c
@@ -97,6 +97,8 @@ cvar_t        showdate_format = {CVAR_SAVE, "showdate_format", "%Y-%m-%d"};
 cvar_t sbar_alpha_bg = {CVAR_SAVE, "sbar_alpha_bg", "0.4"};
 cvar_t sbar_alpha_fg = {CVAR_SAVE, "sbar_alpha_fg", "1"};
 
+cvar_t cl_deathscoreboard = {0, "cl_deathscoreboard", "1"};
+
 void Sbar_MiniDeathmatchOverlay (int x, int y);
 void Sbar_DeathmatchOverlay (void);
 void Sbar_IntermissionOverlay (void);
@@ -329,6 +331,7 @@ void Sbar_Init (void)
        Cvar_RegisterVariable (&showdate_format);
        Cvar_RegisterVariable (&sbar_alpha_bg);
        Cvar_RegisterVariable (&sbar_alpha_fg);
+       Cvar_RegisterVariable (&cl_deathscoreboard);
 
        R_RegisterModule("sbar", sbar_start, sbar_shutdown, sbar_newmap);
 }
@@ -504,10 +507,10 @@ void Sbar_SoloScoreboard (void)
 
 // draw level name
        if (gamemode == GAME_NEXUIZ) {
-               l = strlen (cl.worldmodel->name);
+               l = (int) strlen (cl.worldmodel->name);
                Sbar_DrawString (232 - l*4, 12, cl.worldmodel->name);
        } else {
-               l = strlen (cl.levelname);
+               l = (int) strlen (cl.levelname);
                Sbar_DrawString (232 - l*4, 12, cl.levelname);
        }
 }
@@ -723,15 +726,14 @@ void Sbar_DrawFrags (void)
                f = s->frags;
                sprintf (num, "%3i",f);
 
-               Sbar_DrawCharacter (x +  8, -24, num[0]);
-               Sbar_DrawCharacter (x + 16, -24, num[1]);
-               Sbar_DrawCharacter (x + 24, -24, num[2]);
-
                if (k == cl.viewentity - 1)
                {
                        Sbar_DrawCharacter ( x      + 2, -24, 16);
                        Sbar_DrawCharacter ( x + 32 - 4, -24, 17);
                }
+               Sbar_DrawCharacter (x +  8, -24, num[0]);
+               Sbar_DrawCharacter (x + 16, -24, num[1]);
+               Sbar_DrawCharacter (x + 24, -24, num[2]);
                x += 32;
        }
 }
@@ -914,7 +916,7 @@ void Sbar_Draw (void)
 
        if (gamemode == GAME_SOM)
        {
-               if (sb_showscores || cl.stats[STAT_HEALTH] <= 0)
+               if (sb_showscores || (cl.stats[STAT_HEALTH] <= 0 && cl_deathscoreboard.integer))
                        Sbar_DrawScoreboard ();
                else if (sb_lines)
                {
@@ -957,7 +959,7 @@ void Sbar_Draw (void)
                sbar_y = vid_conheight.integer - 47;
                sbar_x = (vid_conwidth.integer - 640)/2;
 
-               if (sb_showscores || cl.stats[STAT_HEALTH] <= 0)
+               if (sb_showscores || (cl.stats[STAT_HEALTH] <= 0 && cl_deathscoreboard.integer))
                {
                        Sbar_DrawAlphaPic (0, 0, sb_scorebar, sbar_alpha_bg.value);
                        Sbar_DrawScoreboard ();
@@ -1051,7 +1053,7 @@ void Sbar_Draw (void)
                                Sbar_DrawFrags ();
                }
 
-               if (sb_showscores || cl.stats[STAT_HEALTH] <= 0)
+               if (sb_showscores || (cl.stats[STAT_HEALTH] <= 0 && cl_deathscoreboard.integer))
                {
                        if (gamemode != GAME_GOODVSBAD2)
                                Sbar_DrawAlphaPic (0, 0, sb_scorebar, sbar_alpha_bg.value);
@@ -1179,7 +1181,7 @@ float Sbar_PrintScoreboardItem(scoreboard_t *s, float x, float y)
        // print the text
        //DrawQ_String(x, y, va("%c%4i %s", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0);
        // FIXME: use a constant for this color tag instead
-       DrawQ_ColoredString(x, y, va("%c%4i %s^7", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL ); 
+       DrawQ_ColoredString(x, y, va("%c%4i %s" STRING_COLOR_DEFAULT_STR, (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
        return 8;
 }