]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'remotes/origin/terencehill/newpanelhud' into terencehill/newpanelhud
authorterencehill <piuntn@gmail.com>
Sat, 18 Dec 2010 01:00:58 +0000 (02:00 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 18 Dec 2010 01:00:58 +0000 (02:00 +0100)
_hud_descriptions.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc
qcsrc/client/hud.qh
qcsrc/client/scoreboard.qc
qcsrc/menu/xonotic/dialog_hudpanel_physics.c

index 5234a3f2693f7a63535de4d73c9b569754d67f2b..7eb0de2f1525111a5f58959c816105dd4105577a 100644 (file)
@@ -198,7 +198,7 @@ seta hud_panel_chat_bg_alpha "" "if set to something else than \"\" = override d
 seta hud_panel_chat_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_chat_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 
-seta hud_panel_engineinfo "" "enable/disable this panel
+seta hud_panel_engineinfo "" "enable/disable this panel"
 seta hud_panel_engineinfo_pos "" "position of this base of the panel"
 seta hud_panel_engineinfo_size "" "size of this panel"
 seta hud_panel_engineinfo_bg "" "if set to something else than \"\" = override default background"
@@ -208,7 +208,7 @@ seta hud_panel_engineinfo_bg_alpha "" "if set to something else than \"\" = over
 seta hud_panel_engineinfo_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_engineinfo_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 
-seta hud_panel_infomessages "" "enable/disable this panel
+seta hud_panel_infomessages "" "enable/disable this panel"
 seta hud_panel_infomessages_pos "" "position of this base of the panel"
 seta hud_panel_infomessages_size "" "size of this panel"
 seta hud_panel_infomessages_bg "" "if set to something else than \"\" = override default background"
@@ -219,7 +219,7 @@ seta hud_panel_infomessages_bg_border "" "if set to something else than \"\" = o
 seta hud_panel_infomessages_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 seta hud_panel_infomessages_flip "" "1 = align the items to the right"
 
-seta hud_panel_physics "" "enable/disable this panel
+seta hud_panel_physics "" "enable/disable this panel, 1 = show only when spectating other players, 2 = show always"
 seta hud_panel_physics_pos "" "position of this base of the panel"
 seta hud_panel_physics_size "" "size of this panel"
 seta hud_panel_physics_bg "" "if set to something else than \"\" = override default background"
index 2824a3231e56e444a761048d66bc127d4983467f..64b6e33fa0bb91502aba5c7657bb48f4d8911a67 100644 (file)
@@ -60,19 +60,6 @@ float autocvar_cl_readpicture_force;
 float autocvar_cl_reticle_item_nex;
 float autocvar_cl_reticle_item_normal;
 float autocvar_cl_reticle_stretch;
-float autocvar_cl_showacceleration;
-float autocvar_cl_showacceleration_alpha;
-string autocvar_cl_showacceleration_color;
-float autocvar_cl_showacceleration_color_custom;
-float autocvar_cl_showacceleration_position;
-float autocvar_cl_showacceleration_scale;
-float autocvar_cl_showacceleration_size;
-float autocvar_cl_showacceleration_z;
-float autocvar_cl_showspeed;
-float autocvar_cl_showspeed_position;
-float autocvar_cl_showspeed_size;
-float autocvar_cl_showspeed_unit;
-float autocvar_cl_showspeed_z;
 float autocvar_cl_sound_maptime_warning;
 float autocvar_cl_stripcolorcodes;
 var float autocvar_cl_vehicle_spiderbot_cross_alpha = 0.6;
index 0551fd284881d141f1931a2c73b40f0d8a248391..1504a0388d65352f831466c06a847b99ccdb907e 100644 (file)
@@ -569,7 +569,7 @@ void HUD_Panel_HlBorder(float myBorder, vector color, float alpha)
 #define HUD_Panel_DrawBg(alpha)\
 if(panel_bg != "0")\
        draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * alpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER));\
-if(highlightedPanel_prev == hud_configure_active_panel && autocvar__hud_configure)\
+if(highlightedPanel == hud_configure_active_panel && autocvar__hud_configure)\
 {\
        HUD_Panel_HlBorder(panel_bg_border + 1.5 * hlBorderSize, '0 0.5 1', 0.25 * (1 - autocvar__menu_alpha) * alpha);\
 } ENDS_WITH_CURLY_BRACE
@@ -966,15 +966,11 @@ void HUD_Panel_SetPosSize(vector mySize)
        cvar_set(strcat("hud_panel_", panel_name, "_pos"), s);
 }
 
-float mouseClicked;
-float prevMouseClicked; // previous state
-float prevMouseClickedTime; // time during previous mouse click, to check for doubleclicks
-vector prevMouseClickedPos; // pos during previous mouse click, to check for doubleclicks
-
 float pressed_key_time;
+vector highlightedPanel_initial_pos, highlightedPanel_initial_size;
 void HUD_Panel_Arrow_Action(float nPrimary)
 {
-       if (highlightedPanel_prev == -1 || mouseClicked)
+       if (highlightedPanel == -1)
                return;
 
        hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && autocvar_hud_configure_checkcollisions);
@@ -1009,13 +1005,10 @@ void HUD_Panel_Arrow_Action(float nPrimary)
                        step = (step / 64) * (1 + 2 * (time - pressed_key_time));
        }
 
-       highlightedPanel = highlightedPanel_prev;
-
        HUD_Panel_UpdatePosSizeForId(highlightedPanel);
 
-       vector prev_pos, prev_size;
-       prev_pos = panel_pos;
-       prev_size = panel_size;
+       highlightedPanel_initial_pos = panel_pos;
+       highlightedPanel_initial_size = panel_size;
 
        if (hudShiftState & S_ALT) // resize
        {
@@ -1073,15 +1066,20 @@ void HUD_Panel_Arrow_Action(float nPrimary)
 
        HUD_Panel_UpdatePosSizeForId(highlightedPanel);
 
-       if (prev_pos != panel_pos || prev_size != panel_size)
+       if (highlightedPanel_initial_pos != panel_pos || highlightedPanel_initial_size != panel_size)
        {
                // backup!
-               panel_pos_backup = prev_pos;
-               panel_size_backup = prev_size;
+               panel_pos_backup = highlightedPanel_initial_pos;
+               panel_size_backup = highlightedPanel_initial_size;
                highlightedPanel_backup = highlightedPanel;
        }
 }
 
+float mouseClicked;
+float prevMouseClicked; // previous state
+float prevMouseClickedTime; // time during previous mouse click, to check for doubleclicks
+vector prevMouseClickedPos; // pos during previous mouse click, to check for doubleclicks
+
 void HUD_Panel_EnableMenu();
 float tab_panels[HUD_PANEL_NUM];
 float tab_panel, tab_backward;
@@ -1132,8 +1130,8 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
                        {
                                //switch to selected panel
                                highlightedPanel = tab_panel;
-                               highlightedPanel_prev = tab_panel;
-                               HUD_Panel_FirstInDrawQ(highlightedPanel_prev);
+                               highlightedAction = 0;
+                               HUD_Panel_FirstInDrawQ(highlightedPanel);
                        }
                        tab_panel = -1;
                        reset_tab_panels();
@@ -1173,11 +1171,11 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
                float old_tab_panel = tab_panel;
                if (tab_panel == -1) //first press of TAB
                {
-                       if (highlightedPanel_prev != -1)
-                               HUD_Panel_UpdatePosSizeForId(highlightedPanel_prev)
+                       if (highlightedPanel != -1)
+                               HUD_Panel_UpdatePosSizeForId(highlightedPanel)
                        else
                                panel_pos = '0 0 0';
-                       starting_panel = highlightedPanel_prev; //can be -1, it means no starting panel
+                       starting_panel = highlightedPanel; //can be -1, it means no starting panel
                        tab_panel_pos = panel_pos; //to compute level
                }
                else
@@ -1248,9 +1246,9 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
                if (bInputType == 1 || mouseClicked)
                        return true;
 
-               if (highlightedPanel_prev != -1)
+               if (highlightedPanel != -1)
                {
-                       HUD_Panel_GetName(highlightedPanel_prev);
+                       HUD_Panel_GetName(highlightedPanel);
                        cvar_set(strcat("hud_panel_", panel_name), ftos(!(panel_enabled)));
                }
                else
@@ -1261,11 +1259,11 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
                if (bInputType == 1 || mouseClicked)
                        return true;
 
-               if (highlightedPanel_prev != -1)
+               if (highlightedPanel != -1)
                {
-                       HUD_Panel_UpdatePosSizeForId(highlightedPanel_prev);
+                       HUD_Panel_UpdatePosSizeForId(highlightedPanel);
                        panel_size_copied = panel_size;
-                       highlightedPanel_copied = highlightedPanel_prev;
+                       highlightedPanel_copied = highlightedPanel;
                }
        }
        else if(nPrimary == 'v' && hudShiftState & S_CTRL) // past copied size on the highlighted panel
@@ -1273,10 +1271,10 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
                if (bInputType == 1 || mouseClicked)
                        return true;
 
-               if (highlightedPanel_copied == -1 || highlightedPanel_prev == -1)
+               if (highlightedPanel_copied == -1 || highlightedPanel == -1)
                        return true;
 
-               HUD_Panel_UpdatePosSizeForId(highlightedPanel_prev);
+               HUD_Panel_UpdatePosSizeForId(highlightedPanel);
 
                // reduce size if it'd go beyond screen boundaries
                vector tmp_size = panel_size_copied;
@@ -1291,10 +1289,10 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
                // backup first!
                panel_pos_backup = panel_pos;
                panel_size_backup = panel_size;
-               highlightedPanel_backup = highlightedPanel_prev;
+               highlightedPanel_backup = highlightedPanel;
 
                s = strcat(ftos(tmp_size_x/vid_conwidth), " ", ftos(tmp_size_y/vid_conheight));
-               HUD_Panel_GetName(highlightedPanel_prev);
+               HUD_Panel_GetName(highlightedPanel);
                cvar_set(strcat("hud_panel_", panel_name, "_size"), s);
        }
        else if(nPrimary == 'z' && hudShiftState & S_CTRL) // undo last action
@@ -1322,17 +1320,15 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
                else if (pressed_key_time == 0)
                        pressed_key_time = time;
 
-               HUD_Panel_Arrow_Action(nPrimary); //move or resize panel
+               if (!mouseClicked)
+                       HUD_Panel_Arrow_Action(nPrimary); //move or resize panel
        }
        else if(nPrimary == K_ENTER || nPrimary == K_SPACE || nPrimary == K_KP_ENTER)
        {
                if (bInputType == 1)
                        return true;
-               if (highlightedPanel_prev != -1)
-               {
-                       highlightedPanel = highlightedPanel_prev;
+               if (highlightedPanel != -1)
                        HUD_Panel_EnableMenu();
-               }
        }
        else if(hit_con_bind)
                return false;
@@ -1340,7 +1336,7 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
        return true;
 }
 
-float HUD_Panel_HighlightCheck()
+float HUD_Panel_Check_Mouse_Pos()
 {
        float i, j, border;
 
@@ -1488,11 +1484,9 @@ void HUD_Panel_Highlight()
                        panel_click_resizeorigin = panel_pos;
                        return;
                }
-               else
-               {
-                       highlightedPanel_prev = -1;
-               }
        }
+       highlightedPanel = -1;
+       highlightedAction = 0;
 }
 
 void HUD_Panel_EnableMenu()
@@ -1502,8 +1496,7 @@ void HUD_Panel_EnableMenu()
        HUD_Panel_GetName(highlightedPanel);
        localcmd("menu_showhudoptions ", panel_name, "\n");
 }
-float highlightcheck;
-vector prev_pos, prev_size;
+float mouse_over_panel;
 void HUD_Panel_Mouse()
 {
        // TODO: needs better check... is there any float that contains the current state of the menu? _menu_alpha isn't apparently updated the frame the menu gets enabled
@@ -1522,13 +1515,6 @@ void HUD_Panel_Mouse()
        if(menu_enabled == 1 || (menu_enabled == 2 && !hud_fade_alpha))
                return;
 
-       if(mouseClicked == 0 && menu_enabled != 2 && highlightedPanel >= 0) { // don't reset these variables in menu_enabled mode 2!
-               highlightedPanel = -1;
-               highlightedAction = 0;
-       }
-       if(highlightedPanel != -1)
-               highlightedPanel_prev = highlightedPanel;
-
        mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed;
 
        mousepos_x = bound(0, mousepos_x, vid_conwidth);
@@ -1536,35 +1522,53 @@ void HUD_Panel_Mouse()
 
        if(mouseClicked)
        {
-               if (tab_panel != -1)
-               {
-                       //stop ctrl-tab selection
-                       tab_panel = -1;
-                       reset_tab_panels();
-               }
                if(prevMouseClicked == 0)
                {
+                       if (tab_panel != -1)
+                       {
+                               //stop ctrl-tab selection
+                               tab_panel = -1;
+                               reset_tab_panels();
+                       }
                        HUD_Panel_Highlight(); // sets highlightedPanel, highlightedAction, panel_click_distance, panel_click_resizeorigin
                                                                        // and calls HUD_Panel_UpdatePosSizeForId() for the highlighted panel
-                       prev_pos = panel_pos;
-                       prev_size = panel_size;
+                       if (highlightedPanel != -1)
+                       {
+                               highlightedPanel_initial_pos = panel_pos;
+                               highlightedPanel_initial_size = panel_size;
+                       }
+                       // doubleclick check
+                       if (time - prevMouseClickedTime < 0.4 && highlightedPanel != -1 && prevMouseClickedPos == mousepos)
+                       {
+                               mouseClicked = 0; // to prevent spam, I guess.
+                               HUD_Panel_EnableMenu();
+                       }
+                       else
+                       {
+                               prevMouseClickedTime = time;
+                               prevMouseClickedPos = mousepos;
+                       }
                }
                else
                        HUD_Panel_UpdatePosSizeForId(highlightedPanel);
 
-               if (prev_pos != panel_pos || prev_size != panel_size)
+               if (highlightedPanel != -1)
                {
-                       hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && autocvar_hud_configure_checkcollisions);
-                       // backup!
-                       panel_pos_backup = prev_pos;
-                       panel_size_backup = prev_size;
-                       highlightedPanel_backup = highlightedPanel;
+                       drawfill(panel_pos - '1 1 0' * panel_bg_border, panel_size + '2 2 0' * panel_bg_border, '1 1 1', .1, DRAWFLAG_NORMAL);
+                       if (highlightedPanel_initial_pos != panel_pos || highlightedPanel_initial_size != panel_size)
+                       {
+                               hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && autocvar_hud_configure_checkcollisions);
+                               // backup!
+                               panel_pos_backup = highlightedPanel_initial_pos;
+                               panel_size_backup = highlightedPanel_initial_size;
+                               highlightedPanel_backup = highlightedPanel;
+                       }
+                       else
+                               // in case the clicked panel is inside another panel and we aren't
+                               // moving it, avoid the immediate "fix" of its position/size
+                               // (often unwanted and hateful) by disabling collisions check
+                               hud_configure_checkcollisions = false;
                }
-               else
-                       // in case the clicked panel is inside another panel and we aren't
-                       // moving it, avoid the immediate "fix" of its position/size
-                       // (often unwanted and hateful) by disabling collisions check
-                       hud_configure_checkcollisions = false;
 
                if(highlightedAction == 1)
                        HUD_Panel_SetPos(mousepos - panel_click_distance);
@@ -1586,33 +1590,21 @@ void HUD_Panel_Mouse()
                        }
                        HUD_Panel_SetPosSize(mySize);
                }
-
-               // doubleclick check
-               if(time - prevMouseClickedTime < 0.4 && prevMouseClicked == 0 && prevMouseClickedPos == mousepos && highlightedPanel >= 0)
-               {
-                       mouseClicked = 0; // to prevent spam, I guess.
-                       HUD_Panel_EnableMenu();
-                       return;
-               }
-               if(prevMouseClicked == 0)
-               {
-                       prevMouseClickedTime = time;
-                       prevMouseClickedPos = mousepos;
-               }
        }
        else
        {
-               highlightcheck = HUD_Panel_HighlightCheck();
+               mouse_over_panel = HUD_Panel_Check_Mouse_Pos();
+               if (mouse_over_panel && tab_panel == -1)
+                       drawfill(panel_pos - '1 1 0' * panel_bg_border, panel_size + '2 2 0' * panel_bg_border, '1 1 1', .1, DRAWFLAG_NORMAL);
        }
-       // draw cursor after performing move/resize to have the panel pos/size updated before highlightcheck
-       vector cursorsize;
-       cursorsize = '32 32 0';
+       // draw cursor after performing move/resize to have the panel pos/size updated before mouse_over_panel
+       const vector cursorsize = '32 32 0';
 
-       if(highlightcheck == 0)
+       if(!mouse_over_panel)
                drawpic(mousepos, strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), cursorsize, '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
-       else if(highlightcheck == 1)
+       else if(mouse_over_panel == 1)
                drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_move.tga"), cursorsize, '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
-       else if(highlightcheck == 2)
+       else if(mouse_over_panel == 2)
                drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_resize.tga"), cursorsize, '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
        else
                drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_resize2.tga"), cursorsize, '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
@@ -3624,6 +3616,7 @@ void HUD_Score(void)
        if(!autocvar__hud_configure)
        {
                if(!autocvar_hud_panel_score) return;
+               if(spectatee_status == -1 && (gametype == GAME_RACE || gametype == GAME_CTS)) return;
        }
 
     hud_configure_active_panel = HUD_PANEL_SCORE;
@@ -3686,15 +3679,16 @@ void HUD_Score(void)
                {
 #define SCOREPANEL_MAX_ENTRIES 6
 #define SCOREPANEL_ASPECTRATIO 2
-                       float entries = bound(1, floor(SCOREPANEL_MAX_ENTRIES * mySize_y/mySize_x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES);
-                       float height = mySize_y/entries;
-                       vector fontsize = '0.9 0.9 0' * height;
+                       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';
 
-                       float name_size = mySize_x*0.75;
+                       const float name_size = mySize_x*0.75;
+                       const float highlight_alpha = 0.2;
                        float i, me_printed;
                        string s;
                        if (autocvar__hud_configure)
@@ -3708,7 +3702,7 @@ void HUD_Score(void)
                                        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, 0.3 * panel_fg_alpha, DRAWFLAG_NORMAL);
+                                               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;
                                        }
@@ -3753,7 +3747,7 @@ void HUD_Score(void)
                                        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, 0.3 * panel_fg_alpha, DRAWFLAG_NORMAL);
+                                       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);
@@ -5286,6 +5280,7 @@ void HUD_Physics(void)
        if(!autocvar_hud_panel_physics)
        {
                if(!autocvar__hud_configure) return;
+               if(spectatee_status <= 0 && autocvar_hud_panel_physics < 2) return;
        }
 
     hud_configure_active_panel = HUD_PANEL_PHYSICS;
@@ -5303,7 +5298,7 @@ void HUD_Physics(void)
        float speed, conversion_factor;
        string unit;
 
-       switch(autocvar_cl_showspeed_unit)
+       switch(autocvar_hud_panel_physics_speed_unit)
        {
                default:
                case 1:
index fafede518cc1ecd5e6a5de383baa73795e7ecb80..904a8dc22d6a0a266fe69c658cb5d9dd4213b9b3 100644 (file)
@@ -10,7 +10,6 @@ vector panel_click_distance; // mouse cursor distance from the top left corner o
 vector panel_click_resizeorigin; // coordinates for opposite point when resizing
 float resizeCorner; // 1 = topleft, 2 = topright, 3 = bottomleft, 4 = bottomright
 var float highlightedPanel = -1;
-var float highlightedPanel_prev = -1;
 float highlightedAction; // 0 = nothing, 1 = move, 2 = resize
 
 const float BORDER_MULTIPLIER = 0.25;
index 7de456043afd6dad71a155ffaabca3d3e9c0ebf3..2369a604771a616a01a54e394cedfcc37d97a6a2 100644 (file)
@@ -885,8 +885,6 @@ float HUD_WouldDrawScoreboard() {
                return 1;
        else if (spectatee_status != -1 && getstati(STAT_HEALTH) <= 0 && autocvar_cl_deathscoreboard && gametype != GAME_CTS)
                return 1;
-    else if (spectatee_status == -1)
-        return 1;
        else if (scoreboard_showscores_force)
                return 1;
        return 0;
index e00524167bd0c9d4ccf353e77d5a6ae990150910..4ca6144f808a243d954366c915e0fd1bf1084fc1 100644 (file)
@@ -19,7 +19,11 @@ void XonoticHUDPhysicsDialog_fill(entity me)
        float i;
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_physics", "Enable panel"));
+               me.TD(me, 1, 2, e = makeXonoticTextSlider("hud_panel_physics"));
+                       e.addValue(e, "Panel disabled", "0");
+                       e.addValue(e, "Panel enabled when spectating", "1");
+                       e.addValue(e, "Panel always enabled", "2");
+                       e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
                        me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));