]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add cvars to enable / disable the dynamic hud effects for each panel
authorterencehill <piuntn@gmail.com>
Tue, 12 Apr 2016 14:25:32 +0000 (16:25 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 12 Apr 2016 14:25:32 +0000 (16:25 +0200)
30 files changed:
_hud_common.cfg
defaultXonotic.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud/panel/ammo.qc
qcsrc/client/hud/panel/centerprint.qc
qcsrc/client/hud/panel/chat.qc
qcsrc/client/hud/panel/engineinfo.qc
qcsrc/client/hud/panel/healtharmor.qc
qcsrc/client/hud/panel/infomessages.qc
qcsrc/client/hud/panel/modicons.qc
qcsrc/client/hud/panel/notify.qc
qcsrc/client/hud/panel/physics.qc
qcsrc/client/hud/panel/powerups.qc
qcsrc/client/hud/panel/pressedkeys.qc
qcsrc/client/hud/panel/racetimer.qc
qcsrc/client/hud/panel/radar.qc
qcsrc/client/hud/panel/score.qc
qcsrc/client/hud/panel/timer.qc
qcsrc/client/hud/panel/vote.qc
qcsrc/client/hud/panel/weapons.qc
qcsrc/client/scoreboard.qc
qcsrc/common/minigames/cl_minigames_hud.qc
qcsrc/common/minigames/minigame/bd.qc
qcsrc/common/minigames/minigame/c4.qc
qcsrc/common/minigames/minigame/nmm.qc
qcsrc/common/minigames/minigame/pong.qc
qcsrc/common/minigames/minigame/pp.qc
qcsrc/common/minigames/minigame/ps.qc
qcsrc/common/minigames/minigame/snake.qc
qcsrc/common/minigames/minigame/ttt.qc

index d599c4711be5b0abd735ad4974349dd920d9d981..0f3f24ba19a43d299e7ca9f8a64fd61dc1b29692 100644 (file)
@@ -45,6 +45,24 @@ seta hud_panel_mapvote          1 "enable this panel"
 seta hud_panel_itemstime        2 "enable this panel, 1 = show when spectating, 2 = even playing in warmup stage"
 seta hud_panel_quickmenu        1 "enable this panel"
 
+seta hud_panel_weapons_dynamichud          1 "apply the dynamic hud effects to this panel"
+seta hud_panel_ammo_dynamichud             1 "apply the dynamic hud effects to this panel"
+seta hud_panel_powerups_dynamichud         1 "apply the dynamic hud effects to this panel"
+seta hud_panel_healtharmor_dynamichud      1 "apply the dynamic hud effects to this panel"
+seta hud_panel_notify_dynamichud           1 "apply the dynamic hud effects to this panel"
+seta hud_panel_timer_dynamichud            1 "apply the dynamic hud effects to this panel"
+seta hud_panel_radar_dynamichud            1 "apply the dynamic hud effects to this panel"
+seta hud_panel_score_dynamichud            1 "apply the dynamic hud effects to this panel"
+seta hud_panel_racetimer_dynamichud        1 "apply the dynamic hud effects to this panel"
+seta hud_panel_vote_dynamichud             1 "apply the dynamic hud effects to this panel"
+seta hud_panel_modicons_dynamichud         1 "apply the dynamic hud effects to this panel"
+seta hud_panel_pressedkeys_dynamichud      1 "apply the dynamic hud effects to this panel"
+seta hud_panel_engineinfo_dynamichud       1 "apply the dynamic hud effects to this panel"
+seta hud_panel_infomessages_dynamichud     0 "apply the dynamic hud effects to this panel"
+seta hud_panel_physics_dynamichud          1 "apply the dynamic hud effects to this panel"
+seta hud_panel_centerprint_dynamichud      1 "apply the dynamic hud effects to this panel"
+seta hud_panel_itemstime_dynamichud        1 "apply the dynamic hud effects to this panel"
+
 seta hud_panel_weapons_ammo_full_shells 60 "show 100% of the status bar at this ammo count"
 seta hud_panel_weapons_ammo_full_nails 320 "show 100% of the status bar at this ammo count"
 seta hud_panel_weapons_ammo_full_cells 180 "show 100% of the status bar at this ammo count"
index e1531205ec0ced6ebe6f48f9b599e680eaaf7fb1..907fd812dcd33317030ee96051e6945ff5cab103 100644 (file)
@@ -850,6 +850,7 @@ seta scoreboard_offset_right 0.15 "how far (by percent) the scoreboard is offset
 seta scoreboard_offset_vertical 0.05 "how far (by percent) the scoreboard is offset from the top and bottom of the screen"
 seta scoreboard_bg_scale 0.25 "scale for the tiled scoreboard background"
 seta scoreboard_respawntime_decimals 1 "decimal places to show for the respawntime countdown display on the scoreboard"
+seta scoreboard_dynamichud 1 "apply the dynamic hud effects to the scoreboard"
 
 seta accuracy_color_levels "0 20 100" "accuracy values at which a specified color (accuracy_color<X>) will be used. If your accuracy is between 2 of these values then a mix of the Xth and X+1th colors will be used. You can specify up to 10 values, in increasing order"
 seta accuracy_color0 "1 0 0"
index f1e3b70e9490f1bb88161e92588e1a2b015ec008..46db647dac65441848eede192f2c341029f57670 100644 (file)
@@ -193,6 +193,23 @@ string autocvar_hud_dock;
 float autocvar_hud_dock_alpha;
 string autocvar_hud_dock_color;
 bool autocvar_hud_dock_color_team;
+bool autocvar_hud_panel_weapons_dynamichud      = true;
+bool autocvar_hud_panel_ammo_dynamichud         = true;
+bool autocvar_hud_panel_powerups_dynamichud     = true;
+bool autocvar_hud_panel_healtharmor_dynamichud  = true;
+bool autocvar_hud_panel_notify_dynamichud       = true;
+bool autocvar_hud_panel_timer_dynamichud        = true;
+bool autocvar_hud_panel_radar_dynamichud        = true;
+bool autocvar_hud_panel_score_dynamichud        = true;
+bool autocvar_hud_panel_racetimer_dynamichud    = true;
+bool autocvar_hud_panel_vote_dynamichud         = true;
+bool autocvar_hud_panel_modicons_dynamichud     = true;
+bool autocvar_hud_panel_pressedkeys_dynamichud  = true;
+bool autocvar_hud_panel_engineinfo_dynamichud   = true;
+bool autocvar_hud_panel_infomessages_dynamichud = false;
+bool autocvar_hud_panel_physics_dynamichud      = true;
+bool autocvar_hud_panel_centerprint_dynamichud  = true;
+bool autocvar_hud_panel_itemstime_dynamichud    = true;
 bool autocvar_hud_panel_ammo;
 bool autocvar_hud_panel_ammo_iconalign;
 int autocvar_hud_panel_ammo_maxammo;
@@ -399,6 +416,7 @@ float autocvar_scoreboard_offset_left;
 float autocvar_scoreboard_offset_right;
 float autocvar_scoreboard_offset_vertical;
 float autocvar_scoreboard_respawntime_decimals;
+float autocvar_scoreboard_dynamichud = 1;
 bool autocvar_v_flipped;
 float autocvar_vid_conheight;
 float autocvar_vid_conwidth;
index e8a702d6b34ee80684521e43f072fdcfcd2a7e39..5c45ff0f331a1544be55bf6b4f3a262d7f704022 100644 (file)
@@ -110,7 +110,10 @@ void HUD_Ammo()
        pos = panel_pos;
        mySize = panel_size;
 
-       HUD_Scale_Enable();
+       if (autocvar_hud_panel_ammo_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        if(panel_bg_padding)
        {
index 23c383e45c3e22e856fb4e66f1bca7bda003bd40..afda329838c623f9d1e8b98712de71b82d8f5014 100644 (file)
@@ -186,7 +186,10 @@ void HUD_CenterPrint ()
                }
        }
 
-       HUD_Scale_Enable();
+       if (autocvar_hud_panel_centerprint_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
 
        if (!centerprint_showing)
index d8945991ece5c7b28506a178526a11b7965b3a2b..a27e7b9070f109e2786edde44affdf1ff7f9193d 100644 (file)
@@ -54,6 +54,7 @@ void HUD_Chat()
        pos = panel_pos;
        mySize = panel_size;
 
+       // chat messages don't scale properly since they are displayed directly by the engine
        HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
 
index ce425a2def193c6b14e86a6ef8e2f8f71ffa057f..773c751d82680fd826b00ece67514a3891134935 100644 (file)
@@ -23,7 +23,10 @@ void HUD_EngineInfo()
        pos = panel_pos;
        mySize = panel_size;
 
-       HUD_Scale_Enable();
+       if (autocvar_hud_panel_engineinfo_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        if(panel_bg_padding)
        {
index 099d9f92209ae3b270dfb4a2133f79ea668aabcc..bc4291a948648e8eb5f8cf843c683cdc17d7ba1c 100644 (file)
@@ -62,7 +62,10 @@ void HUD_HealthArmor()
        pos = panel_pos;
        mySize = panel_size;
 
-       HUD_Scale_Enable();
+       if (autocvar_hud_panel_healtharmor_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        if(panel_bg_padding)
        {
index 2f072b2b55489f6c2fe803c825df0628b1ccf483..a197963e75492145545a315b9de468585059cdce 100644 (file)
@@ -23,7 +23,10 @@ void HUD_InfoMessages()
        pos = panel_pos;
        mySize = panel_size;
 
-       HUD_Scale_Enable();
+       if (autocvar_hud_panel_infomessages_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        if(panel_bg_padding)
        {
index 957fe1f3941d2823d75b7ac8a4d4f16e0995c0a6..f442d2df5253b62d1a86dd617d119c6572c6adde 100644 (file)
@@ -769,7 +769,10 @@ void HUD_ModIcons()
        else
                mod_alpha = bound(0, 1 - (time - mod_change) * 2, 1);
 
-       HUD_Scale_Enable();
+       if (autocvar_hud_panel_modicons_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        if(mod_alpha)
                HUD_Panel_DrawBg(mod_alpha);
 
index 720b7aeda561c0488f327daa24a7c9951e1e7694..a5e923825a989fc13e9b76b9c077de5b4ce97c31 100644 (file)
@@ -48,7 +48,10 @@ void HUD_Notify()
                        return;
 
        HUD_Panel_UpdateCvars();
-       HUD_Scale_Enable();
+       if (autocvar_hud_panel_notify_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
 
        if (!autocvar__hud_configure)
index 741c305b41af7552bb6b86caa4e9007b32ea69a8..371a9f344bf2990bfda62a2a3730d771f6f4d60b 100644 (file)
@@ -21,7 +21,10 @@ void HUD_Physics()
 
        draw_beginBoldFont();
 
-       HUD_Scale_Enable();
+       if (autocvar_hud_panel_physics_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        if(panel_bg_padding)
        {
index 8abe1fc5a1b576cadca6222440772092320a0114..223bf72ce8efae4a679f8c6405673deaf1aac283 100644 (file)
@@ -109,7 +109,10 @@ void HUD_Powerups()
 
        // Draw panel background
        HUD_Panel_UpdateCvars();
-       HUD_Scale_Enable();
+       if (autocvar_hud_panel_powerups_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
 
        // Set drawing area
index 9989c4fc847dfb740281c798eb229dac5aa24b7d..d0a4f39fdfd8fc956ce202376af7f5b55f90ac17 100644 (file)
@@ -13,7 +13,10 @@ void HUD_PressedKeys()
        pos = panel_pos;
        mySize = panel_size;
 
-       HUD_Scale_Enable();
+       if (autocvar_hud_panel_pressedkeys_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        if(panel_bg_padding)
        {
index 3ad0bb0f79e8c1216e4f91e7b6c05f643e89b66c..dd8bbdfec9375597df95e0f755309b21454af9e7 100644 (file)
@@ -89,7 +89,10 @@ void HUD_RaceTimer ()
        pos = panel_pos;
        mySize = panel_size;
 
-       HUD_Scale_Enable();
+       if (autocvar_hud_panel_racetimer_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        if(panel_bg_padding)
        {
index 925050df1cca9c66dc533dd72be5930585979e9b..7a8cb96e77a1f7cb0b3a8ee2277f92cd63ae0bf0 100644 (file)
@@ -275,7 +275,10 @@ void HUD_Radar()
        pos = panel_pos;
        mySize = panel_size;
 
-       HUD_Scale_Enable();
+       if (autocvar_hud_panel_radar_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        if(panel_bg_padding)
        {
index d65b2c2a2205c7372b4aa903f172adc8e3d5b395..49a8fa5b7a465f2e362098031df2dce86a05a178 100644 (file)
@@ -144,7 +144,10 @@ void HUD_Score()
        pos = panel_pos;
        mySize = panel_size;
 
-       HUD_Scale_Enable();
+       if (autocvar_hud_panel_score_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        if(panel_bg_padding)
        {
index 59702304f8e2e8eccadf5fdc172e447e3b1c9fa6..5a7194a45849ee7967f97e2a9694fccaf3b97c0c 100644 (file)
@@ -14,7 +14,10 @@ void HUD_Timer()
        pos = panel_pos;
        mySize = panel_size;
 
-       HUD_Scale_Enable();
+       if (autocvar_hud_panel_timer_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        if(panel_bg_padding)
        {
index 8968a6f349484bcb64c3f7d689e54f4d1958e094..89c784a1083be4e0ece863ca00419549520c05de 100644 (file)
@@ -69,7 +69,10 @@ void HUD_Vote()
        mySize = panel_size;
 
        a = vote_alpha * (vote_highlighted ? autocvar_hud_panel_vote_alreadyvoted_alpha : 1);
-       HUD_Scale_Enable();
+       if (autocvar_hud_panel_vote_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(a);
        a = panel_fg_alpha * a;
 
index 2caa86463ff342713b31ee8d2f2124b593b053aa..7e5f8107e5379efad3a692cd5e6e88eff0fa1cf4 100644 (file)
@@ -282,7 +282,10 @@ void HUD_Weapons()
        }
 
        // draw the background, then change the virtual size of it to better fit other items inside
-       HUD_Scale_Enable();
+       if (autocvar_hud_panel_weapons_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
 
        if(center.x == -1)
index cf43e7c1d585cf565f7dad46e614216e3f9c3137..2fb239ba10e21932239c8463d1d48c7dd6fd00c6 100644 (file)
@@ -1278,6 +1278,11 @@ void HUD_DrawScoreboard()
        if (!scoreboard_fade_alpha)
                return;
 
+       if (autocvar_scoreboard_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
+
        HUD_UpdatePlayerTeams();
 
        scoreboard_alpha_bg = autocvar_scoreboard_alpha_bg * scoreboard_fade_alpha * (1 - autocvar__menu_alpha);
index c12399527ad45d7931d115953b4ad29f76e2424a..1d82ca2034a1dbc8f4c49253e5290fed3f9bd425 100644 (file)
@@ -74,6 +74,7 @@ void HUD_MinigameStatus ()
                mySize -= '2 2 0' * panel_bg_padding;
        }
 
+       HUD_Scale_Disable();
        hud_minigame.minigame_hud_status(pos,mySize);
 }
 
index 4610c306ac62e5a5d9648f2db7d9b77885d4f29e..84120e1b04ad100bd6d148ed9ee2a810205929b7 100644 (file)
@@ -828,7 +828,6 @@ void bd_hud_board(vector pos, vector mySize)
 // Required function, draw the game status panel
 void bd_hud_status(vector pos, vector mySize)
 {
-       HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        vector ts;
        ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
index 76770cefe29c1e5fc545698dfd796530c6381c00..9b9d570855b490d8ac01d737cfb2114329656fe7 100644 (file)
@@ -322,7 +322,6 @@ void c4_hud_board(vector pos, vector mySize)
 // Required function, draw the game status panel
 void c4_hud_status(vector pos, vector mySize)
 {
-       HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        vector ts;
        ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
index f7da8f8e74f4577b4cf28c216dc9d5b3f6df8814..e4e0dc6380d9aec56a1b05601a8f5d733fe1b9c5 100644 (file)
@@ -496,7 +496,6 @@ void nmm_hud_board(vector pos, vector mySize)
 // Required function, draw the game status panel
 void nmm_hud_status(vector pos, vector mySize)
 {
-       HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        vector ts;
 
index 053cadc4e00d173f38d8874520ea91a40c1dabbf..87c75f48c59ab05ac3b9ce01d4c628ccb66a3580 100644 (file)
@@ -542,7 +542,6 @@ void pong_hud_board(vector pos, vector mySize)
 // Required function, draw the game status panel
 void pong_hud_status(vector pos, vector mySize)
 {
-       HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        vector ts;
        ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
index 24c61c01000e4f93cfa34f269847657d5c295858..a66a839677d9ceed95f9e62bdeaea3d72ddf5c34 100644 (file)
@@ -374,7 +374,6 @@ void pp_hud_board(vector pos, vector mySize)
 // Required function, draw the game status panel
 void pp_hud_status(vector pos, vector mySize)
 {
-       HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        vector ts;
        ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
index 58df41415f83aecba18f2a78ff31b0e921cb284e..4eb0009b9db2ae5383906e7772270a85cc1258bf 100644 (file)
@@ -429,7 +429,6 @@ void ps_hud_board(vector pos, vector mySize)
 // Required function, draw the game status panel
 void ps_hud_status(vector pos, vector mySize)
 {
-       HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        vector ts;
        ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
index dafa14fa3141c56933c34876acee129f94fb3c74..d367472d8214f1a4296e4bbf3dcce47802c06e00 100644 (file)
@@ -674,7 +674,6 @@ void snake_hud_board(vector pos, vector mySize)
 // Required function, draw the game status panel
 void snake_hud_status(vector pos, vector mySize)
 {
-       HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        vector ts;
        ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
index 7e2ed7e088172b67624e99349278a1e2ea0ae9db..cd9565abd54ce2bf401b9459f33afa4ad4a25dd3 100644 (file)
@@ -272,7 +272,6 @@ void ttt_hud_board(vector pos, vector mySize)
 // Required function, draw the game status panel
 void ttt_hud_status(vector pos, vector mySize)
 {
-       HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        vector ts;
        ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,