From: FruitieX Date: Fri, 14 May 2010 16:45:45 +0000 (+0300) Subject: export more hud cvars and remove some unused cvars X-Git-Tag: xonotic-v0.1.0preview~541^2~170 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=8a48b6e657bde0f2877901fa0381df32f3b7e723 export more hud cvars and remove some unused cvars --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 353540ec4f..37f3a0f23a 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1330,13 +1330,12 @@ con_notifyalign 0 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" @@ -1347,14 +1346,12 @@ seta hud_dock_alpha 0.8 "alpha of the dock" 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" diff --git a/qcsrc/client/Defs.qc b/qcsrc/client/Defs.qc index 14f9301b09..67d4b1ff7e 100644 --- a/qcsrc/client/Defs.qc +++ b/qcsrc/client/Defs.qc @@ -151,7 +151,6 @@ void end_sys_fields; // flag for structure dumping float intermission; float sb_showscores; float sb_showaccuracy; -float hud_currentammo; .string message; .float renderflags; // float coop; diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 5c69c161e6..676c1dbc85 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -468,8 +468,6 @@ void CSQC_UpdateView(float w, float h) } hud_alpha_fg = cvar_or("hud_fg_alpha", 1) * (1 - cvar("_menu_alpha")); - hud_currentammo = cvar("hud_showcurrentammo"); - hud_hudselector = cvar("hud_hudselector"); hud_accuracy_hud = cvar_or("hud_accuracy_hud", 1); ColorTranslateMode = cvar("cl_stripcolorcodes"); activeweapon = getstati(STAT_SWITCHWEAPON); diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index e5973ed402..4d1a5b70d3 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -99,7 +99,7 @@ vector HUD_GetBgColor() 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; @@ -567,6 +567,29 @@ void HUD_Panel_ExportCfg(string cfgname) 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) { @@ -577,6 +600,24 @@ void HUD_Panel_ExportCfg(string cfgname) 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"); } @@ -1091,7 +1132,7 @@ void HUD_WeaponIcons() 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) @@ -1482,6 +1523,7 @@ void HUD_HealthArmor(void) float len; // TODO! + /* if(hud_hudselector == 2) // combined health and armor display { vector v; @@ -1505,6 +1547,7 @@ void HUD_HealthArmor(void) } HUD_DrawXNum_Colored(num_pos, x, 3, 24, hud_alpha_fg); // draw the combined health and armor } + */ else { @@ -1820,6 +1863,7 @@ void HUD_RaceTimer (void) { drawfont = hud_font; } +// ___TODO___ !!! // Notification area (#4) void HUD_Notify (void) { diff --git a/qcsrc/client/hud.qh b/qcsrc/client/hud.qh index 8686422312..e0ba776d78 100644 --- a/qcsrc/client/hud.qh +++ b/qcsrc/client/hud.qh @@ -22,7 +22,6 @@ float weapontime; float teamnagger; float hud_alpha_fg; float hud_alpha_bg; -float hud_hudselector; float hud_accuracy_hud; float hud_border_thickness; float hud_accuracy_border_thickness;