set _hud_configure 0 "1 = configure the HUD"
seta hud_skin old "skin folder where to look for images"
-seta hud_accuracy_yellow 40 "percentage at which the accuracy color is yellow"
-seta hud_progressbar_alpha "0.5" "alpha of progressbars"
seta hud_bg 0 "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.6 0.9" "sets the default background color for the panels"
seta hud_bg_alpha 0.8 "alpha of the background"
seta hud_bg_border 10 "sets the default border size for the panels"
seta hud_fg_alpha 1 "alpha of the foreground"
+seta hud_progressbar_alpha "0.5" "alpha of progressbars"
seta hud_configure_checkcollisions 1 "check for collisions against other panels when in hud configure mode"
seta hud_configure_bg_minalpha 0.5 "minimum panel background alpha when in hud configure mode"
seta sbar_info_pos 50
-seta hud_hudselector 1 "0 = health/armor positions flipped, 1 = default hud layout, 2 = combined health and armor display"
-seta hud_showcurrentammo 0 "0 = show all ammo types, 1 = show only the ammo type of the current weapon"
-
seta hud_weaponicons 1 "enable/disable this panel"
seta hud_weaponicons_pos "-0.635295 -0.134116" "position of this panel"
seta hud_weaponicons_size "0.352942 0.064845" "size of this panel"
seta hud_weaponicons_number 1 "show number of weapon"
-seta hud_weaponicons_accuracybar_height 3 "height of accuracy bar"
+seta hud_weaponicons_accuracy_height 3 "height of accuracy bar"
+seta hud_weaponicons_accuracy_yellow 40 "percentage at which the accuracy color is yellow"
seta hud_weaponicons_bg "" "if set to something else than \"\" = override default background, if set to 0 = disable background"
seta hud_weaponicons_bg_color "" "optional R G B string of the background color, otherwise use hud default"
seta hud_weaponicons_bg_alpha 0 "if set to something else than 0 = override default alpha"
vector HUD_AccuracyColor(float accuracy)
{
vector rgb;
- float yellow_accuracy = cvar("hud_accuracy_yellow"); // value at which this function returns yellow
+ float yellow_accuracy = cvar("hud_weaponicons_accuracy_yellow"); // value at which this function returns yellow
if(accuracy >= 100) {
rgb_x = 0;
rgb_y = 1;
fh = fopen(strcat("hud_", cvar_string("hud_skin"), "_", cfgname, ".cfg"), FILE_WRITE);
if(fh >= 0)
{
+ fputs(fh, strcat("seta hud_skin \"", cvar_string("hud_skin"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_bg \"", cvar_string("hud_bg"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_bg_color \"", cvar_string("hud_bg_color"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_bg_alpha ", cvar("hud_bg_alpha"), "\n"));
+ fputs(fh, strcat("seta hud_bg_border ", cvar("hud_bg_border"), "\n"));
+ fputs(fh, strcat("seta hud_fg_alpha ", cvar("hud_fg_alpha"), "\n"));
+ fputs(fh, strcat("seta hud_accuracy_yellow ", cvar("hud_accuracy_yellow"), "\n"));
+ fputs(fh, "\n");
+
+ fputs(fh, strcat("seta hud_dock \"", cvar_string("hud_dock"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_dock_color \"", cvar_string("hud_dock_color"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_dock_alpha ", cvar("hud_dock_alpha"), "\n"));
+ fputs(fh, "\n");
+
+ fputs(fh, strcat("seta hud_progressbar_alpha ", cvar("hud_progressbar_alpha"), "\n"));
+ fputs(fh, strcat("seta hud_progressbar_strength_color \"", cvar_string("hud_progressbar_strength_color"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_progressbar_shield_color \"", cvar_string("hud_progressbar_shield_color"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_progressbar_health_color \"", cvar_string("hud_progressbar_health_color"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_progressbar_armor_color \"", cvar_string("hud_progressbar_armor_color"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_progressbar_fuel_color \"", cvar_string("hud_progressbar_fuel_color"), "\"", "\n"));
+ fputs(fh, "\n");
+
+ // common cvars for all panels
float i;
for (i = 0; i < panel_cnt; ++i)
{
fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_color \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg_color")), "\"", "\n"));
fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_alpha ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_bg_alpha"))), "\n"));
fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_border ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_bg_border"))), "\n"));
+ switch(i) {
+ case 0:
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_accuracy_height ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_accuracy_height"))), "\n"));
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_accuracy_yellow ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_accuracy_yellow"))), "\n"));
+ break;
+ case 1:
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_onlycurrent ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_onlycurrent"))), "\n"));
+ break;
+ case 2:
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_flip ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_flip"))), "\n"));
+ break;
+ case 3:
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_flip ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_flip"))), "\n"));
+ break;
+ case 9:
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_alreadyvoted_alpha ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_alreadyvoted_alpha"))), "\n"));
+ break;
+ }
fputs(fh, "\n");
}
pos = HUD_Panel_GetPos(0);
mySize = HUD_Panel_GetSize(0);
- accuracybar_height = cvar_or("hud_weaponicons_accuracybar_height", 3);
+ accuracybar_height = cvar_or("hud_weaponicons_accuracy_height", 3);
stat_weapons = getstati(STAT_WEAPONS);
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
float len;
// TODO!
+ /*
if(hud_hudselector == 2) // combined health and armor display
{
vector v;
}
HUD_DrawXNum_Colored(num_pos, x, 3, 24, hud_alpha_fg); // draw the combined health and armor
}
+ */
else
{
drawfont = hud_font;
}
+// ___TODO___ !!!
// Notification area (#4)
void HUD_Notify (void)
{