From 941b46103257535f94ec39d19f47ca334b4ae713 Mon Sep 17 00:00:00 2001
From: FruitieX <rasse@rasse-lappy.localdomain>
Date: Thu, 13 May 2010 10:44:15 +0300
Subject: [PATCH] force min alpha value in hud configure mode so you can see
 the panels

---
 defaultXonotic.cfg  | 1 +
 qcsrc/client/hud.qc | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg
index f123728563..979df639f2 100644
--- a/defaultXonotic.cfg
+++ b/defaultXonotic.cfg
@@ -1333,6 +1333,7 @@ seta hud_progressbar_alpha "0.5" "alpha of progressbars"
 seta hud_bg "border" "sets the default background for the panels, file must exist in data/gfx/hud/. 0 = disable background by default"
 seta hud_bg_color "0 0.7 0.8" "sets the default background color for the panels"
 seta hud_bg_alpha 0.8 "alpha of the background"
+seta hud_configure_bg_minalpha 0.5 "minimum panel background alpha when in hud configure mode"
 seta hud_bg_border 10 "sets the default border size for the panels"
 seta hud_fg_alpha 1 "alpha of the foreground"
 
diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc
index e828ac1dd5..8cd8794a96 100644
--- a/qcsrc/client/hud.qc
+++ b/qcsrc/client/hud.qc
@@ -652,6 +652,8 @@ void HUD_Panel_DrawBg(float id, vector pos, vector mySize)
 		alpha = cvar(strcat("hud_", HUD_Panel_GetName(id), "_bg_alpha"));
 		if(!alpha)
 			alpha = cvar("hud_bg_alpha");
+		if(cvar("_hud_configure"))
+			alpha = max(cvar("hud_configure_bg_minalpha"), alpha);
 
 		draw_BorderPicture(pos - '1 1 0' * border, strcat("gfx/hud/", bg), mySize + '1 1 0' * 2 * border, color, alpha, '1 1 0' * (border/BORDER_MULTIPLIER));
 	}
-- 
2.39.5