Merge in xonotic/xonotic-data.pk3dir.git: terencehill/physics_panel_updates
git-manager created issue #848 (closed) on 2011-12-01T17:49:29Z:
Purpose of the branch:
1. acceleration progressbar can now be scaled to display better acceleration values (hud_panel_physics_acceleration_progressbar_nonlinear does it without going out of the panel bounds, thing that happens by setting hud_panel_physics_acceleration_progressbar_scale to a value > 1)
2. text height can now be scaled thanks to hud_panel_physics_text_scale
3. layout of the nexuiz skin is now really close to what you can see in Nexuiz: only speed text, only acc. progressbar, hud_panel_physics_acceleration_progressbar_scale 1 (for all the aothers is 0.7)
Repository: xonotic/xonotic-data.pk3dir.git Commit: 0b1b5021 Branch: terencehill/physics_panel_updates
Merge commands:
cd data/xonotic-data.pk3dir
git checkout master
git reset --hard origin/master
git pull && git diff '0b1b5021f6f2049b4d2d9187d5eb04c9af6d441d'..'origin/terencehill/physics_panel_updates'
# please check that the diff you just saw did not contain anything complex that
# needs a new merge request, and review these changes
git merge --no-ff 'origin/terencehill/physics_panel_updates'
# please make sure this merge worked, and if not, fix merge conflicts and git
# commit BEFORE the next command
#
# also, THIS is the point to do final pre-merge testing
#
# use git reset --hard origin/master to bail out
git push && git push --delete origin 'terencehill/physics_panel_updates'
Diffstat:
_hud_descriptions.cfg | 5 +++-
hud_luminos.cfg | 5 +++-
hud_luminos_minimal.cfg | 5 +++-
hud_luminos_minimal_xhair.cfg | 5 +++-
hud_luminos_old.cfg | 5 +++-
hud_nexuiz.cfg | 13 ++++++----
qcsrc/client/autocvars.qh | 5 +++-
qcsrc/client/hud.qc | 54 +++++++++++++++++++++++++++++++++++-----
qcsrc/client/hud_config.qc | 5 +++-
9 files changed, 83 insertions(+), 19 deletions(-)
Revision log:
commit 0b1b5021f6f2049b4d2d9187d5eb04c9af6d441d
Author: terencehill
Commit: terencehill
Fix merge conflict
commit c93acc75bbbbbd94e50a25efeaba3ad0be2e4d41
Merge: 52590f0 0396c95
Author: terencehill
Commit: terencehill
Merge branch 'master' into terencehill/physics_panel_updates
commit 52590f03ae7721012362e20299fc2746e98e9b96
Author: terencehill
Commit: terencehill
Physics panel layout of the nexuiz skin is now really close to what you can see in Nexuiz
commit 4666d229e9b631885c542e1e9f04cf78ec8b38f2
Merge: be85be6 87bcf91
Author: terencehill
Commit: terencehill
Merge branch 'master' into terencehill/physics_panel_updates
Conflicts:
defaultXonotic.cfg
qcsrc/client/autocvars.qh
commit be85be6dad6016ed7d50ae5b7f8e5e4057692e8b
Merge: 467d960 93d9ec1
Author: terencehill
Commit: terencehill
Merge branch 'master' into terencehill/physics_panel_updates
commit 467d9604cd4033e17935c73528d2c43a086c0f61
Author: terencehill
Commit: terencehill
set scale to 1 by default
commit 3678fa9a1af46f1a8bf7dbf787e94bbfabaf9d0a
Author: terencehill
Commit: terencehill
Physics panel updates: acceleration progressbar can now be scaled to display better acceleration values (hud_panel_physics_acceleration_progressbar_nonlinear does it without going out of the panel bounds, thing that happens by setting hud_panel_physics_acceleration_progressbar_scale to a value > 1); also text height can now be scaled thanks to hud_panel_physics_text_scale.
User agreed to the GPLv2*.
Diff:
<pre>diff —git a/_hud_descriptions.cfg b/_hud_descriptions.cfg
index 061720a..719ccb0 100644
— a/_hud_descriptions.cfg
**+ b/_hud_descriptions.cfg
@ -255,9 +255,12
@ seta hud_panel_physics_baralign “” “0 = align bars to the left, 1 = align bars t
seta hud_panel_physics_flip”" “flip speed/acceleration positions”
seta hud_panel_physics_progressbar “” “enable progressbar in panel (2 = only for speed; 3 = only for acceleration)”
seta hud_panel_physics_acceleration_max “” “acceleration progressbar gets completely filled up by this value (in g)”
-seta hud_panel_physics_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_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_acceleration_progressbar_scale “” “multiply acceleration progressbar values by this factor (allow progressbar to go out of panel bounds)”
*seta hud_panel_physics_acceleration_progressbar_nonlinear “” “use a non linear function to display acceleration progressbar values (amplify more smaller values)”
seta hud_panel_physics_acceleration_vertical “” “include the acceleration on the Z-axis”
seta hud_panel_physics_text “” “show text in panel (2 = only for speed; 3 = only for acceleration)”
*seta hud_panel_physics_text_scale “” “scale text height by this factor”
seta hud_panel_physics_speed_unit “” “speed unit (1 = qu/s, 2 = m/s, 3 = km/h, 4 = mph, 5 = knots)”
seta hud_panel_physics_speed_unit_show “” “also show speed unit”
seta hud_panel_physics_speed_max “” “speed progressbar gets filled up completely by this value (in qu/s)”
diff —git a/hud_luminos.cfg b/hud_luminos.cfg
index f32279f..cc889c5 100644
— a/hud_luminos.cfg
**+ b/hud_luminos.cfg
@ -256,8 +256,11
@ seta hud_panel_physics_acceleration_vertical “0”
seta hud_panel_physics_flip “0”
seta hud_panel_physics_baralign “0”
seta hud_panel_physics_progressbar “1”
~~seta hud_panel_physics_acceleration_mode “0”
*seta hud_panel_physics_acceleration_progressbar_mode “0”
*seta hud_panel_physics_acceleration_progressbar_scale “1”
*seta hud_panel_physics_acceleration_progressbar_nonlinear “0”
seta hud_panel_physics_text “1”
*seta hud_panel_physics_text_scale “0.7”
seta hud_panel_centerprint 1
seta hud_panel_centerprint_pos “0.175000 0.220000”
diff —git a/hud_luminos_minimal.cfg b/hud_luminos_minimal.cfg
index 52a7d96..715d384 100644
— a/hud_luminos_minimal.cfg
**+ b/hud_luminos_minimal.cfg
@ -256,8 +256,11
@ seta hud_panel_physics_acceleration_vertical “0”
seta hud_panel_physics_flip “0”
seta hud_panel_physics_baralign “0”
seta hud_panel_physics_progressbar “3”
~~seta hud_panel_physics_acceleration_mode “0”
*seta hud_panel_physics_acceleration_progressbar_mode “0”
*seta hud_panel_physics_acceleration_progressbar_scale “1”
*seta hud_panel_physics_acceleration_progressbar_nonlinear “0”
seta hud_panel_physics_text “1”
*seta hud_panel_physics_text_scale “0.7”
seta hud_panel_centerprint 1
seta hud_panel_centerprint_pos “0.175000 0.220000”
diff —git a/hud_luminos_minimal_xhair.cfg b/hud_luminos_minimal_xhair.cfg
index 2d5e076..7e44f8c 100644
— a/hud_luminos_minimal_xhair.cfg
**+ b/hud_luminos_minimal_xhair.cfg
@ -256,8 +256,11
@ seta hud_panel_physics_acceleration_vertical “0”
seta hud_panel_physics_flip “0”
seta hud_panel_physics_baralign “0”
seta hud_panel_physics_progressbar “3”
~~seta hud_panel_physics_acceleration_mode “0”
*seta hud_panel_physics_acceleration_progressbar_mode “0”
*seta hud_panel_physics_acceleration_progressbar_scale “1”
*seta hud_panel_physics_acceleration_progressbar_nonlinear “0”
seta hud_panel_physics_text “1”
*seta hud_panel_physics_text_scale “0.7”
seta hud_panel_centerprint 1
seta hud_panel_centerprint_pos “0.175000 0.220000”
diff —git a/hud_luminos_old.cfg b/hud_luminos_old.cfg
index fe7f660..f96e461 100644
— a/hud_luminos_old.cfg
**+ b/hud_luminos_old.cfg
@ -256,8 +256,11
@ seta hud_panel_physics_acceleration_vertical “0”
seta hud_panel_physics_flip “0”
seta hud_panel_physics_baralign “0”
seta hud_panel_physics_progressbar “1”
~~seta hud_panel_physics_acceleration_mode “0”
*seta hud_panel_physics_acceleration_progressbar_mode “0”
*seta hud_panel_physics_acceleration_progressbar_scale “1”
*seta hud_panel_physics_acceleration_progressbar_nonlinear “0”
seta hud_panel_physics_text “1”
*seta hud_panel_physics_text_scale “0.7”
seta hud_panel_centerprint 1
seta hud_panel_centerprint_pos “0.175000 0.220000”
diff —git a/hud_nexuiz.cfg b/hud_nexuiz.cfg
index 5c21383..80298e7 100644
— a/hud_nexuiz.cfg
**+ b/hud_nexuiz.cfg
@ -245,19 +245,22
@ seta hud_panel_physics_bg_color_team “”
seta hud_panel_physics_bg_alpha “”
seta hud_panel_physics_bg_border “”
seta hud_panel_physics_bg_padding “”
~~seta hud_panel_physics_speed_unit “3”
~~seta hud_panel_physics_speed_unit_show “1”
*seta hud_panel_physics_speed_unit “1”
*seta hud_panel_physics_speed_unit_show “0”
seta hud_panel_physics_speed_max “1800”
seta hud_panel_physics_speed_vertical “0”
~~seta hud_panel_physics_topspeed “1”
*seta hud_panel_physics_topspeed “0”
seta hud_panel_physics_topspeed_time “4”
seta hud_panel_physics_acceleration_max “1.5”
seta hud_panel_physics_acceleration_vertical “0”
seta hud_panel_physics_flip “0”
seta hud_panel_physics_baralign “0”
seta hud_panel_physics_progressbar “3”
~~seta hud_panel_physics_acceleration_mode “0”
~~seta hud_panel_physics_text “1”
*seta hud_panel_physics_acceleration_progressbar_mode “0”
*seta hud_panel_physics_acceleration_progressbar_scale “4”
*seta hud_panel_physics_acceleration_progressbar_nonlinear “0”
*seta hud_panel_physics_text “2”
*seta hud_panel_physics_text_scale “1”
seta hud_panel_centerprint 1
seta hud_panel_centerprint_pos “0.175000 0.260000”
diff —git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh
index e18433e..5384334 100644
— a/qcsrc/client/autocvars.qh
**+ b/qcsrc/client/autocvars.qh
@ -250,7 +250,9
@ float autocvar_hud_panel_notify_fontsize;
float autocvar_hud_panel_notify_print;
float autocvar_hud_panel_notify_time;
float autocvar_hud_panel_physics;
~~float autocvar_hud_panel_physics_acceleration_mode;
*float autocvar_hud_panel_physics_acceleration_progressbar_mode;
*float autocvar_hud_panel_physics_acceleration_progressbar_scale;
*float autocvar_hud_panel_physics_acceleration_progressbar_nonlinear;
float autocvar_hud_panel_physics_acceleration_max;
float autocvar_hud_panel_physics_progressbar;
float autocvar_hud_panel_physics_acceleration_vertical;
@ -261,6 +263,7
@ 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_text_scale;
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 1a98bca..ef45602 100644
— a/qcsrc/client/hud.qc
**+ b/qcsrc/client/hud.qc
@ -4268,6 +4268,16
@ void HUD_Physics
panel_size ~~= ‘2 2 0’ * panel_bg_padding;
}
- float acceleration_progressbar_scale;
- if
- acceleration_progressbar_scale = autocvar_hud_panel_physics_acceleration_progressbar_scale;
- float text_scale;
- if
- text_scale = 1;
- else
- text_scale = min;
//compute speed
float speed, conversion_factor;
string unit;
@ -4327,7 +4337,7
@ void HUD_Physics
//compute layout
float panel_ar = panel_size_x/panel_size_y;
vector speed_offset, acceleration_offset;
~~ if
- if
{
panel_size_x **= 0.5;
if
@ -4358,7 +4368,7
@ void HUD_Physics speed_baralign = ; acceleration_baralign = ; }
- if
- if
acceleration_baralign = 3; //override hud_panel_physics_baralign value for acceleration
//draw speed
@ -4372,11 +4382,12
@ void HUD_Physics if { tmp_size_x = panel_size_x** 0.75;
- tmp_size_y = panel_size_y;
- tmp_size_y = panel_size_y * text_scale; if tmp_offset_x = panel_size_x~~ tmp_size_x; //else //tmp_offset_x = 0;
- tmp_offset_y = / 2;
drawstring_aspect, tmp_size, ‘1 1 1’, panel_fg_alpha, DRAWFLAG_NORMAL);
//draw speed unit
@ -4388,7 +4399,8
@ void HUD_Physics { //tmp_offset_y = 0; tmp_size_x = panel_size_x * ;
- tmp_size_y = panel_size_y * 0.4;
- tmp_size_y = panel_size_y * 0.4 * text_scale;
- tmp_offset_y = / 2;
drawstring_aspect;
}
}
@ -4449,7 +4461,8
@ void HUD_Physics //top speed tmp_offset_y = panel_size_y * 0.4; tmp_size_x = panel_size_x * ; ~~ tmp_size_y = panel_size_y - tmp_offset_y;
- tmp_size_y = * text_scale;
- tmp_offset_y *= / 2;
drawstring_aspect, tmp_size, ‘1 0 0’, f * panel_fg_alpha, DRAWFLAG_NORMAL);
}
else
@ -4464,10 +4477,37
@ void HUD_Physics HUD_Panel_GetProgressBarColor; else HUD_Panel_GetProgressBarColor;
- HUD_Panel_DrawProgressBar;
- f = acceleration/autocvar_hud_panel_physics_acceleration_max;
- if
- f = sqrt;
- if // allow progressbar to go out of panel bounds
- {
- tmp_size = acceleration_progressbar_scale * panel_size_x * eX + panel_size_y * eY;
- if
- tmp_offset_x = panel_size_x~~ tmp_size_x;
- else if
- tmp_offset_x = / 2;
- else
- tmp_offset_x = 0;
- tmp_offset_y = 0;
- }
- else
- {
- tmp_size = panel_size;
- tmp_offset = ‘0 0 0’;
- }
- HUD_Panel_DrawProgressBar; }
- tmp_size_x = panel_size_x;
- tmp_size_y = panel_size_y * text_scale;
- tmp_offset_x = 0;
- tmp_offset_y = / 2; if ~~ drawstring_aspect, “g”), panel_size, ‘1 1 1’, panel_fg_alpha, DRAWFLAG_NORMAL);
- drawstring_aspect(panel_pos + acceleration_offset + tmp_offset, strcat(ftos_decimals(acceleration, 2), “g”), tmp_size, ‘1 1 1’, panel_fg_alpha, DRAWFLAG_NORMAL); }
// CenterPrint (#16)
diff —git a/qcsrc/client/hud_config.qc b/qcsrc/client/hud_config.qc
index 1702246..39efb36 100644
— a/qcsrc/client/hud_config.qc
**+ b/qcsrc/client/hud_config.qc
@ -159,8 +159,11
@ void HUD_Panel_ExportCfg
HUD_Write_PanelCvar_q;
HUD_Write_PanelCvar_q;
HUD_Write_PanelCvar_q;
- HUD_Write_PanelCvar_q;
- HUD_Write_PanelCvar_q;
- HUD_Write_PanelCvar_q(“_progressbar_acceleration_scale”);
- HUD_Write_PanelCvar_q(“_progressbar_acceleration_nonlinear”); HUD_Write_PanelCvar_q(“_text”);
- HUD_Write_PanelCvar_q(“_text_scale”); break; case HUD_PANEL_CENTERPRINT: HUD_Write_PanelCvar_q(“_align”);