From: terencehill Date: Tue, 12 Apr 2016 14:25:32 +0000 (+0200) Subject: Add cvars to enable / disable the dynamic hud effects for each panel X-Git-Tag: xonotic-v0.8.2~882^2~2 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=61d746760851b92ea6124dcc179c0f5178b62169 Add cvars to enable / disable the dynamic hud effects for each panel --- diff --git a/_hud_common.cfg b/_hud_common.cfg index d599c4711b..0f3f24ba19 100644 --- a/_hud_common.cfg +++ b/_hud_common.cfg @@ -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" diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index e1531205ec..907fd812dc 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -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) 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" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index f1e3b70e94..46db647dac 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -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; diff --git a/qcsrc/client/hud/panel/ammo.qc b/qcsrc/client/hud/panel/ammo.qc index e8a702d6b3..5c45ff0f33 100644 --- a/qcsrc/client/hud/panel/ammo.qc +++ b/qcsrc/client/hud/panel/ammo.qc @@ -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) { diff --git a/qcsrc/client/hud/panel/centerprint.qc b/qcsrc/client/hud/panel/centerprint.qc index 23c383e45c..afda329838 100644 --- a/qcsrc/client/hud/panel/centerprint.qc +++ b/qcsrc/client/hud/panel/centerprint.qc @@ -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) diff --git a/qcsrc/client/hud/panel/chat.qc b/qcsrc/client/hud/panel/chat.qc index d8945991ec..a27e7b9070 100644 --- a/qcsrc/client/hud/panel/chat.qc +++ b/qcsrc/client/hud/panel/chat.qc @@ -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); diff --git a/qcsrc/client/hud/panel/engineinfo.qc b/qcsrc/client/hud/panel/engineinfo.qc index ce425a2def..773c751d82 100644 --- a/qcsrc/client/hud/panel/engineinfo.qc +++ b/qcsrc/client/hud/panel/engineinfo.qc @@ -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) { diff --git a/qcsrc/client/hud/panel/healtharmor.qc b/qcsrc/client/hud/panel/healtharmor.qc index 099d9f9220..bc4291a948 100644 --- a/qcsrc/client/hud/panel/healtharmor.qc +++ b/qcsrc/client/hud/panel/healtharmor.qc @@ -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) { diff --git a/qcsrc/client/hud/panel/infomessages.qc b/qcsrc/client/hud/panel/infomessages.qc index 2f072b2b55..a197963e75 100644 --- a/qcsrc/client/hud/panel/infomessages.qc +++ b/qcsrc/client/hud/panel/infomessages.qc @@ -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) { diff --git a/qcsrc/client/hud/panel/modicons.qc b/qcsrc/client/hud/panel/modicons.qc index 957fe1f394..f442d2df52 100644 --- a/qcsrc/client/hud/panel/modicons.qc +++ b/qcsrc/client/hud/panel/modicons.qc @@ -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); diff --git a/qcsrc/client/hud/panel/notify.qc b/qcsrc/client/hud/panel/notify.qc index 720b7aeda5..a5e923825a 100644 --- a/qcsrc/client/hud/panel/notify.qc +++ b/qcsrc/client/hud/panel/notify.qc @@ -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) diff --git a/qcsrc/client/hud/panel/physics.qc b/qcsrc/client/hud/panel/physics.qc index 741c305b41..371a9f344b 100644 --- a/qcsrc/client/hud/panel/physics.qc +++ b/qcsrc/client/hud/panel/physics.qc @@ -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) { diff --git a/qcsrc/client/hud/panel/powerups.qc b/qcsrc/client/hud/panel/powerups.qc index 8abe1fc5a1..223bf72ce8 100644 --- a/qcsrc/client/hud/panel/powerups.qc +++ b/qcsrc/client/hud/panel/powerups.qc @@ -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 diff --git a/qcsrc/client/hud/panel/pressedkeys.qc b/qcsrc/client/hud/panel/pressedkeys.qc index 9989c4fc84..d0a4f39fdf 100644 --- a/qcsrc/client/hud/panel/pressedkeys.qc +++ b/qcsrc/client/hud/panel/pressedkeys.qc @@ -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) { diff --git a/qcsrc/client/hud/panel/racetimer.qc b/qcsrc/client/hud/panel/racetimer.qc index 3ad0bb0f79..dd8bbdfec9 100644 --- a/qcsrc/client/hud/panel/racetimer.qc +++ b/qcsrc/client/hud/panel/racetimer.qc @@ -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) { diff --git a/qcsrc/client/hud/panel/radar.qc b/qcsrc/client/hud/panel/radar.qc index 925050df1c..7a8cb96e77 100644 --- a/qcsrc/client/hud/panel/radar.qc +++ b/qcsrc/client/hud/panel/radar.qc @@ -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) { diff --git a/qcsrc/client/hud/panel/score.qc b/qcsrc/client/hud/panel/score.qc index d65b2c2a22..49a8fa5b7a 100644 --- a/qcsrc/client/hud/panel/score.qc +++ b/qcsrc/client/hud/panel/score.qc @@ -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) { diff --git a/qcsrc/client/hud/panel/timer.qc b/qcsrc/client/hud/panel/timer.qc index 59702304f8..5a7194a458 100644 --- a/qcsrc/client/hud/panel/timer.qc +++ b/qcsrc/client/hud/panel/timer.qc @@ -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) { diff --git a/qcsrc/client/hud/panel/vote.qc b/qcsrc/client/hud/panel/vote.qc index 8968a6f349..89c784a108 100644 --- a/qcsrc/client/hud/panel/vote.qc +++ b/qcsrc/client/hud/panel/vote.qc @@ -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; diff --git a/qcsrc/client/hud/panel/weapons.qc b/qcsrc/client/hud/panel/weapons.qc index 2caa86463f..7e5f8107e5 100644 --- a/qcsrc/client/hud/panel/weapons.qc +++ b/qcsrc/client/hud/panel/weapons.qc @@ -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) diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index cf43e7c1d5..2fb239ba10 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -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); diff --git a/qcsrc/common/minigames/cl_minigames_hud.qc b/qcsrc/common/minigames/cl_minigames_hud.qc index c12399527a..1d82ca2034 100644 --- a/qcsrc/common/minigames/cl_minigames_hud.qc +++ b/qcsrc/common/minigames/cl_minigames_hud.qc @@ -74,6 +74,7 @@ void HUD_MinigameStatus () mySize -= '2 2 0' * panel_bg_padding; } + HUD_Scale_Disable(); hud_minigame.minigame_hud_status(pos,mySize); } diff --git a/qcsrc/common/minigames/minigame/bd.qc b/qcsrc/common/minigames/minigame/bd.qc index 4610c306ac..84120e1b04 100644 --- a/qcsrc/common/minigames/minigame/bd.qc +++ b/qcsrc/common/minigames/minigame/bd.qc @@ -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, diff --git a/qcsrc/common/minigames/minigame/c4.qc b/qcsrc/common/minigames/minigame/c4.qc index 76770cefe2..9b9d570855 100644 --- a/qcsrc/common/minigames/minigame/c4.qc +++ b/qcsrc/common/minigames/minigame/c4.qc @@ -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, diff --git a/qcsrc/common/minigames/minigame/nmm.qc b/qcsrc/common/minigames/minigame/nmm.qc index f7da8f8e74..e4e0dc6380 100644 --- a/qcsrc/common/minigames/minigame/nmm.qc +++ b/qcsrc/common/minigames/minigame/nmm.qc @@ -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; diff --git a/qcsrc/common/minigames/minigame/pong.qc b/qcsrc/common/minigames/minigame/pong.qc index 053cadc4e0..87c75f48c5 100644 --- a/qcsrc/common/minigames/minigame/pong.qc +++ b/qcsrc/common/minigames/minigame/pong.qc @@ -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, diff --git a/qcsrc/common/minigames/minigame/pp.qc b/qcsrc/common/minigames/minigame/pp.qc index 24c61c0100..a66a839677 100644 --- a/qcsrc/common/minigames/minigame/pp.qc +++ b/qcsrc/common/minigames/minigame/pp.qc @@ -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, diff --git a/qcsrc/common/minigames/minigame/ps.qc b/qcsrc/common/minigames/minigame/ps.qc index 58df41415f..4eb0009b9d 100644 --- a/qcsrc/common/minigames/minigame/ps.qc +++ b/qcsrc/common/minigames/minigame/ps.qc @@ -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, diff --git a/qcsrc/common/minigames/minigame/snake.qc b/qcsrc/common/minigames/minigame/snake.qc index dafa14fa31..d367472d82 100644 --- a/qcsrc/common/minigames/minigame/snake.qc +++ b/qcsrc/common/minigames/minigame/snake.qc @@ -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, diff --git a/qcsrc/common/minigames/minigame/ttt.qc b/qcsrc/common/minigames/minigame/ttt.qc index 7e2ed7e088..cd9565abd5 100644 --- a/qcsrc/common/minigames/minigame/ttt.qc +++ b/qcsrc/common/minigames/minigame/ttt.qc @@ -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,