]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use only one cvar to define the crosshair color and add the color picker in the menu...
authorterencehill <piuntn@gmail.com>
Sun, 7 Nov 2010 21:14:23 +0000 (22:14 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 7 Nov 2010 22:32:24 +0000 (23:32 +0100)
defaultXonotic.cfg
qcsrc/client/View.qc
qcsrc/menu/xonotic/crosshairbutton.c
qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c

index dfd211f478680b9ee2f4b92c3661d4084afaf7b7..ee119b2262b0c6a76168c89a790bf60bb66958f1 100644 (file)
@@ -90,9 +90,7 @@ _cl_name Player
 _cl_playermodel models/player/umbra.iqm
 _cl_playerskin 0
 seta crosshair 3
-seta crosshair_color_red 0.6
-seta crosshair_color_green 0.8
-seta crosshair_color_blue 1
+seta crosshair_color "0.6 0.8 1"
 seta crosshair_alpha 1
 seta crosshair_size 0.35
 seta crosshair_dot 1
@@ -108,111 +106,75 @@ seta crosshair_hittest 1 "do a crosshair hit evaluation; also, the crosshair is
 seta crosshair_hittest_blur 1 "blur the crosshair if the shot is obstructed"
 seta crosshair_hittest_showimpact 0 "move the crosshair to the actual impact location if obstructed"
 seta crosshair_laser ""        "crosshair to display when wielding the laser"
-seta crosshair_laser_color_red 1       "crosshair color red component to display when wielding the laser"
-seta crosshair_laser_color_green 0.35  "crosshair color green component to display when wielding the laser"
-seta crosshair_laser_color_blue 0.2    "crosshair color blue component to display when wielding the laser"
+seta crosshair_laser_color "1 0.35 0.2"        "crosshair color to display when wielding the laser"
 seta crosshair_laser_alpha 0.75        "crosshair alpha value to display when wielding the laser"
 seta crosshair_laser_size 0.4  "crosshair size when wielding the laser"
 seta crosshair_shotgun ""      "crosshair to display when wielding the shotgun"
-seta crosshair_shotgun_color_red 0.7   "crosshair color red component to display when wielding the shotgun"
-seta crosshair_shotgun_color_green 0.7 "crosshair color green component to display when wielding the shotgun"
-seta crosshair_shotgun_color_blue 0.7  "crosshair color blue component to display when wielding the shotgun"
+seta crosshair_shotgun_color "0.7 0.7 0.7"     "crosshair color to display when wielding the shotgun"
 seta crosshair_shotgun_alpha 1.1       "crosshair alpha value to display when wielding the shotgun"
 seta crosshair_shotgun_size 0.65       "crosshair size when wielding the shotgun"
 seta crosshair_uzi ""  "crosshair to display when wielding the machinegun"
-seta crosshair_uzi_color_red 0.4       "crosshair color red component to display when wielding the machinegun"
-seta crosshair_uzi_color_green 0.9     "crosshair color green component to display when wielding the machinegun"
-seta crosshair_uzi_color_blue 0.35     "crosshair color blue component to display when wielding the machinegun"
+seta crosshair_uzi_color "0.4 0.9 0.35"        "crosshair color to display when wielding the machinegun"
 seta crosshair_uzi_alpha 0.9   "crosshair alpha value to display when wielding the machinegun"
 seta crosshair_uzi_size 0.6    "crosshair size when wielding the machinegun"
 seta crosshair_grenadelauncher ""      "crosshair to display when wielding the mortar"
-seta crosshair_grenadelauncher_color_red 1     "crosshair color red component to display when wielding the mortar"
-seta crosshair_grenadelauncher_color_green 0.15        "crosshair color green component to display when wielding the mortar"
-seta crosshair_grenadelauncher_color_blue 0    "crosshair color blue component to display when wielding the mortar"
+seta crosshair_grenadelauncher_color "1 0.15 0"        "crosshair color to display when wielding the mortar"
 seta crosshair_grenadelauncher_alpha 1.15      "crosshair alpha value to display when wielding the mortar"
 seta crosshair_grenadelauncher_size 0.7        "crosshair size when wielding the mortar"
 seta crosshair_minelayer ""    "crosshair to display when wielding the mortar"
-seta crosshair_minelayer_color_red 0.75        "crosshair color red component to display when wielding the mortar"
-seta crosshair_minelayer_color_green 0.75      "crosshair color green component to display when wielding the mortar"
-seta crosshair_minelayer_color_blue 0  "crosshair color blue component to display when wielding the mortar"
+seta crosshair_minelayer_color "0.75 0.75 0"   "crosshair color to display when wielding the mortar"
 seta crosshair_minelayer_alpha 1.15    "crosshair alpha value to display when wielding the mortar"
 seta crosshair_minelayer_size 0.9      "crosshair size when wielding the mortar"
 seta crosshair_electro ""      "crosshair to display when wielding the electro"
-seta crosshair_electro_color_red 0.35  "crosshair color red component to display when wielding the electro"
-seta crosshair_electro_color_green 0.5 "crosshair color green component to display when wielding the electro"
-seta crosshair_electro_color_blue 1    "crosshair color blue component to display when wielding the electro"
+seta crosshair_electro_color "0.35 0.5 1"      "crosshair color to display when wielding the electro"
 seta crosshair_electro_alpha 1 "crosshair alpha value to display when wielding the electro"
 seta crosshair_electro_size 0.5        "crosshair size when wielding the electro"
 seta crosshair_crylink ""      "crosshair to display when wielding the crylink"
-seta crosshair_crylink_color_red 0.85  "crosshair color red component to display when wielding the crylink"
-seta crosshair_crylink_color_green 0.25        "crosshair color green component to display when wielding the crylink"
-seta crosshair_crylink_color_blue 1    "crosshair color blue component to display when wielding the crylink"
+seta crosshair_crylink_color "0.85 0.25 1"     "crosshair color to display when wielding the crylink"
 seta crosshair_crylink_alpha 0.85      "crosshair alpha value to display when wielding the crylink"
 seta crosshair_crylink_size 0.4        "crosshair size when wielding the crylink"
 seta crosshair_nex ""  "crosshair to display when wielding the nex gun"
-seta crosshair_nex_color_red 0 "crosshair color red component to display when wielding the nex gun"
-seta crosshair_nex_color_green 0.9     "crosshair color green component to display when wielding the nex gun"
-seta crosshair_nex_color_blue 1        "crosshair color blue component to display when wielding the nex gun"
+seta crosshair_nex_color "0 0.9 1"     "crosshair color to display when wielding the nex gun"
 seta crosshair_nex_alpha 0.85  "crosshair alpha value to display when wielding the nex gun"
 seta crosshair_nex_size 0.65   "crosshair size when wielding the nex gun"
 seta crosshair_hagar ""        "crosshair to display when wielding the hagar"
-seta crosshair_hagar_color_red 0.85    "crosshair color red component to display when wielding the hagar"
-seta crosshair_hagar_color_green 0.5   "crosshair color green component to display when wielding the hagar"
-seta crosshair_hagar_color_blue 0.35   "crosshair color blue component to display when wielding the hagar"
+seta crosshair_hagar_color "0.85 0.5 0.35"     "crosshair color to display when wielding the hagar"
 seta crosshair_hagar_alpha 1   "crosshair alpha value to display when wielding the hagar"
 seta crosshair_hagar_size 0.8  "crosshair size when wielding the hagar"
 seta crosshair_rocketlauncher ""       "crosshair to display when wielding the rocketlauncher"
-seta crosshair_rocketlauncher_color_red 1      "crosshair color red component to display when wielding the rocketlauncher"
-seta crosshair_rocketlauncher_color_green 0.75 "crosshair color green component to display when wielding the rocketlauncher"
-seta crosshair_rocketlauncher_color_blue 0.2   "crosshair color blue component to display when wielding the rocketlauncher"
+seta crosshair_rocketlauncher_color "1 0.75 0.2"       "crosshair color to display when wielding the rocketlauncher"
 seta crosshair_rocketlauncher_alpha 1  "crosshair alpha value to display when wielding the rocketlauncher"
 seta crosshair_rocketlauncher_size 0.5875      "crosshair size when wielding the rocketlauncher"
 seta crosshair_porto ""        "crosshair to display when wielding the porto"
-seta crosshair_porto_color_red 0.5     "crosshair color red component to display when wielding the porto"
-seta crosshair_porto_color_green 1     "crosshair color green component to display when wielding the porto"
-seta crosshair_porto_color_blue 0.5    "crosshair color blue component to display when wielding the porto"
+seta crosshair_porto_color "0.5 1 0.5" "crosshair color to display when wielding the porto"
 seta crosshair_porto_alpha 0.85        "crosshair alpha value to display when wielding the porto"
 seta crosshair_porto_size 0.6  "crosshair size when wielding the porto"
 seta crosshair_minstanex ""    "crosshair to display when wielding the minstanex gun"
-seta crosshair_minstanex_color_red 0.65        "crosshair color red component to display when wielding the minstanex gun"
-seta crosshair_minstanex_color_green 0.65      "crosshair color green component to display when wielding the minstanex gun"
-seta crosshair_minstanex_color_blue 1  "crosshair color blue component to display when wielding the minstanex gun"
+seta crosshair_minstanex_color "0.65 0.65 1"   "crosshair color to display when wielding the minstanex gun"
 seta crosshair_minstanex_alpha 1       "crosshair alpha value to display when wielding the minstanex gun"
 seta crosshair_minstanex_size 0.4      "crosshair size when wielding the minstanex gun"
 seta crosshair_hook "" "crosshair to display when wielding the hook"
-seta crosshair_hook_color_red 0.65     "crosshair color red component to display when wielding the hook"
-seta crosshair_hook_color_green 1      "crosshair color green component to display when wielding the hook"
-seta crosshair_hook_color_blue 0.85    "crosshair color blue component to display when wielding the hook"
+seta crosshair_hook_color "0.65 1 0.85"        "crosshair color to display when wielding the hook"
 seta crosshair_hook_alpha 0.85 "crosshair alpha value to display when wielding the hook"
 seta crosshair_hook_size 0.5   "crosshair size when wielding the hook"
 seta crosshair_hlac "" "crosshair to display when wielding the H.L.A.C"
-seta crosshair_hlac_color_red 1        "crosshair color red component to display when wielding the H.L.A.C."
-seta crosshair_hlac_color_green 0.65   "crosshair color green component to display when wielding the H.L.A.C."
-seta crosshair_hlac_color_blue 0.2     "crosshair color blue component to display when wielding the H.L.A.C."
+seta crosshair_hlac_color "1 0.65 0.2" "crosshair color to display when wielding the H.L.A.C."
 seta crosshair_hlac_alpha 1    "crosshair alpha value to display when wielding the H.L.A.C."
 seta crosshair_hlac_size 0.6   "crosshair size when wielding the H.L.A.C."
 seta crosshair_seeker ""       "crosshair to display when wielding the TAG Seeker"
-seta crosshair_seeker_color_red 1      "crosshair color red component to display when wielding the TAG seeker"
-seta crosshair_seeker_color_green 0.35 "crosshair color green component to display when wielding the TAG seeker"
-seta crosshair_seeker_color_blue 0.35  "crosshair color blue component to display when wielding the TAG seeker"
+seta crosshair_seeker_color "1 0.35 0.35"      "crosshair color to display when wielding the TAG seeker"
 seta crosshair_seeker_alpha 0.9        "crosshair alpha value to display when wielding the TAG seeker"
 seta crosshair_seeker_size 0.8 "crosshair size when wielding the TAG seeker"
 seta crosshair_campingrifle "" "crosshair to display when wielding the campingrifle"
-seta crosshair_campingrifle_color_red 0.85     "crosshair color red component to display when wielding the campingrifle"
-seta crosshair_campingrifle_color_green 0.5    "crosshair color green component to display when wielding the campingrifle"
-seta crosshair_campingrifle_color_blue 0.25    "crosshair color blue component to display when wielding the campingrifle"
+seta crosshair_campingrifle_color "0.85 0.5 0.25"      "crosshair color to display when wielding the campingrifle"
 seta crosshair_campingrifle_alpha 1    "crosshair alpha value to display when wielding the campingrifle"
 seta crosshair_campingrifle_size 0.65  "crosshair size when wielding the campingrifle"
 seta crosshair_tuba "" "crosshair to display when wielding the tuba"
-seta crosshair_tuba_color_red 0.85     "crosshair color red component to display when wielding the tuba"
-seta crosshair_tuba_color_green 0.5    "crosshair color green component to display when wielding the tuba"
-seta crosshair_tuba_color_blue 0.25    "crosshair color blue component to display when wielding the tuba"
+seta crosshair_tuba_color "0.85 0.5 0.25"      "crosshair color to display when wielding the tuba"
 seta crosshair_tuba_alpha 1    "crosshair alpha value to display when wielding the tuba"
 seta crosshair_tuba_size 1     "crosshair size when wielding the tuba"
 seta crosshair_fireball ""     "crosshair to display when wielding the fireball"
-seta crosshair_fireball_color_red 0.2  "crosshair color red component to display when wielding the fireball"
-seta crosshair_fireball_color_green 1.0        "crosshair color green component to display when wielding the fireball"
-seta crosshair_fireball_color_blue 0.2 "crosshair color blue component to display when wielding the fireball"
+seta crosshair_fireball_color "0.2 1.0 0.2"    "crosshair color to display when wielding the fireball"
 seta crosshair_fireball_alpha 1        "crosshair alpha value to display when wielding the fireball"
 seta crosshair_fireball_size 1 "crosshair size when wielding the fireball"
 seta crosshair_ring_size 2     "bullet counter ring size for Rifle, velocity ring for Nex"
index 074a3be5eec6f8d63eb1e671e48e70ca44189980..7393c93fdb12965a42b4d749e585f21e05d6c9d9 100644 (file)
@@ -741,9 +741,7 @@ void CSQC_UpdateView(float w, float h)
                        string wcross_wep, wcross_name;
                        float wcross_scale, wcross_blur;
 
-                       wcross_color_x = cvar("crosshair_color_red");
-                       wcross_color_y = cvar("crosshair_color_green");
-                       wcross_color_z = cvar("crosshair_color_blue");
+                       wcross_color = stov(cvar_string("crosshair_color"));
                        if (cvar("crosshair_per_weapon")) {
                                e = get_weaponinfo(activeweapon);
                                if (e && e.netname != "")
@@ -761,11 +759,7 @@ void CSQC_UpdateView(float w, float h)
                                                wcross_style = e.netname;
 
                                        if(!cvar("crosshair_color_override"))
-                                       {
-                                               wcross_color_x = cvar(strcat("crosshair_", wcross_wep, "_color_red"));
-                                               wcross_color_y = cvar(strcat("crosshair_", wcross_wep, "_color_green"));
-                                               wcross_color_z = cvar(strcat("crosshair_", wcross_wep, "_color_blue"));
-                                       }
+                                               wcross_color = stov(cvar_string(strcat("crosshair_", wcross_wep, "_color")));
                                }
                        }
 
index 645b9320750fcedced0f2c6b7f0ec5947a7af888..7ed683d01e11c1b8107f38ed9e36841e3be70dae 100644 (file)
@@ -65,7 +65,7 @@ void XonoticCrosshairButton_draw(entity me)
        vector sz, rgb;
        float a;
 
-       rgb = eX * cvar("crosshair_color_red") + eY * cvar("crosshair_color_green") + eZ * cvar("crosshair_color_blue");
+       rgb = stov(cvar_string("crosshair_color"));
        a = cvar("crosshair_alpha");
 
        if(!me.checked && !me.focused)
index 2a075f4c921e943a796e2483eedeace3b48d6e1e..352f077571ce01fbbad950bb8d7ab70555676308 100644 (file)
@@ -135,18 +135,8 @@ void XonoticPlayerSettingsTab_fill(entity me)
                me.TD(me, 1, 1.8, e = makeXonoticSlider(0, 1, 0.1, "crosshair_alpha"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair red:"));
-               me.TD(me, 1, 1.8, e = makeXonoticSlider(0, 1, 0.01, "crosshair_color_red"));
-               setDependentOR(e, "crosshair_per_weapon", 0, 0, "crosshair_color_override", 1, 1);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair green:"));
-               me.TD(me, 1, 1.8, e = makeXonoticSlider(0, 1, 0.01, "crosshair_color_green"));
-               setDependentOR(e, "crosshair_per_weapon", 0, 0, "crosshair_color_override", 1, 1);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair blue:"));
-               me.TD(me, 1, 1.8, e = makeXonoticSlider(0, 1, 0.01, "crosshair_color_blue"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair color:"));
+               me.TD(me, 2, 1.8, e = makeXonoticColorpickerString("crosshair_color"));
                setDependentOR(e, "crosshair_per_weapon", 0, 0, "crosshair_color_override", 1, 1);
        me.TR(me);
                me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", "Enable centered dot"));
@@ -163,6 +153,7 @@ void XonoticPlayerSettingsTab_fill(entity me)
                me.TD(me, 1, 2/3, e = makeXonoticRadioButton(1, "crosshair_hittest", "0",    "None"));
                me.TD(me, 1, 2/3, e = makeXonoticRadioButton(1, "crosshair_hittest", "1",    "TrueAim"));
                me.TD(me, 1, 2/3, e = makeXonoticRadioButton(1, "crosshair_hittest", "1.25", "Enemies"));
+       me.TR(me);
        me.TR(me);
                me.TDempty(me, 0.4);
                me.TD(me, 1, 2.2, e = makeXonoticButton("Waypoints setup...", '0 0 0'));