]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
export more hud cvars and remove some unused cvars
authorFruitieX <rasse@rasse-lappy.localdomain>
Fri, 14 May 2010 16:45:45 +0000 (19:45 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Fri, 14 May 2010 16:45:45 +0000 (19:45 +0300)
defaultXonotic.cfg
qcsrc/client/Defs.qc
qcsrc/client/View.qc
qcsrc/client/hud.qc
qcsrc/client/hud.qh

index 353540ec4f13ff939061df09236f6d40c52d6453..37f3a0f23ac795a411e24af7b3d33c00ca87870d 100644 (file)
@@ -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"
 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_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 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 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 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"
 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"
index 14f9301b094497fbf5fb80480e433c463d8e3b81..67d4b1ff7e780918379e66e7b8999f43d7df4ca6 100644 (file)
@@ -151,7 +151,6 @@ void                end_sys_fields;                 // flag for structure dumping
 float          intermission;
 float          sb_showscores;
 float          sb_showaccuracy;
 float          intermission;
 float          sb_showscores;
 float          sb_showaccuracy;
-float          hud_currentammo;
 .string                message;
 .float renderflags;
 // float               coop;
 .string                message;
 .float renderflags;
 // float               coop;
index 5c69c161e650d3ddc530d37d43af033a992b6c04..676c1dbc8569d223038fe22d3099ae69543242ef 100644 (file)
@@ -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_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);
        hud_accuracy_hud = cvar_or("hud_accuracy_hud", 1);
        ColorTranslateMode = cvar("cl_stripcolorcodes");
        activeweapon = getstati(STAT_SWITCHWEAPON);
index e5973ed402467b3f0f94a6206a659c152fb34a3f..4d1a5b70d3707e2a136b58934bd3557ed0ce9855 100644 (file)
@@ -99,7 +99,7 @@ vector HUD_GetBgColor()
 vector HUD_AccuracyColor(float accuracy)
 {
        vector rgb;
 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;
        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)
        {
        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)
                {
                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"));
                        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");
                }
 
                        fputs(fh, "\n");
                }
 
@@ -1091,7 +1132,7 @@ void HUD_WeaponIcons()
 
        pos = HUD_Panel_GetPos(0);
        mySize = HUD_Panel_GetSize(0);
 
        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)
 
        stat_weapons = getstati(STAT_WEAPONS);
        for(i = WEP_FIRST; i <= WEP_LAST; ++i)
@@ -1482,6 +1523,7 @@ void HUD_HealthArmor(void)
        float len;
 
        // TODO!
        float len;
 
        // TODO!
+       /*
        if(hud_hudselector == 2) // combined health and armor display
        {
                vector v;
        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
        }
                }
                HUD_DrawXNum_Colored(num_pos, x, 3, 24, hud_alpha_fg); // draw the combined health and armor
        }
+       */
 
        else
        {
 
        else
        {
@@ -1820,6 +1863,7 @@ void HUD_RaceTimer (void) {
        drawfont = hud_font;
 }
 
        drawfont = hud_font;
 }
 
+// ___TODO___ !!!
 // Notification area (#4)
 void HUD_Notify (void)
 {
 // Notification area (#4)
 void HUD_Notify (void)
 {
index 8686422312e404c2ab86471ce42e7dc1d3b83dbb..e0ba776d7823b81cc07716746eb8dfed6c13e874 100644 (file)
@@ -22,7 +22,6 @@ float weapontime;
 float teamnagger;
 float hud_alpha_fg;
 float hud_alpha_bg;
 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;
 float hud_accuracy_hud;
 float hud_border_thickness;
 float hud_accuracy_border_thickness;