From: terencehill Date: Sun, 7 Nov 2010 21:14:23 +0000 (+0100) Subject: Use only one cvar to define the crosshair color and add the color picker in the menu... X-Git-Tag: xonotic-v0.1.0preview~134^2~3^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=28be6594603d21465f3d3e7d009f88e15b9eb8a7;p=xonotic%2Fxonotic-data.pk3dir.git Use only one cvar to define the crosshair color and add the color picker in the menu for it --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index dfd211f47..ee119b226 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -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" diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 074a3be5e..7393c93fd 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -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"))); } } diff --git a/qcsrc/menu/xonotic/crosshairbutton.c b/qcsrc/menu/xonotic/crosshairbutton.c index 645b93207..7ed683d01 100644 --- a/qcsrc/menu/xonotic/crosshairbutton.c +++ b/qcsrc/menu/xonotic/crosshairbutton.c @@ -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) diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c index 2a075f4c9..352f07757 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c @@ -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'));