]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/sbar.qc
Many fixes and adaptations to the Accuracy Stats window, and get the Grabber to prope...
[voretournament/voretournament.git] / data / qcsrc / client / sbar.qc
index fe6e09ecc7aea1865792612a353cf33629848e0d..0c95d1609bcdb516a689be910cafcbdd79d93282 100644 (file)
@@ -1003,7 +1003,7 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
 float fieldcounter2;\r
 void Sbar_PrintStomachboardItemPred(vector pos, entity pl)\r
 {\r
-       // shows the name of our eater\r
+       // shows the name of our predator\r
 \r
        string str;\r
        float f, field, field_number;\r
@@ -2397,17 +2397,17 @@ void Sbar_DrawAccuracyStats_Description_Hitscan(vector position)
        drawstring(position + '0 9 0' * sbar_fontsize_y, "Shots missed:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 }\r
 \r
-void Sbar_DrawAccuracyStats_Description_Splash(vector position)\r
+/*void Sbar_DrawAccuracyStats_Description_Splash(vector position)\r
 {\r
        drawstring(position + '0 3 0' * sbar_fontsize_y, "Maximum damage:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
        drawstring(position + '0 5 0' * sbar_fontsize_y, "Actual damage:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
        drawstring(position + '0 7 0' * sbar_fontsize_y, "Accuracy:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
        drawstring(position + '0 9 0' * sbar_fontsize_y, "Damage wasted:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-}\r
+}*/ // we have no splash damage weapons, but keep this code just in case\r
 \r
 void Sbar_DrawAccuracyStats()\r
 {\r
-       float i, count_hitscan, count_splash, row_hitscan, row_splash;  // count is the number of 'colums'\r
+       float i, count_hitscan, /*count_splash,*/ row_hitscan/*, row_splash*/;  // count is the number of 'colums'\r
        float weapon_hit, weapon_damage, weapon_stats;\r
        float left_border;  // position where the weapons start, the description is in the border\r
        vector fill_colour, fill_size;\r
@@ -2451,8 +2451,8 @@ void Sbar_DrawAccuracyStats()
        float top_border_hitscan = cvar("sbar_scoreboard_offset") + 55;  // position where the hitscan row starts: pixels down the screen\r
        Sbar_DrawAccuracyStats_Description_Hitscan('1 0 0' * col_margin + '0 1 0' * top_border_hitscan);\r
 \r
-       float top_border_splash = cvar("sbar_scoreboard_offset") + 175;  // position where the splash row starts: pixels down the screen\r
-       Sbar_DrawAccuracyStats_Description_Splash('1 0 0' * col_margin + '0 1 0' * top_border_splash);\r
+//     float top_border_splash = cvar("sbar_scoreboard_offset") + 175;  // position where the splash row starts: pixels down the screen\r
+//     Sbar_DrawAccuracyStats_Description_Splash('1 0 0' * col_margin + '0 1 0' * top_border_splash);\r
 \r
        for(i = WEP_FIRST; i <= WEP_LAST; ++i)\r
        {\r
@@ -2464,7 +2464,7 @@ void Sbar_DrawAccuracyStats()
                border_colour = (i == activeweapon) ? '1 1 1' : '0 0 0';  // white or black border\r
 \r
                if (weapon_damage) {\r
-                       if (self.spawnflags & WEP_TYPE_SPLASH) {\r
+                       /*if (self.spawnflags & WEP_TYPE_SPLASH) {\r
                                weapon_stats = bound(0, floor(100 * weapon_hit / weapon_damage), 100);\r
 \r
                                fill_colour_x = 1 - 0.015 * weapon_stats;\r
@@ -2514,7 +2514,9 @@ void Sbar_DrawAccuracyStats()
                                drawstringright(pos + '4.5 0 0' * sbar_fontsize_x + '0 9 0' * sbar_fontsize_y, ftos(max(0, weapon_damage - weapon_hit)), sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
                                ++count_splash;\r
-                       } else if (self.spawnflags & WEP_TYPE_HITSCAN) {\r
+                       } else*/ // we have no splash damage weapons, but keep this code just in case\r
+\r
+                       if (self.spawnflags & WEP_TYPE_HITSCAN) {\r
                                weapon_stats = bound(0, floor(100 * weapon_hit / weapon_damage), 100);\r
 \r
                                fill_colour_x = 1 - 0.015 * weapon_stats;\r
@@ -2987,13 +2989,13 @@ void Sbar_Draw (void)
                                continue;\r
 \r
                        if(getstati(STAT_VORE_EATEN))\r
-                               f = pl.pleater == getstati(STAT_VORE_EATEN);\r
+                               f = pl.plpredator == getstati(STAT_VORE_EATEN);\r
                        else\r
                        {\r
                                if(spectatee_status)\r
-                                       f = pl.pleater == spectatee_status;\r
+                                       f = pl.plpredator == spectatee_status;\r
                                else\r
-                                       f = pl.pleater == player_localentnum;\r
+                                       f = pl.plpredator == player_localentnum;\r
                        }\r
 \r
                        if(f)\r
@@ -3076,10 +3078,11 @@ void Sbar_Draw (void)
                else if(gametype == GAME_CTS || gametype == GAME_RACE)\r
                        CSQC_race_hud();\r
 \r
-               // draw canleave message\r
+               // draw the canleave message\r
                if(getstati(STAT_VORE_CANLEAVE))\r
+               if not(spectatee_status) // this message doesn't address spectated players\r
                {\r
-                       s = strcat("^7Press ^3", getcommandkey("secondary fire", "+attack2"), " ^7to exit");\r
+                       s = strcat("^7Press ^3", getcommandkey("jump", "+jump"), " ^7to exit");\r
                        pos_x = bottom_x - stringwidth(s, TRUE, '0 0 0') * 16 / 2;\r
                        pos_y = bottom_y - 120;\r
                        drawcolorcodedstring(pos, s, '16 16 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r