]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud.qc
Merge branch 'master' into Mario/showspecs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud.qc
index 54c23eff45046f1229a44292099a4eaafe0c09a8..2aaa81bd512e48e56b4dadbc1e00d1244d8d52cc 100644 (file)
@@ -591,7 +591,6 @@ void HUD_Weapons(void)
                rows = table_size.y;
                weapon_size.x = padded_panel_size.x / columns;
                weapon_size.y = padded_panel_size.y / rows;
-               vertical_order = (columns >= rows);
 
                // NOTE: although weapons should aways look the same even if onlyowned is enabled,
                // we enlarge them a bit when possible to better match the desired aspect ratio
@@ -603,6 +602,7 @@ void HUD_Weapons(void)
                        rows = ceil(weapon_count / columns);
                        weapon_size.y = min(padded_panel_size.y / rows, weapon_size.x / aspect);
                        weapon_size.x = min(padded_panel_size.x / columns, aspect * weapon_size.y);
+                       vertical_order = false;
                }
                else
                {
@@ -611,6 +611,7 @@ void HUD_Weapons(void)
                        columns = ceil(weapon_count / rows);
                        weapon_size.x = min(padded_panel_size.x / columns, aspect * weapon_size.y);
                        weapon_size.y = min(padded_panel_size.y / rows, weapon_size.x / aspect);
+                       vertical_order = true;
                }
 
                // reduce size of the panel
@@ -753,7 +754,7 @@ void HUD_Weapons(void)
                rows = table_size.y;
                weapon_size.x = panel_size.x / columns;
                weapon_size.y = panel_size.y / rows;
-               vertical_order = (columns >= rows);
+               vertical_order = (panel_size.x / panel_size.y >= aspect);
        }
 
        // calculate position/size for visual bar displaying ammount of ammo status
@@ -3832,6 +3833,25 @@ void HUD_InfoMessages(void)
                        drawInfoMessage(s);
                }
 
+               if(autocvar_cl_showspectators)
+               if(num_spectators)
+               //if(spectatee_status != -1)
+               {
+                       s = ((spectatee_status) ? _("^1Spectating this player:") : _("^1Spectating you:"));
+                       //drawInfoMessage(s)
+                       float limit = min(num_spectators, MAX_SPECTATORS);
+                       float i;
+                       for(i = 0; i < limit; ++i)
+                       {
+                               float slot = spectatorlist[i];
+                               if(i == 0)
+                                       s = strcat(s, " ^3", GetPlayerName(slot));
+                               else
+                                       s = strcat("^3", GetPlayerName(slot));
+                               drawInfoMessage(s);
+                       }
+               }
+
                string blinkcolor;
                if(time % 1 >= 0.5)
                        blinkcolor = "^1";
@@ -4285,12 +4305,12 @@ void HUD_CenterPrint (void)
        {
                if(!autocvar_hud_panel_centerprint) return;
 
-               if (hud_configure_prev && hud_configure_prev != -1)
+               if(hud_configure_prev)
                        reset_centerprint_messages();
        }
        else
        {
-               if (!hud_configure_prev)
+               if(!hud_configure_prev)
                        reset_centerprint_messages();
                if (time > hud_configure_cp_generation_time)
                {