]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/scoreboard.qc
Forbid opening scoreboard team selection when the game is over
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / scoreboard.qc
index dfab7d61b7c3fae437bd9677357a26be1ba648aa..76f97fd0e548bec204c9d7060a236b6ad0af7ed3 100644 (file)
@@ -180,7 +180,7 @@ void Scoreboard_UI_Enable(int mode)
 {
        if (mode == 1)
        {
-               if (scoreboard_ui_enabled == 2 || !teamplay)
+               if (scoreboard_ui_enabled == 2 || !teamplay || intermission)
                        return;
 
                // release player's pressed keys as they aren't released elsewhere
@@ -272,13 +272,29 @@ float HUD_Scoreboard_InputEvent(float bInputType, float nPrimary, float nSeconda
                if (!key_pressed)
                        return true;
                if (scoreboard_ui_enabled == 2)
-                       goto downarrow_action;
+               {
+                       if (hudShiftState & S_SHIFT)
+                               goto uparrow_action;
+                       else
+                               goto downarrow_action;
+               }
 
-               ++scoreboard_selected_panel;
-               if (scoreboard_selected_panel == SB_PANEL_RANKINGS && !rankings_cnt)
+               if (hudShiftState & S_SHIFT)
+               {
+                       --scoreboard_selected_panel;
+                       if (scoreboard_selected_panel == SB_PANEL_RANKINGS && !rankings_cnt)
+                               --scoreboard_selected_panel;
+                       if (scoreboard_selected_panel < SB_PANEL_FIRST)
+                               scoreboard_selected_panel = SB_PANEL_MAX;
+               }
+               else
+               {
                        ++scoreboard_selected_panel;
-               if (scoreboard_selected_panel >= SB_PANEL_MAX)
-                       scoreboard_selected_panel = 1;
+                       if (scoreboard_selected_panel == SB_PANEL_RANKINGS && !rankings_cnt)
+                               ++scoreboard_selected_panel;
+                       if (scoreboard_selected_panel > SB_PANEL_MAX)
+                               scoreboard_selected_panel = SB_PANEL_FIRST;
+               }
 
                scoreboard_selected_panel_time = time;
        }
@@ -344,6 +360,7 @@ float HUD_Scoreboard_InputEvent(float bInputType, float nPrimary, float nSeconda
        {
                if (!key_pressed)
                        return true;
+               LABEL(uparrow_action);
                if (scoreboard_selected_panel == SB_PANEL_SCOREBOARD)
                {
                        if (scoreboard_ui_enabled == 2)
@@ -1536,7 +1553,14 @@ vector Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_size)
 bool Scoreboard_WouldDraw()
 {
        if (scoreboard_ui_enabled)
+       {
+               if (intermission && scoreboard_ui_enabled == 2)
+               {
+                       HUD_Scoreboard_UI_Disable();
+                       return false;
+               }
                return true;
+       }
        else if (MUTATOR_CALLHOOK(DrawScoreboard))
                return false;
        else if (QuickMenu_IsOpened())