]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/terencehill/newpanelhud' into fruitiex/panelhud
authorFruitieX <fruitiex@gmail.com>
Sun, 1 May 2011 10:42:56 +0000 (13:42 +0300)
committerFruitieX <fruitiex@gmail.com>
Sun, 1 May 2011 10:42:56 +0000 (13:42 +0300)
25 files changed:
defaultXonotic.cfg
hud_luminos.cfg
hud_luminos_old.cfg
qcsrc/client/Defs.qc
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc
qcsrc/client/teamplay.qc
qcsrc/menu/xonotic/dialog_hudpanel_ammo.c
qcsrc/menu/xonotic/dialog_hudpanel_chat.c
qcsrc/menu/xonotic/dialog_hudpanel_engineinfo.c
qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.c
qcsrc/menu/xonotic/dialog_hudpanel_infomessages.c
qcsrc/menu/xonotic/dialog_hudpanel_notification.c
qcsrc/menu/xonotic/dialog_hudpanel_physics.c
qcsrc/menu/xonotic/dialog_hudpanel_powerups.c
qcsrc/menu/xonotic/dialog_hudpanel_radar.c
qcsrc/menu/xonotic/dialog_hudpanel_score.c
qcsrc/menu/xonotic/dialog_hudpanel_timer.c
qcsrc/menu/xonotic/dialog_hudpanel_vote.c
qcsrc/menu/xonotic/dialog_hudpanel_weapons.c
qcsrc/menu/xonotic/dialog_hudsetup_exit.c
qcsrc/server/cl_client.qc
qcsrc/server/domination.qc

index 675034af3b8459a43afe146f60cd6b7c1f693826..80dc21befbf92734b1f9715aa3ddac5856f9e15e 100644 (file)
@@ -1421,7 +1421,10 @@ seta hud_panel_ammo_maxammo "40" "when you have this much ammo, the ammo status
 
 seta hud_panel_healtharmor_maxhealth "200" "when you have this much health, the health status bar is full"
 seta hud_panel_healtharmor_maxarmor "200" "when you have this much armor, the armor status bar is full"
-seta hud_panel_healtharmor_progressbar_gfx 1 "add graphic effects to the progressbars when spawning and when being damaged"
+seta hud_panel_healtharmor_progressbar_gfx 1 "enable graphic effects on the progressbars"
+seta hud_panel_healtharmor_progressbar_gfx_damage 5 "show damage effect when damaged at least by this amount; 0 disables the effect"
+seta hud_panel_healtharmor_progressbar_gfx_lowhealth 40 "health progressbar blinks when health is lower than this amount"
+seta hud_panel_healtharmor_progressbar_gfx_smooth 2 "smooth changes of the progressbar when health/armor change at least by this amount; 0 disables the effect"
 
 seta hud_panel_notify_time 10 "time that a new entry stays until it fades out"
 seta hud_panel_notify_fadetime 3 "fade out time"
@@ -1435,7 +1438,7 @@ seta hud_panel_radar_rotation 0   "rotation mode: you set what points up. 0 = play
 seta hud_panel_radar_zoommode 0        "zoom mode: 0 = zoomed by default, 1 = zoomed when +zoom, 2 = always zoomed, 3 = always zoomed out"
 alias hud_panel_radar_rotate "toggle hud_panel_radar_rotation 0 1 2 3 4"
 
-seta hud_panel_score_rankings 0 "show rankings in non-team games instead of the score difference: 1 always show my own score; 2 pure rankings"
+seta hud_panel_score_rankings 0 "show rankings: 1 always show my own score; 2 pure rankings"
 
 seta hud_panel_engineinfo_framecounter_time 0.1 "time between framerate display updates"
 seta hud_panel_engineinfo_framecounter_decimals 0 "amount of decimals to show"
index 7196d32c892a38c298f8f0bda1b98fc53234e66f..4c11d42079856dee560dc26463a74c9e2001df10 100644 (file)
@@ -219,8 +219,8 @@ seta hud_panel_infomessages_bg_padding "0"
 seta hud_panel_infomessages_flip "1"
 
 seta hud_panel_physics 0
-seta hud_panel_physics_pos "0.410000 0.590000"
-seta hud_panel_physics_size "0.180000 0.100000"
+seta hud_panel_physics_pos "0.420000 0.620000"
+seta hud_panel_physics_size "0.170000 0.080000"
 seta hud_panel_physics_bg ""
 seta hud_panel_physics_bg_color ""
 seta hud_panel_physics_bg_color_team ""
index 1d84465112a737607d2ee63980cb301628fbe74a..a5e16e75a4acb7430e89a8c3e67bf1e07980ce77 100644 (file)
@@ -19,6 +19,9 @@ seta hud_progressbar_health_color "0.6 0 0"
 seta hud_progressbar_armor_color "0 0.6 0"
 seta hud_progressbar_fuel_color "0.6 0.6 0"
 seta hud_progressbar_nexball_color "0.7 0.1 0"
+seta hud_progressbar_speed_color "1 0.75 0"
+seta hud_progressbar_acceleration_color "0.5 0.75 1"
+seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
 
 seta _hud_panelorder "15 10 9 6 8 14 5 0 4 13 2 7 1 3 11 12 "
 
@@ -74,8 +77,8 @@ seta hud_panel_powerups_bg_alpha ""
 seta hud_panel_powerups_bg_border ""
 seta hud_panel_powerups_bg_padding ""
 seta hud_panel_powerups_flip "1"
-seta hud_panel_powerups_iconalign "4"
-seta hud_panel_powerups_baralign "4"
+seta hud_panel_powerups_iconalign "3"
+seta hud_panel_powerups_baralign "3"
 seta hud_panel_powerups_progressbar "1"
 seta hud_panel_powerups_progressbar_strength "progressbar"
 seta hud_panel_powerups_progressbar_shield "progressbar"
@@ -91,8 +94,8 @@ seta hud_panel_healtharmor_bg_alpha ""
 seta hud_panel_healtharmor_bg_border ""
 seta hud_panel_healtharmor_bg_padding ""
 seta hud_panel_healtharmor_flip "0"
-seta hud_panel_healtharmor_iconalign "4"
-seta hud_panel_healtharmor_baralign "4"
+seta hud_panel_healtharmor_iconalign "3"
+seta hud_panel_healtharmor_baralign "3"
 seta hud_panel_healtharmor_progressbar "1"
 seta hud_panel_healtharmor_progressbar_health "progressbar"
 seta hud_panel_healtharmor_progressbar_armor "progressbar"
@@ -215,4 +218,19 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding "0"
 seta hud_panel_infomessages_flip "1"
 
+seta hud_panel_physics 0
+seta hud_panel_physics_pos "0.410000 0.590000"
+seta hud_panel_physics_size "0.180000 0.100000"
+seta hud_panel_physics_bg ""
+seta hud_panel_physics_bg_color ""
+seta hud_panel_physics_bg_color_team ""
+seta hud_panel_physics_bg_alpha ""
+seta hud_panel_physics_bg_border ""
+seta hud_panel_physics_bg_padding ""
+seta hud_panel_physics_flip "0"
+seta hud_panel_physics_baralign "0"
+seta hud_panel_physics_acceleration_progressbar_mode "0"
+seta hud_panel_physics_progressbar "1"
+seta hud_panel_physics_text "1"
+
 menu_sync
index afdd9f31f683a2ddc6cd4e6a64fcc001e04b24dd..b3b0569489d992798c0ea9355f3a7a5296730968 100644 (file)
@@ -221,7 +221,6 @@ float nb_pb_period;
 
 // Spectating
 float spectatee_status;
-float prev_spectatee_status;
 
 // short mapname
 string shortmapname;
index e9a4c4017b08496351cbba8a44c263b42c80f0cd..21ccb217ce6c04858f4914de03d278fb8935e25a 100644 (file)
@@ -835,6 +835,15 @@ void Ent_ClientData()
                race_laptime = 0;
                race_checkpointtime = 0;
        }
+       if (autocvar_hud_panel_healtharmor_progressbar_gfx)
+       {
+               if ( (spectatee_status == -1 && newspectatee_status > 0) //before observing, now spectating
+                 || (spectatee_status > 0 && newspectatee_status > 0 && spectatee_status != newspectatee_status) //changed spectated player
+               )
+                       prev_p_health = -1;
+               else if(spectatee_status && !newspectatee_status) //before observing/spectating, now playing
+                       prev_health = -1;
+       }
        spectatee_status = newspectatee_status;
 }
 
index 10f60613edea9bef1fcf58a71bf99200720b4acd..7ae320b89bccdcead7dc5c54aae76328d1526efb 100644 (file)
@@ -1253,8 +1253,6 @@ void CSQC_UpdateView(float w, float h)
                cvar_set("vid_conheight", h0);
        }
 
-       prev_spectatee_status = spectatee_status;
-
        if(autocvar__hud_configure)
                HUD_Panel_Mouse();
 
index d06c31a12934ea3cf090c31a099d67bf8a25b3a1..102ea1e30f96147378c672e0d90cd2d6867855ec 100644 (file)
@@ -198,7 +198,11 @@ float autocvar_hud_panel_healtharmor_maxhealth;
 float autocvar_hud_panel_healtharmor_progressbar;
 string autocvar_hud_panel_healtharmor_progressbar_armor;
 string autocvar_hud_panel_healtharmor_progressbar_health;
-string autocvar_hud_panel_healtharmor_progressbar_gfx;
+float autocvar_hud_panel_healtharmor_progressbar_gfx;
+float autocvar_hud_panel_healtharmor_progressbar_gfx_damage;
+float autocvar_hud_panel_healtharmor_progressbar_gfx_lowhealth;
+float autocvar_hud_panel_healtharmor_progressbar_gfx_smooth;
+
 float autocvar_hud_panel_healtharmor_text;
 float autocvar_hud_panel_infomessages;
 float autocvar_hud_panel_infomessages_flip;
index 29a3af193852c675251c11147b1a7b8a8af9ebee..c70003153727db151802168d2336775ed3380e97 100644 (file)
@@ -1002,7 +1002,7 @@ void DrawAmmoItem(vector myPos, vector mySize, float itemcode, float currently_s
                drawpic_aspect_skin(myPos, "ammo_current_bg", mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 
     if(a > 0 && autocvar_hud_panel_ammo_progressbar)
-        HUD_Panel_DrawProgressBar(myPos + eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, mySize - eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, autocvar_hud_panel_ammo_progressbar_name, 0, 0, a/autocvar_hud_panel_ammo_maxammo, color, autocvar_hud_progressbar_alpha * panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+        HUD_Panel_DrawProgressBar(myPos + eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, mySize - eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, autocvar_hud_panel_ammo_progressbar_name, a/autocvar_hud_panel_ammo_maxammo, 0, 0, color, autocvar_hud_progressbar_alpha * panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
 
     if(autocvar_hud_panel_ammo_text)
     {
@@ -1300,10 +1300,19 @@ void HUD_Powerups(void)
 
 // Health/armor (#3)
 //
-float health_time, prev_health;
-float armor_time, prev_armor;
-var float saved_health = -2;
-var float saved_armor = -2;
+
+// prev_* vars contain the health/armor at the previous FRAME
+// set to -1 when player is dead or was not playing
+float prev_health, prev_armor;
+float health_damagetime, armor_damagetime;
+float health_beforedamage, armor_beforedamage;
+// old_p_* vars keep track of previous values when smoothing value changes of the progressbar
+float old_p_health, old_p_armor;
+float old_p_healthtime, old_p_armortime;
+// prev_p_* vars contain the health/armor progressbar value at the previous FRAME
+// set to -1 to forcedly stop effects when we switch spectated player (e.g. from playerX: 70h to playerY: 50h)
+float prev_p_health, prev_p_armor;
+
 void HUD_HealthArmor(void)
 {
        float armor, health, fuel;
@@ -1315,36 +1324,36 @@ void HUD_HealthArmor(void)
                health = getstati(STAT_HEALTH);
                if(health <= 0)
                {
-                       health_time = -1;
+                       prev_health = -1;
                        return;
                }
-               if (autocvar_hud_panel_healtharmor_progressbar_gfx)
-               {
-                       if ( (prev_spectatee_status == -1 && spectatee_status > 0) //before observing, now spectating
-                         || (prev_spectatee_status > 0 && spectatee_status > 0 && prev_spectatee_status != spectatee_status) //changed spectated player
-                       )
-                       {
-                               //no effect
-                               saved_health = 0;
-                               saved_armor = 0;
-                               health_time = 0;
-                               armor_time = 0;
-                       }
-                       else if(prev_spectatee_status == -1 || (prev_spectatee_status > 0 && !spectatee_status)) //before spectating/observing, now playing
-                               health_time = -1;
+               armor = getstati(STAT_ARMOR);
 
-                       if (health_time == -1)
-                       {
-                               //start the load effect
-                               saved_health = -2;
-                               saved_armor = -2;
-                               health_time = time;
-                               armor_time = time;
-                               prev_health = 0;
-                               prev_armor = 0;
-                       }
+               // code to check for spectatee_status changes is in Ent_ClientData()
+               // prev_p_health and prev_health can be set to -1 there
+
+               if (prev_p_health == -1)
+               {
+                       // no effect
+                       health_beforedamage = 0;
+                       armor_beforedamage = 0;
+                       health_damagetime = 0;
+                       armor_damagetime = 0;
+                       prev_health = health;
+                       prev_armor = armor;
+                       old_p_health = health;
+                       old_p_armor = armor;
+                       prev_p_health = health;
+                       prev_p_armor = armor;
+               }
+               else if (prev_health == -1)
+               {
+                       //start the load effect
+                       health_damagetime = 0;
+                       armor_damagetime = 0;
+                       prev_health = 0;
+                       prev_armor = 0;
                }
-               armor = getstati(STAT_ARMOR);
                fuel = getstati(STAT_FUEL);
        }
        else
@@ -1467,34 +1476,39 @@ void HUD_HealthArmor(void)
                                pain_health_alpha = 1;
                                if (autocvar_hud_panel_healtharmor_progressbar_gfx)
                                {
-                                       if (saved_health == -1)
+                                       if (autocvar_hud_panel_healtharmor_progressbar_gfx_smooth > 0)
                                        {
-                                               if (prev_health == 0 || prev_health - health >= 3)
+                                               if (fabs(prev_health - health) >= autocvar_hud_panel_healtharmor_progressbar_gfx_smooth)
+                                               {
+                                                       if (time - old_p_healthtime < 1)
+                                                               old_p_health = prev_p_health;
+                                                       else
+                                                               old_p_health = prev_health;
+                                                       old_p_healthtime = time;
+                                               }
+                                               if (time - old_p_healthtime < 1)
                                                {
-                                                       health_time = time;
-                                                       saved_health = prev_health;
+                                                       p_health += (old_p_health - health) * (1 - (time - old_p_healthtime));
+                                                       prev_p_health = p_health;
                                                }
                                        }
-                                       if (saved_health != -1)
+                                       if (autocvar_hud_panel_healtharmor_progressbar_gfx_damage > 0)
                                        {
-                                               float d = time - health_time;
-                                               if (d < 1)
+                                               if (prev_health - health >= autocvar_hud_panel_healtharmor_progressbar_gfx_damage)
                                                {
-                                                       if (saved_health == -2)
-                                                               p_health *= sqrt(d);
-                                                       else
-                                                       {
-                                                               HUD_Panel_DrawProgressBar(pos + health_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_health, saved_health/maxhealth, is_vertical, health_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * (1 - d * d), DRAWFLAG_NORMAL);
-                                                               if (prev_health - health >= 1) //refresh the effect if repeatedly damaged
-                                                                       health_time = time;
-                                                       }
+                                                       if (time - health_damagetime >= 1)
+                                                               health_beforedamage = prev_health;
+                                                       health_damagetime = time;
+                                               }
+                                               if (time - health_damagetime < 1)
+                                               {
+                                                       float health_damagealpha = 1 - (time - health_damagetime)*(time - health_damagetime);
+                                                       HUD_Panel_DrawProgressBar(pos + health_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_health, health_beforedamage/maxhealth, is_vertical, health_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * health_damagealpha, DRAWFLAG_NORMAL);
                                                }
-                                               else
-                                                       saved_health = -1; //damage effect ended
                                        }
                                        prev_health = health;
 
-                                       if (health <= 40 && saved_health != -2)
+                                       if (health <= autocvar_hud_panel_healtharmor_progressbar_gfx_lowhealth)
                                        {
                                                float BLINK_FACTOR = 0.15;
                                                float BLINK_BASE = 0.85;
@@ -1517,30 +1531,35 @@ void HUD_HealthArmor(void)
                                p_armor = armor;
                                if (autocvar_hud_panel_healtharmor_progressbar_gfx)
                                {
-                                       if (saved_armor == -1)
+                                       if (autocvar_hud_panel_healtharmor_progressbar_gfx_smooth > 0)
                                        {
-                                               if (prev_armor == 0 || prev_armor - armor >= 3)
+                                               if (fabs(prev_armor - armor) >= autocvar_hud_panel_healtharmor_progressbar_gfx_smooth)
                                                {
-                                                       armor_time = time;
-                                                       saved_armor = prev_armor;
+                                                       if (time - old_p_armortime < 1)
+                                                               old_p_armor = prev_p_armor;
+                                                       else
+                                                               old_p_armor = prev_armor;
+                                                       old_p_armortime = time;
+                                               }
+                                               if (time - old_p_armortime < 1)
+                                               {
+                                                       p_armor += (old_p_armor - armor) * (1 - (time - old_p_armortime));
+                                                       prev_p_armor = p_armor;
                                                }
                                        }
-                                       if (saved_armor != -1)
+                                       if (autocvar_hud_panel_healtharmor_progressbar_gfx_damage > 0)
                                        {
-                                               float d = time - armor_time;
-                                               if (d < 1)
+                                               if (prev_armor - armor >= autocvar_hud_panel_healtharmor_progressbar_gfx_damage)
                                                {
-                                                       if (saved_armor == -2)
-                                                               p_armor *= sqrt(d);
-                                                       else
-                                                       {
-                                                               HUD_Panel_DrawProgressBar(pos + armor_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_armor, saved_armor/maxarmor, is_vertical, armor_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * (1 - d * d), DRAWFLAG_NORMAL);
-                                                               if (prev_armor - armor >= 1) //refresh the effect if repeatedly damaged
-                                                                       armor_time = time;
-                                                       }
+                                                       if (time - armor_damagetime >= 1)
+                                                               armor_beforedamage = prev_armor;
+                                                       armor_damagetime = time;
+                                               }
+                                               if (time - armor_damagetime < 1)
+                                               {
+                                                       float armor_damagealpha = 1 - (time - armor_damagetime)*(time - armor_damagetime);
+                                                       HUD_Panel_DrawProgressBar(pos + armor_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_armor, armor_beforedamage/maxarmor, is_vertical, armor_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * armor_damagealpha, DRAWFLAG_NORMAL);
                                                }
-                                               else
-                                                       saved_armor = -1; //damage effect ended
                                        }
                                        prev_armor = armor;
                                }
@@ -2560,6 +2579,126 @@ void HUD_Radar(void)
 // Score (#7)
 //
 void HUD_UpdatePlayerTeams();
+void HUD_Score_Rankings(vector pos, vector mySize, entity me, float team_count)
+{
+       float score;
+       entity tm, pl;
+#define SCOREPANEL_MAX_ENTRIES 6
+#define SCOREPANEL_ASPECTRATIO 2
+       const float entries = bound(1, floor(SCOREPANEL_MAX_ENTRIES * mySize_y/mySize_x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES);
+       const float height = mySize_y/entries;
+       const vector fontsize = '0.9 0.9 0' * height;
+       pos_y += height * (1 - 0.9) / 2;
+
+       vector rgb, score_color;
+       rgb = '1 1 1';
+       score_color = '1 1 1';
+
+       const float name_size = mySize_x*0.75;
+       const float spacing_size = mySize_x*0.04;
+       const float highlight_alpha = 0.2;
+       float i, me_printed, first_pl;
+       string s;
+       i, first_pl = 0;
+       if (autocvar__hud_configure)
+       {
+               if (team_count)
+               {
+                       // show team scores in the first line
+                       float score_size = mySize_x / team_count;
+                       for(tm = teams.sort_next; tm; tm = tm.sort_next) {
+                               if(tm.team == COLOR_SPECTATOR)
+                                       continue;
+                               if (tm.team == myteam)
+                                       HUD_Panel_DrawHighlight(pos - eY * (height * (1 - 0.9) / 2) + eX * score_size * i, eX * score_size + eY * height, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawstring_aspect(pos + eX * score_size * i, ftos(123), eX * score_size + eY * fontsize_y, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                               ++i;
+                       }
+                       first_pl = 1;
+                       pos_y += height;
+               }
+               score = 10 + SCOREPANEL_MAX_ENTRIES * 3;
+               for (i=first_pl; i<entries; ++i)
+               {
+                       //simulate my score is lower than all displayed players,
+                       //so that I don't appear at all showing pure rankings.
+                       //This is to better show the difference between the 2 ranking views
+                       if (i == entries-1 && autocvar_hud_panel_score_rankings == 1)
+                       {
+                               rgb = '1 1 0';
+                               drawfill(pos - eY * (height * (1 - 0.9) / 2), eX * mySize_x + eY * height, rgb, highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               s = GetPlayerName(pl.sv_entnum);
+                               score = 7;
+                       }
+                       else
+                       {
+                               s = sprintf(_("Player %d"), i + 1 - first_pl);
+                               score -= 3;
+                       }
+
+                       if (team_count)
+                               score_color = GetTeamRGB(ColorByTeam(mod(i + 2, team_count))) * 0.8;
+                       s = textShortenToWidth(s, name_size, fontsize, stringwidth_colors);
+                       drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, TRUE, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
+                       drawstring(pos + eX * (name_size + spacing_size), ftos(score), fontsize, score_color, panel_fg_alpha, DRAWFLAG_NORMAL);
+                       pos_y += height;
+               }
+               return;
+       }
+
+       if (!scoreboard_fade_alpha) // the scoreboard too calls HUD_UpdatePlayerTeams
+               HUD_UpdatePlayerTeams();
+       if (team_count)
+       {
+               // show team scores in the first line
+               float score_size = mySize_x / team_count;
+               for(tm = teams.sort_next; tm; tm = tm.sort_next) {
+                       if(tm.team == COLOR_SPECTATOR)
+                               continue;
+                       if (tm.team == myteam)
+                               drawfill(pos - eY * (height * (1 - 0.9) / 2) + eX * score_size * i, eX * score_size + eY * height, '1 1 1', highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       drawstring_aspect(pos + eX * score_size * i, ftos(tm.(teamscores[ts_primary])), eX * score_size + eY * fontsize_y, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                       ++i;
+               }
+               first_pl = 1;
+               pos_y += height;
+       }
+       i = first_pl;
+       for (pl = players.sort_next; pl && i<entries; pl = pl.sort_next, ++i)
+       {
+               if (pl.team == COLOR_SPECTATOR)
+                       continue;
+
+               if (i == entries-1 && !me_printed && pl != me)
+               if (autocvar_hud_panel_score_rankings == 1 && spectatee_status != -1)
+               {
+                       for (pl = me.sort_next; pl; pl = pl.sort_next)
+                               if (pl.team != COLOR_SPECTATOR)
+                                       break;
+
+                       if (pl)
+                               rgb = '1 1 0'; //not last but not among the leading players: yellow
+                       else
+                               rgb = '1 0 0'; //last: red
+                       pl = me;
+               }
+
+               if (pl == me)
+               {
+                       if (i == first_pl)
+                               rgb = '0 1 0'; //first: green
+                       me_printed = 1;
+                       drawfill(pos - eY * (height * (1 - 0.9) / 2), eX * mySize_x + eY * height, rgb, highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+               }
+               if (team_count)
+                       score_color = GetTeamRGB(pl.team) * 0.8;
+               s = textShortenToWidth(GetPlayerName(pl.sv_entnum), name_size, fontsize, stringwidth_colors);
+               drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, TRUE, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
+               drawstring(pos + eX * (name_size + spacing_size), ftos(pl.(scores[ps_primary])), fontsize, score_color, panel_fg_alpha, DRAWFLAG_NORMAL);
+               pos_y += height;
+       }
+}
+
 void HUD_Score(void)
 {
        if(!autocvar__hud_configure)
@@ -2624,83 +2763,7 @@ void HUD_Score(void)
        } else if (!teamplay) { // non-teamgames
                if ((spectatee_status == -1 && !autocvar__hud_configure) || autocvar_hud_panel_score_rankings)
                {
-#define SCOREPANEL_MAX_ENTRIES 6
-#define SCOREPANEL_ASPECTRATIO 2
-                       const float entries = bound(1, floor(SCOREPANEL_MAX_ENTRIES * mySize_y/mySize_x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES);
-                       const float height = mySize_y/entries;
-                       const vector fontsize = '0.9 0.9 0' * height;
-                       pos_y += height * (1 - 0.9) / 2;
-
-                       vector rgb;
-                       rgb = '1 1 1';
-
-                       const float name_size = mySize_x*0.75;
-                       const float highlight_alpha = 0.2;
-                       float i, me_printed;
-                       string s;
-                       if (autocvar__hud_configure)
-                       {
-                               score = 10 + SCOREPANEL_MAX_ENTRIES * 3;
-                               for (i=0; i<entries; ++i)
-                               {
-                                       //simulate my score is lower than all displayed players,
-                                       //so that I don't appear at all showing pure rankings.
-                                       //This is to better show the difference between the 2 ranking views
-                                       if (i == entries-1 && autocvar_hud_panel_score_rankings == 1)
-                                       {
-                                               rgb = '1 1 0';
-                                               drawfill(pos - eY * (height * (1 - 0.9) / 2), eX * mySize_x + eY * height, rgb, highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                                               s = GetPlayerName(pl.sv_entnum);
-                                               score = 7;
-                                       }
-                                       else
-                                       {
-                                               s = sprintf(_("Player %d"), ftos(i+1));
-                                               score -= 3;
-                                       }
-
-                                       s = textShortenToWidth(s, name_size, fontsize, stringwidth_colors);
-                                       drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, TRUE, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
-                                       drawstring(pos + eX * mySize_x*0.79, ftos(score), fontsize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                                       pos_y += height;
-                               }
-                               return;
-                       }
-
-                       if (!scoreboard_fade_alpha) // the scoreboard too calls HUD_UpdatePlayerTeams
-                               HUD_UpdatePlayerTeams();
-
-                       for (pl = players.sort_next, i=0; pl && i<entries; pl = pl.sort_next, ++i)
-                       {
-                               if (pl.team == COLOR_SPECTATOR)
-                                       continue;
-
-                               if (i == entries-1 && !me_printed && pl != me)
-                               if (autocvar_hud_panel_score_rankings == 1 && spectatee_status != -1)
-                               {
-                                       for (pl = me.sort_next; pl; pl = pl.sort_next)
-                                               if (pl.team != COLOR_SPECTATOR)
-                                                       break;
-
-                                       if (pl)
-                                               rgb = '1 1 0'; //not last but not among the leading players: yellow
-                                       else
-                                               rgb = '1 0 0'; //last: red
-                                       pl = me;
-                               }
-
-                               if (pl == me)
-                               {
-                                       if (i == 0)
-                                               rgb = '0 1 0'; //first: green
-                                       me_printed = 1;
-                                       drawfill(pos - eY * (height * (1 - 0.9) / 2), eX * mySize_x + eY * height, rgb, highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                               }
-                               s = textShortenToWidth(GetPlayerName(pl.sv_entnum), name_size, fontsize, stringwidth_colors);
-                               drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, TRUE, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
-                               drawstring(pos + eX * mySize_x*0.79, ftos(pl.(scores[ps_primary])), fontsize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                               pos_y += height;
-                       }
+                       HUD_Score_Rankings(pos, mySize, me, 0);
                        return;
                }
                // me vector := [team/connected frags id]
@@ -2739,20 +2802,17 @@ void HUD_Score(void)
                drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize_x + eY * mySize_y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL);
                drawstring_aspect(pos + eX * 0.75 * mySize_x, distribution_str, eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL);
        } else { // teamgames
-               float max_fragcount;
-               max_fragcount = -99;
-
                float scores_count, row, column, rows, columns;
                vector offset;
                vector score_pos, score_size; //for scores other than myteam
-               if (spectatee_status == -1)
+               if (spectatee_status == -1 || autocvar_hud_panel_score_rankings)
                {
-                       if (autocvar__hud_configure)
-                               scores_count = 4;
-                       else for(tm = teams.sort_next; tm; tm = tm.sort_next) {
-                               if(tm.team == COLOR_SPECTATOR)
-                                       continue;
+                       for(tm = teams.sort_next; tm, tm.team != COLOR_SPECTATOR; tm = tm.sort_next)
                                ++scores_count;
+                       if (autocvar_hud_panel_score_rankings)
+                       {
+                               HUD_Score_Rankings(pos, mySize, me, scores_count);
+                               return;
                        }
                        rows = mySize_y/mySize_x;
                        rows = bound(1, floor((sqrt(4 * (3/1) * rows * scores_count + rows * rows) + rows + 0.5) / 2), scores_count);
@@ -2780,6 +2840,9 @@ void HUD_Score(void)
                }
                else
                        score_size = eX * mySize_x*(1/4) + eY * mySize_y*(1/3);
+
+               float max_fragcount;
+               max_fragcount = -99;
                for(tm = teams.sort_next; tm; tm = tm.sort_next) {
                        if(tm.team == COLOR_SPECTATOR)
                                continue;
index 0c52f29d07f471bfb0a26a40d588ec2af644c1cf..bc705153ab97fd616137fd31d27dd939589ad9fc 100644 (file)
@@ -9,6 +9,17 @@ float TeamByColor(float color)
        default: return 0;
        }
 }
+float ColorByTeam(float i)
+{
+       switch(i)
+       {
+       case 0: return COLOR_TEAM1;
+       case 1: return COLOR_TEAM2;
+       case 2: return COLOR_TEAM3;
+       case 3: return COLOR_TEAM4;
+       default: return COLOR_TEAM1;
+       }
+}
 
 float GetPlayerColorForce(float i)
 {
index 299ea09fd7dc690b49584b108e570824cabfdff7..07257696436525b2bbc90cfc84561731da15f1ec 100644 (file)
@@ -19,14 +19,14 @@ void XonoticHUDAmmoDialog_fill(entity me)
        DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Ammunition display:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Ammunition display:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_panel_ammo_onlycurrent", _("Show only current ammo type")));
+               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_ammo_onlycurrent", _("Show only current ammo type")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Align icon:"));
-                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_ammo_iconalign", "0", _("Left")));
-                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_ammo_iconalign", "1", _("Right")));
+               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Align icon:")));
+                       me.TD(me, 1, 2.4/2, e = makeXonoticRadioButton(2, "hud_panel_ammo_iconalign", "0", _("Left")));
+                       me.TD(me, 1, 2.4/2, e = makeXonoticRadioButton(2, "hud_panel_ammo_iconalign", "1", _("Right")));
 }
 #endif
index 331b0ee9ae265e0fe29b67f27f316f00f9cedce2..ba3f0d0090ec31755414b5991dbc0ed75f808550 100644 (file)
@@ -30,6 +30,6 @@ void XonoticHUDChatDialog_fill(entity me)
                me.TD(me, 1, 2.6, e = makeXonoticSlider(5, 60, 5, "con_chattime"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "con_chatsound", _("Chat beep sound")));
+               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "con_chatsound", _("Chat beep sound")));
 }
 #endif
index b69a5869e79993603011a0646df5bb17cfa92b7c..b3cc7b423a4eec2fabb41eb12663a5d79453fa37 100644 (file)
@@ -19,9 +19,9 @@ void XonoticHUDEngineInfoDialog_fill(entity me)
        DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Engine info:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Engine info:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_engineinfo_framecounter_exponentialmovingaverage", _("Use an averaging algorithm for fps")));
+               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_engineinfo_framecounter_exponentialmovingaverage", _("Use an averaging algorithm for fps")));
 }
 #endif
index 3b706f0dc399e1a0b62000507e827807af1562b7..5eaf1d94059cd47d99972421f5c58ae18c3d42e2 100644 (file)
@@ -19,9 +19,9 @@ void XonoticHUDHealthArmorDialog_fill(entity me)
        DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_progressbar", _("Enable status bar")));
+               me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_progressbar", _("Enable status bar")));
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Status bar alignment:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Status bar alignment:")));
                        setDependent(e, "hud_panel_healtharmor_progressbar", 1, 1);
        me.TR(me);
                me.TDempty(me, 0.2);
@@ -34,7 +34,7 @@ void XonoticHUDHealthArmorDialog_fill(entity me)
                        me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_healtharmor_baralign", "3", _("Outward")));
                        setDependent(e, "hud_panel_healtharmor_progressbar", 1, 1);
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Icon alignment:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Icon alignment:")));
        me.TR(me);
                me.TDempty(me, 0.2);
                        me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_healtharmor_iconalign", "0", _("Left")));
@@ -42,6 +42,6 @@ void XonoticHUDHealthArmorDialog_fill(entity me)
                        me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_healtharmor_iconalign", "2", _("Inward")));
                        me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_healtharmor_iconalign", "3", _("Outward")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_flip", _("Flip health and armor positions")));
+               me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_flip", _("Flip health and armor positions")));
 }
 #endif
index 44b20294b7cc801eac215b0fd9421ab85702319c..da63a1e163af6ca130d3fe9a455f89ed631b09d8 100644 (file)
@@ -19,9 +19,9 @@ void XonoticHUDInfoMessagesDialog_fill(entity me)
        DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Info messages:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Info messages:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_infomessages_flip", _("Flip align")));
+               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_infomessages_flip", _("Flip align")));
 }
 #endif
index 1f26ab34aa92e3f909cc71a223dddc462e1d8be8..936a0fcb5983ddac9e97f65325b59872caaf47f8 100644 (file)
@@ -19,13 +19,13 @@ void XonoticHUDNotificationDialog_fill(entity me)
        DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Notifications:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Notifications:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_notify_print", _("Also print notifications to the console")));
+               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_notify_print", _("Also print notifications to the console")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_notify_flip", _("Flip notify order")));
+               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_notify_flip", _("Flip notify order")));
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Entry lifetime:")));
index 1926118761bec27d75b516228537f9ae4bff3cac..66c872b9f9589689b9030fb820d2c5a17a2fbc06 100644 (file)
@@ -29,7 +29,7 @@ void XonoticHUDPhysicsDialog_fill(entity me)
 
        me.TR(me);
                me.TD(me, 1, 1.4, e = makeXonoticCheckBox(0, "hud_panel_physics_progressbar", _("Status bar")));
-               me.TD(me, 1, 1.6, e = makeXonoticTextSlider("hud_panel_physics_baralign"));
+               me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_physics_baralign"));
                        e.addValue(e, _("Left align")   , "0");
                        e.addValue(e, _("Right align")  , "1");
                        e.addValue(e, _("Inward align") , "2");
@@ -37,11 +37,11 @@ void XonoticHUDPhysicsDialog_fill(entity me)
                        e.configureXonoticTextSliderValues(e);
                        setDependent(e, "hud_panel_physics_progressbar", 1, 3);
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_physics_flip", _("Flip speed/acceleration positions")));
+               me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_physics_flip", _("Flip speed/acceleration positions")));
 
 //speed
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Speed:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Speed:")));
                me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_physics_speed_vertical", _("Include vertical speed")));
        // me.TR(me);
                // me.TDempty(me, 0.2);
index 5846cfaaea502058331ca61be1d54c6428b73f9e..abab5d1f0d07758cc3e00f3c1f647f5d00354bd3 100644 (file)
@@ -19,9 +19,9 @@ void XonoticHUDPowerupsDialog_fill(entity me)
        DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_powerups_progressbar", _("Enable status bar")));
+               me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_powerups_progressbar", _("Enable status bar")));
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Status bar alignment:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Status bar alignment:")));
                        setDependent(e, "hud_panel_powerups_progressbar", 1, 1);
        me.TR(me);
                me.TDempty(me, 0.2);
@@ -34,7 +34,7 @@ void XonoticHUDPowerupsDialog_fill(entity me)
                        me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_powerups_baralign", "3", _("Outward")));
                        setDependent(e, "hud_panel_powerups_progressbar", 1, 1);
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Icon alignment:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Icon alignment:")));
        me.TR(me);
                me.TDempty(me, 0.2);
                        me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_powerups_iconalign", "0", _("Left")));
@@ -42,6 +42,6 @@ void XonoticHUDPowerupsDialog_fill(entity me)
                        me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_powerups_iconalign", "2", _("Inward")));
                        me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_powerups_iconalign", "3", _("Outward")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_powerups_flip", _("Flip strength and shield positions")));
+               me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_powerups_flip", _("Flip strength and shield positions")));
 }
 #endif
index 479c2bb333956c0cfaf275017e27dfd8b690f14e..3e72acc8b0ee737558ee8319bf7b14f56e8dbecf 100644 (file)
@@ -26,7 +26,7 @@ void XonoticHUDRadarDialog_fill(entity me)
        DIALOG_HUDPANEL_COMMON_NOTOGGLE();
 
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Radar:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Radar:")));
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Alpha:")));
index 38882160dee41f03397428a409a2504c86a31a38..778172aa1404f8a68ed5a6d582248021d683a193 100644 (file)
@@ -19,12 +19,12 @@ void XonoticHUDScoreDialog_fill(entity me)
        DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Score:"));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Score:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Rankings:"));
-               me.TD(me, 1, 2.6/3, e = makeXonoticRadioButton(1, "hud_panel_score_rankings", "0", "Off"));
-               me.TD(me, 1, 2.6/3, e = makeXonoticRadioButton(1, "hud_panel_score_rankings", "1", "And me"));
-               me.TD(me, 1, 2.6/3, e = makeXonoticRadioButton(1, "hud_panel_score_rankings", "2", "Pure"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Rankings:")));
+               me.TD(me, 1, 2.6/3, e = makeXonoticRadioButton(1, "hud_panel_score_rankings", "0", _("Off")));
+               me.TD(me, 1, 2.6/3, e = makeXonoticRadioButton(1, "hud_panel_score_rankings", "1", _("And me")));
+               me.TD(me, 1, 2.6/3, e = makeXonoticRadioButton(1, "hud_panel_score_rankings", "2", _("Pure")));
 }
 #endif
index 5f2fc5dd747b63cf8d73589ecc90b377c59fae7f..c1e9626dd983618f188d83a9b952601ace69e905 100644 (file)
@@ -19,9 +19,9 @@ void XonoticHUDTimerDialog_fill(entity me)
        DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Timer:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Timer:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_timer_increment", _("Show elapsed time")));
+               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_timer_increment", _("Show elapsed time")));
 }
 #endif
index d3d35c22a45b19a2cd975509e43f74f5f8ee470e..0b2c0ac07836656411e488b57797bdc7dad91bc9 100644 (file)
@@ -20,6 +20,6 @@ void XonoticHUDVoteDialog_fill(entity me)
 
        me.TR(me);
                me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Alpha after voting:")));
-                       me.TD(me, 1, 2.6, e = makeXonoticSlider(0.1, 1, 0.1, "hud_panel_vote_alreadyvoted_alpha"));
+               me.TD(me, 1, 2.6, e = makeXonoticSlider(0.1, 1, 0.1, "hud_panel_vote_alreadyvoted_alpha"));
 }
 #endif
index 0205a0fb0061f6afb55327e8c38bb4da390ece31..d0daa678422237378b21adc71800766c0627e481 100644 (file)
@@ -29,7 +29,7 @@ void XonoticHUDWeaponsDialog_fill(entity me)
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Fade effect:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Fade effect:")));
                setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0");
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_timeout_effect"))));
                                e.addValue(e, ZCTX(_("EF^None")),  "0");
@@ -39,7 +39,7 @@ void XonoticHUDWeaponsDialog_fill(entity me)
                                e.configureXonoticTextSliderValues(e);
                        setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0");
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Weapon icons:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Weapon icons:")));
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Show weapon ID as:")));
@@ -48,8 +48,8 @@ void XonoticHUDWeaponsDialog_fill(entity me)
                        me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "2", _("Bind")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_panel_weapons_accuracy", _("Show Accuracy")));
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_panel_weapons_ammo", _("Show Ammo")));
+               me.TD(me, 1, 3.8/2, e = makeXonoticCheckBox(0, "hud_panel_weapons_accuracy", _("Show Accuracy")));
+               me.TD(me, 1, 3.8/2, e = makeXonoticCheckBox(0, "hud_panel_weapons_ammo", _("Show Ammo")));
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Ammo bar color:")));
@@ -59,7 +59,7 @@ void XonoticHUDWeaponsDialog_fill(entity me)
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Ammo bar alpha:")));
-                       me.TD(me, 1, 2.6, e = makeXonoticSlider(0.1, 1, 0.1, "hud_panel_weapons_ammo_alpha"));
+                       me.TD(me, 1, 2.4, e = makeXonoticSlider(0.1, 1, 0.1, "hud_panel_weapons_ammo_alpha"));
                        setDependent(e, "hud_panel_weapons_ammo", 1, 1);
 }
 #endif
index e449fa5d4814a77b2cd9a933c0779a4ff48b6027..540e85e4f69ef1a9867be4115dca4e11f998e9f0 100644 (file)
@@ -20,7 +20,7 @@ void XonoticHUDExitDialog_fill(entity me)
        me.TR(me);
                me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Panel background defaults:")));
        me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
+               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Background:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_bg"))));
                                e.addValue(e, _("Disable"), "0");
                                e.addValue(e, "border_default", "border_default"); // this is a file name!
index a69de5b1bc16ef80421cd6d55f7d3b01488eef3f..483f3bfbd59b6b071ce940a1e8c2813b28dc0f3f 100644 (file)
@@ -1508,7 +1508,7 @@ Called when a client connects to the server
 string ColoredTeamName(float t);
 void DecodeLevelParms (void);
 //void dom_player_join_team(entity pl);
-void set_dom_state(void);
+void set_dom_state(entity e);
 void ClientConnect (void)
 {
        float t;
@@ -1751,7 +1751,7 @@ void ClientConnect (void)
                send_CSQC_teamnagger();
 
        if (g_domination)
-               set_dom_state();
+               set_dom_state(self);
 
        CheatInitClient();
 
index 0f80cdac0b259aaa47c5a23905d9b16aeff25fc8..d4be16ee17a1d4eb51b7c5267910ce8688484e90 100644 (file)
@@ -32,20 +32,16 @@ float pps_red;
 float pps_blue;
 float pps_yellow;
 float pps_pink;
-void set_dom_state(void)
+void set_dom_state(entity e)
 {
        // BIG ugly hack to make stat sending work
-       self.dom_total_pps = total_pps;
-       self.dom_pps_red = pps_red;
-       self.dom_pps_blue = pps_blue;
+       e.dom_total_pps = total_pps;
+       e.dom_pps_red = pps_red;
+       e.dom_pps_blue = pps_blue;
        if(c3 >= 0)
-       {
-               self.dom_pps_yellow = pps_yellow;
-       }
+               e.dom_pps_yellow = pps_yellow;
        if(c4 >= 0)
-       {
-               self.dom_pps_pink = pps_pink;
-       }
+               e.dom_pps_pink = pps_pink;
 }
 
 void() dom_controlpoint_setup;
@@ -178,13 +174,13 @@ void dompoint_captured ()
                        WaypointSprite_UpdateSprites(self.sprite, "dom-pink", "", "");
        }
 
-       FOR_EACH_PLAYER(self)
-               set_dom_state();
-
        WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_DOMPOINT, colormapPaletteColor(self.goalentity.team - 1, 0));
        WaypointSprite_Ping(self.sprite);
 
        self.captime = time;
+
+       FOR_EACH_PLAYER(head)
+               set_dom_state(head);
 };
 
 void AnimateDomPoint()