From 5e4c09a4c9fceb1dfe3c71ce7c57580faee9a5f8 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 15 Jan 2011 19:59:00 +0100 Subject: [PATCH] Now it's possible to individually disable progressbar/text for speed and acceleration FFS cannot add anything to the menu, it's full :( Also rename hud_panel_physics_acceleration_progressbar_mode to hud_panel_physics_progressbar_acceleration_mode --- _hud_descriptions.cfg | 5 +- hud_luminos.cfg | 3 +- hud_luminos_minimal.cfg | 5 +- hud_luminos_xhair_minimal.cfg | 5 +- hud_nexuiz.cfg | 5 +- qcsrc/client/autocvars.qh | 5 +- qcsrc/client/hud.qc | 56 +++++++++++--------- qcsrc/menu/xonotic/dialog_hudpanel_physics.c | 2 +- 8 files changed, 50 insertions(+), 36 deletions(-) diff --git a/_hud_descriptions.cfg b/_hud_descriptions.cfg index 16ae97565..8c4343fb8 100644 --- a/_hud_descriptions.cfg +++ b/_hud_descriptions.cfg @@ -230,5 +230,6 @@ seta hud_panel_physics_bg_border "" "if set to something else than \"\" = overri seta hud_panel_physics_bg_padding "" "if set to something else than \"\" = override default padding of contents from border" seta hud_panel_physics_baralign "" "0 = align bars to the left, 1 = align bars to the right, 2 = align only left bar to the right, 3 = align only right bar to the right, 4 = align bars to the center" seta hud_panel_physics_flip "" "flip speed/acceleration positions" -seta hud_panel_physics_progressbar "" "enable progressbar in panel" -seta hud_panel_physics_progressbar_acceleration_mode "" "0 = progressbar increases from the center to the right if the acceleration is positive, to the left if it's negative; 1 = progressbar increases from the border in the same direction for both positive and negative accelerations" +seta hud_panel_physics_progressbar "" "enable progressbar in panel (2 = only for speed; 3 = only for acceleration)" +seta hud_panel_physics_acceleration_progressbar_mode "" "0 = progressbar increases from the center to the right if the acceleration is positive, to the left if it's negative; 1 = progressbar increases from the border in the same direction for both positive and negative accelerations" +seta hud_panel_physics_text "" "show text in panel (2 = only for speed; 3 = only for acceleration)" diff --git a/hud_luminos.cfg b/hud_luminos.cfg index 7e94d8ce0..cda91be1b 100644 --- a/hud_luminos.cfg +++ b/hud_luminos.cfg @@ -228,7 +228,8 @@ seta hud_panel_physics_bg_border "" seta hud_panel_physics_bg_padding "" seta hud_panel_physics_flip "0" seta hud_panel_physics_baralign "0" +seta hud_panel_physics_acceleration_progressbar_mode "0" seta hud_panel_physics_progressbar "1" -seta hud_panel_physics_progressbar_acceleration_mode "0" +seta hud_panel_physics_text "1" menu_sync diff --git a/hud_luminos_minimal.cfg b/hud_luminos_minimal.cfg index e6b849b21..753e6810f 100644 --- a/hud_luminos_minimal.cfg +++ b/hud_luminos_minimal.cfg @@ -228,7 +228,8 @@ seta hud_panel_physics_bg_border "" seta hud_panel_physics_bg_padding "" seta hud_panel_physics_flip "0" seta hud_panel_physics_baralign "0" -seta hud_panel_physics_progressbar "1" -seta hud_panel_physics_progressbar_acceleration_mode "0" +seta hud_panel_physics_acceleration_progressbar_mode "0" +seta hud_panel_physics_progressbar "3" +seta hud_panel_physics_text "2" menu_sync diff --git a/hud_luminos_xhair_minimal.cfg b/hud_luminos_xhair_minimal.cfg index 18be11cec..48d1efd59 100644 --- a/hud_luminos_xhair_minimal.cfg +++ b/hud_luminos_xhair_minimal.cfg @@ -227,7 +227,8 @@ seta hud_panel_physics_bg_border "" seta hud_panel_physics_bg_padding "" seta hud_panel_physics_flip "0" seta hud_panel_physics_baralign "0" -seta hud_panel_physics_progressbar "1" -seta hud_panel_physics_progressbar_acceleration_mode "0" +seta hud_panel_physics_acceleration_progressbar_mode "0" +seta hud_panel_physics_progressbar "3" +seta hud_panel_physics_text "2" menu_sync diff --git a/hud_nexuiz.cfg b/hud_nexuiz.cfg index 514d34704..29bfab2b2 100644 --- a/hud_nexuiz.cfg +++ b/hud_nexuiz.cfg @@ -228,7 +228,8 @@ seta hud_panel_physics_bg_border "" seta hud_panel_physics_bg_padding "" seta hud_panel_physics_flip "0" seta hud_panel_physics_baralign "0" -seta hud_panel_physics_progressbar "1" -seta hud_panel_physics_progressbar_acceleration_mode "0" +seta hud_panel_physics_acceleration_progressbar_mode "0" +seta hud_panel_physics_progressbar "3" +seta hud_panel_physics_text "2" menu_sync diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 4635407cb..f866f5a5d 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -189,16 +189,17 @@ float autocvar_hud_panel_notify_flip; float autocvar_hud_panel_notify_print; float autocvar_hud_panel_notify_time; float autocvar_hud_panel_physics; -float autocvar_hud_panel_physics_progressbar_acceleration_mode; +float autocvar_hud_panel_physics_acceleration_progressbar_mode; float autocvar_hud_panel_physics_acceleration_max; +float autocvar_hud_panel_physics_progressbar; float autocvar_hud_panel_physics_acceleration_vertical; float autocvar_hud_panel_physics_baralign; float autocvar_hud_panel_physics_flip; -float autocvar_hud_panel_physics_progressbar; float autocvar_hud_panel_physics_speed_max; float autocvar_hud_panel_physics_speed_unit; float autocvar_hud_panel_physics_speed_unit_show; float autocvar_hud_panel_physics_speed_vertical; +float autocvar_hud_panel_physics_text; float autocvar_hud_panel_physics_topspeed; float autocvar_hud_panel_physics_topspeed_time; float autocvar_hud_panel_powerups; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index b029ad450..f0d972593 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -4302,39 +4302,44 @@ void HUD_Physics(void) speed_baralign = (autocvar_hud_panel_physics_baralign == 2); acceleration_baralign = (autocvar_hud_panel_physics_baralign == 3); } - if (autocvar_hud_panel_physics_progressbar_acceleration_mode == 0) + if (autocvar_hud_panel_physics_acceleration_progressbar_mode == 0) acceleration_baralign = 3; //override hud_panel_physics_baralign value for acceleration //draw speed - if(speed && autocvar_hud_panel_physics_progressbar) + if(speed) + if(autocvar_hud_panel_physics_progressbar == 1 || autocvar_hud_panel_physics_progressbar == 2) { HUD_Panel_GetProgressBarColor(speed); HUD_Panel_DrawProgressBar(panel_pos + speed_offset, panel_size, "progressbar", speed/max_speed, 0, speed_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); } vector tmp_offset, tmp_size; - tmp_size_x = panel_size_x * 0.75; - tmp_size_y = panel_size_y; - if (speed_baralign) - tmp_offset_x = panel_size_x - tmp_size_x; - //else - //tmp_offset_x = 0; - drawstring_aspect(panel_pos + speed_offset + tmp_offset, ftos(speed), tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); - - //draw speed unit - if (speed_baralign) - tmp_offset_x = 0; - else - tmp_offset_x = tmp_size_x; - if (autocvar_hud_panel_physics_speed_unit_show) - { - //tmp_offset_y = 0; - tmp_size_x = panel_size_x * (1 - 0.75); - tmp_size_y = panel_size_y * 0.4; - drawstring_aspect(panel_pos + speed_offset + tmp_offset, unit, tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + if (autocvar_hud_panel_physics_text == 1 || autocvar_hud_panel_physics_text == 2) + { + tmp_size_x = panel_size_x * 0.75; + tmp_size_y = panel_size_y; + if (speed_baralign) + tmp_offset_x = panel_size_x - tmp_size_x; + //else + //tmp_offset_x = 0; + drawstring_aspect(panel_pos + speed_offset + tmp_offset, ftos(speed), tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + + //draw speed unit + if (speed_baralign) + tmp_offset_x = 0; + else + tmp_offset_x = tmp_size_x; + if (autocvar_hud_panel_physics_speed_unit_show) + { + //tmp_offset_y = 0; + tmp_size_x = panel_size_x * (1 - 0.75); + tmp_size_y = panel_size_y * 0.4; + drawstring_aspect(panel_pos + speed_offset + tmp_offset, unit, tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + } } //compute and draw top speed if (autocvar_hud_panel_physics_topspeed) + if (autocvar_hud_panel_physics_text == 1 || autocvar_hud_panel_physics_text == 2) { if (autocvar__hud_configure) { @@ -4360,7 +4365,8 @@ void HUD_Physics(void) if (f > 0) { //top speed progressbar peak - if(autocvar_hud_panel_physics_progressbar && speed < top_speed) + if(speed < top_speed) + if(autocvar_hud_panel_physics_progressbar == 1 || autocvar_hud_panel_physics_progressbar == 2) { float peak_offset_x; vector peak_size; @@ -4395,7 +4401,8 @@ void HUD_Physics(void) } //draw acceleration - if(acceleration && autocvar_hud_panel_physics_progressbar) + if(acceleration) + if(autocvar_hud_panel_physics_progressbar == 1 || autocvar_hud_panel_physics_progressbar == 3) { if (acceleration < 0) HUD_Panel_GetProgressBarColor(acceleration_neg); @@ -4403,7 +4410,8 @@ void HUD_Physics(void) HUD_Panel_GetProgressBarColor(acceleration); HUD_Panel_DrawProgressBar(panel_pos + acceleration_offset, panel_size, "progressbar", acceleration/autocvar_hud_panel_physics_acceleration_max, 0, acceleration_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); } - drawstring_aspect(panel_pos + acceleration_offset, strcat(ftos_decimals(acceleration, 2), "g"), panel_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + if (autocvar_hud_panel_physics_text == 1 || autocvar_hud_panel_physics_text == 3) + drawstring_aspect(panel_pos + acceleration_offset, strcat(ftos_decimals(acceleration, 2), "g"), panel_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); } /* diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_physics.c b/qcsrc/menu/xonotic/dialog_hudpanel_physics.c index ae3767e5d..c245f97bd 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_physics.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_physics.c @@ -84,7 +84,7 @@ void XonoticHUDPhysicsDialog_fill(entity me) e.addValue(e, "Inward align" , "2"); e.addValue(e, "Outward align", "3"); e.configureXonoticTextSliderValues(e); - setDependent(e, "hud_panel_physics_progressbar", 1, 1); + setDependent(e, "hud_panel_physics_progressbar", 1, 3); me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_physics_flip", "Flip speed/acceleration positions")); -- 2.39.2