From 8ea776aaccfae8d4855382d5c86d35ca14e52476 Mon Sep 17 00:00:00 2001
From: FruitieX <rasse@rasse-lappy.localdomain>
Date: Wed, 19 May 2010 00:06:57 +0300
Subject: [PATCH] force showing a background in config mode, also adapt old
 nexuiz hud config for the new bg convention (this also breaks other confs...)

---
 defaultXonotic.cfg  |   4 +-
 hud_old_nexuiz.cfg  | 110 +++++++++++++++++++++++++++-----------------
 qcsrc/client/hud.qc |  11 ++++-
 3 files changed, 78 insertions(+), 47 deletions(-)

diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg
index 3e1fc16536..c4d312e976 100644
--- a/defaultXonotic.cfg
+++ b/defaultXonotic.cfg
@@ -1355,8 +1355,8 @@ seta hud_inventory_size "0.174227 0.092189" "size of this panel"
 seta hud_inventory_onlycurrent 0 "1 = show only current ammo type"
 seta hud_inventory_bg "" "if set to something else than \"\" = override default background"
 seta hud_inventory_bg_color "" "if set to something else than \"\" = override default panel background color"
-seta hud_inventory_bg_alpha 0 "if set to something else than \"\" = override default panel background alpha"
-seta hud_inventory_bg_border 0 "if set to something else than \"\" = override default size of border around the background"
+seta hud_inventory_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_inventory_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_inventory_bg_padding "" "if set to something else than \"\" = override default if set to something else than \"\" = override default padding of contents from border"
 
 seta hud_powerups 1 "enable/disable this panel"
diff --git a/hud_old_nexuiz.cfg b/hud_old_nexuiz.cfg
index 0eb197f52d..1ed5e74b80 100644
--- a/hud_old_nexuiz.cfg
+++ b/hud_old_nexuiz.cfg
@@ -1,8 +1,9 @@
 seta hud_skin "old"
 seta hud_bg "0"
 seta hud_bg_color "0 0.6 0.9"
-seta hud_bg_alpha 0.800000
+seta hud_bg_alpha 0.8
 seta hud_bg_border 10
+seta hud_bg_padding 0
 seta hud_fg_alpha 1
 
 seta hud_dock "1"
@@ -15,98 +16,121 @@ seta hud_progressbar_shield_color "0.6 0 0.6"
 seta hud_progressbar_health_color "0.6 0 0"
 seta hud_progressbar_armor_color "0 0.6 0"
 seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_nexball_color "0.7 0.1 0"
 
 seta hud_weaponicons 1
-seta hud_weaponicons_pos "-0.635295 -0.134116"
-seta hud_weaponicons_size "0.352942 0.064845"
+seta hud_weaponicons_pos "-0.635417 -0.133333"
+seta hud_weaponicons_size "0.354167 0.066667"
 seta hud_weaponicons_bg ""
 seta hud_weaponicons_bg_color ""
-seta hud_weaponicons_bg_alpha 0
-seta hud_weaponicons_bg_border 0
-seta hud_weaponicons_accuracy_height 3
+seta hud_weaponicons_bg_alpha 
+seta hud_weaponicons_bg_border 
+seta hud_weaponicons_bg_padding 
+seta hud_weaponicons_accuracy_height 0
 seta hud_weaponicons_accuracy_yellow 40
 
 seta hud_inventory 1
-seta hud_inventory_pos "0.179783 -0.092189"
-seta hud_inventory_size "0.174227 0.092189"
+seta hud_inventory_pos "0.171875 -0.091667"
+seta hud_inventory_size "0.177083 0.091667"
 seta hud_inventory_bg ""
 seta hud_inventory_bg_color ""
-seta hud_inventory_bg_alpha 0
-seta hud_inventory_bg_border 0
+seta hud_inventory_bg_alpha 
+seta hud_inventory_bg_border 
+seta hud_inventory_bg_padding 
 seta hud_inventory_onlycurrent 0
 
 seta hud_powerups 1
-seta hud_powerups_pos "-0.311922 -0.084896"
-seta hud_powerups_size "0.086719 0.077084"
+seta hud_powerups_pos "-0.307292 -0.091667"
+seta hud_powerups_size "0.093750 0.083333"
 seta hud_powerups_bg ""
 seta hud_powerups_bg_color ""
-seta hud_powerups_bg_alpha 0
-seta hud_powerups_bg_border 0
+seta hud_powerups_bg_alpha 
+seta hud_powerups_bg_border 
+seta hud_powerups_bg_padding 
 seta hud_powerups_flip 1
+seta hud_powerups_mirror 0
 
 seta hud_healtharmor 1
-seta hud_healtharmor_pos "-0.627451 -0.066667"
-seta hud_healtharmor_size "0.291174 0.066667"
+seta hud_healtharmor_pos "-0.625000 -0.066667"
+seta hud_healtharmor_size "0.287496 0.066667"
 seta hud_healtharmor_bg ""
 seta hud_healtharmor_bg_color ""
-seta hud_healtharmor_bg_alpha 0
-seta hud_healtharmor_bg_border 0
+seta hud_healtharmor_bg_alpha 
+seta hud_healtharmor_bg_border 
+seta hud_healtharmor_bg_padding 
 seta hud_healtharmor_flip 1
+seta hud_healtharmor_mirror 0
 
 seta hud_notify 0
 seta hud_notify_pos "0.1 0"
 seta hud_notify_size "0.1 0.1"
 seta hud_notify_bg ""
 seta hud_notify_bg_color ""
-seta hud_notify_bg_alpha 0
-seta hud_notify_bg_border 0
+seta hud_notify_bg_alpha 
+seta hud_notify_bg_border 
+seta hud_notify_bg_padding 
 
 seta hud_timer 1
-seta hud_timer_pos "-0.213725 0"
-seta hud_timer_size "0.212735 0.054427"
+seta hud_timer_pos "-0.151042 0"
+seta hud_timer_size "0.151042 0.058333"
 seta hud_timer_bg "border"
 seta hud_timer_bg_color ""
-seta hud_timer_bg_alpha 0
-seta hud_timer_bg_border 0
+seta hud_timer_bg_alpha 
+seta hud_timer_bg_border 
+seta hud_timer_bg_padding 
 
 seta hud_radar 1
 seta hud_radar_pos "0 0"
-seta hud_radar_size "0.215687 0.266667"
+seta hud_radar_size "0.182292 0.225000"
 seta hud_radar_bg ""
 seta hud_radar_bg_color ""
-seta hud_radar_bg_alpha 0
-seta hud_radar_bg_border 0
+seta hud_radar_bg_alpha 
+seta hud_radar_bg_border 
+seta hud_radar_bg_padding 
 
 seta hud_score 1
-seta hud_score_pos "-0.225469 -0.084404"
-seta hud_score_size "0.225469 0.075156"
+seta hud_score_pos "-0.203125 -0.091667"
+seta hud_score_size "0.203125 0.083333"
 seta hud_score_bg ""
 seta hud_score_bg_color ""
-seta hud_score_bg_alpha 0
-seta hud_score_bg_border 0
+seta hud_score_bg_alpha 
+seta hud_score_bg_border 
+seta hud_score_bg_padding 
 
 seta hud_racetimer 1
-seta hud_racetimer_pos "-0.614706 0"
-seta hud_racetimer_size "0.231373 0.077124"
+seta hud_racetimer_pos "-0.614583 0"
+seta hud_racetimer_size "0.229167 0.091667"
 seta hud_racetimer_bg ""
 seta hud_racetimer_bg_color ""
-seta hud_racetimer_bg_alpha 0
-seta hud_racetimer_bg_border 0
+seta hud_racetimer_bg_alpha 
+seta hud_racetimer_bg_border 
+seta hud_racetimer_bg_padding 
 
 seta hud_vote 1
-seta hud_vote_pos "-0.321140 -0.268230"
-seta hud_vote_size "0.320156 0.106719"
+seta hud_vote_pos "-0.312500 -0.300000"
+seta hud_vote_size "0.312500 0.133333"
 seta hud_vote_bg ""
 seta hud_vote_bg_color ""
-seta hud_vote_bg_alpha 0
-seta hud_vote_bg_border 0
+seta hud_vote_bg_alpha 
+seta hud_vote_bg_border 
+seta hud_vote_bg_padding 
 seta hud_vote_alreadyvoted_alpha 0.750000
 
+seta hud_modicons 1
+seta hud_modicons_pos "0 -0.091667"
+seta hud_modicons_size "0.119792 0.091667"
+seta hud_modicons_bg ""
+seta hud_modicons_bg_color ""
+seta hud_modicons_bg_alpha 
+seta hud_modicons_bg_border 
+seta hud_modicons_bg_padding 
+
 seta hud_pressedkeys 1
-seta hud_pressedkeys_pos "-0.571569 -0.265625"
-seta hud_pressedkeys_size "0.145098 0.114105"
+seta hud_pressedkeys_pos "0.437500 -0.266667"
+seta hud_pressedkeys_size "0.125000 0.116667"
 seta hud_pressedkeys_bg ""
 seta hud_pressedkeys_bg_color ""
-seta hud_pressedkeys_bg_alpha 0
-seta hud_pressedkeys_bg_border 0
+seta hud_pressedkeys_bg_alpha 
+seta hud_pressedkeys_bg_border 
+seta hud_pressedkeys_bg_padding 
 
diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc
index e4f98d387c..80421f67b1 100644
--- a/qcsrc/client/hud.qc
+++ b/qcsrc/client/hud.qc
@@ -746,6 +746,8 @@ float HUD_Panel_GetPadding(float id)
 // draw the background/borders
 void HUD_Panel_DrawBg(float id, vector pos, vector mySize)
 {
+	float alpha;
+
 	if(!hud_configure && cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg")) == "0")
 		return;
 
@@ -754,6 +756,11 @@ void HUD_Panel_DrawBg(float id, vector pos, vector mySize)
 	if(bg == "")
 		bg = cvar_string("hud_bg");
 
+	if(bg == "0" && hud_configure) {
+		bg = "border"; // we probably want to see a background in config mode at all times...
+		alpha = cvar("hud_configure_bg_minalpha");
+	}
+
 	if(bg != "0")
 	{
 		float border;
@@ -762,8 +769,8 @@ void HUD_Panel_DrawBg(float id, vector pos, vector mySize)
 		vector color;
 		color = HUD_Panel_GetColor(id);
 
-		float alpha;
-		alpha = HUD_Panel_GetAlpha(id);
+		if(!alpha)
+			alpha = HUD_Panel_GetAlpha(id);
 
 		draw_BorderPicture(pos - '1 1 0' * border, strcat("gfx/hud/", cvar_string("hud_skin"), "/", bg), mySize + '1 1 0' * 2 * border, color, alpha, '1 1 0' * (border/BORDER_MULTIPLIER));
 	}
-- 
2.39.5