]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Finish creating crosshair settings dialog
authorSamual <samual@xonotic.org>
Wed, 18 Jan 2012 18:46:28 +0000 (13:46 -0500)
committerSamual <samual@xonotic.org>
Wed, 18 Jan 2012 18:46:28 +0000 (13:46 -0500)
defaultXonotic.cfg
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/menu/xonotic/crosshairbutton.c
qcsrc/menu/xonotic/dialog_multiplayer_playersetup_crosshair.c

index e8d6dc7c07959aa269432fd5d198fe40fcd27ae9..aee61f20084a27232c7760385a428bdc05b8b462 100644 (file)
@@ -69,7 +69,8 @@ seta crosshair_size 0.500000
 seta crosshair_dot 0 
 seta crosshair_dot_alpha 1
 seta crosshair_dot_size 0.600000
-seta crosshair_dot_color "1 0 0" "when != 0, use custom color for the crosshair dot"
+seta crosshair_dot_color "1 0 0" 
+seta crosshair_dot_color_custom 1 "use a custom color for the crosshair dot"
 seta crosshair_pickup 0.25
 seta crosshair_pickup_speed 4
 seta crosshair_hitindication 0.5
index 9f0fc25d2943b7bec27d790965ac3e2585d8d264..2886d3296d135f9f2260a467e2787fbad4685ae4 100644 (file)
@@ -1371,8 +1371,10 @@ void CSQC_UpdateView(float w, float h)
                                {
                                        vector wcross_color_old;
                                        wcross_color_old = wcross_color;
-                                       if(autocvar_crosshair_dot_color != "0")
+                                       
+                                       if((autocvar_crosshair_dot_color_custom) && (autocvar_crosshair_dot_color != "0"))
                                                wcross_color = stov(autocvar_crosshair_dot_color);
+                                               
                                        CROSSHAIR_DRAW(wcross_resolution * autocvar_crosshair_dot_size, "gfx/crosshairdot.tga", f * autocvar_crosshair_dot_alpha);
                                        // FIXME why don't we use wcross_alpha here?
                                        wcross_color = wcross_color_old;
index 6ea8ad80e337312bd0be9b05ceda47eb56bf2266..f0aacf060f75fff05e67b323b6bfed740590cbeb 100644 (file)
@@ -89,6 +89,7 @@ float autocvar_crosshair_color_per_weapon;
 float autocvar_crosshair_dot;
 float autocvar_crosshair_dot_alpha;
 string autocvar_crosshair_dot_color;
+float autocvar_crosshair_dot_color_custom;
 float autocvar_crosshair_dot_size;
 float autocvar_crosshair_effect_scalefade;
 float autocvar_crosshair_effect_speed;
index 9456cd66da2d2f22fdb48dd0db6d9560e1ccc086..0b501f5b642dfa181ff11d6b164ba51812949664 100644 (file)
@@ -118,10 +118,11 @@ void XonoticCrosshairButton_draw(entity me)
 
        draw_Picture('0.5 0.5 0' - 0.5 * sz, me.src3, sz, rgb, a);
        if(cvar("crosshair_dot"))
-    {
-        if(cvar_string("crosshair_dot_color") != "0")
-            rgb = stov(cvar_string("crosshair_dot_color"));
+       {
+               if(cvar("crosshair_dot_color_custom") && (cvar_string("crosshair_dot_color") != "0"))
+                       rgb = stov(cvar_string("crosshair_dot_color"));
+                       
                draw_Picture('0.5 0.5 0' - 0.5 * sz * cvar("crosshair_dot_size"), me.src4, sz * cvar("crosshair_dot_size"), rgb, a * cvar("crosshair_dot_alpha"));
-    }
+       }
 }
 #endif
index 7ca7d9622f9b561f61eb5006bbb4dfbd967f80e6..56aedcab8b05d4e36d018e4f5be23a6fe7d8553c 100644 (file)
@@ -6,7 +6,7 @@ CLASS(XonoticCrosshairDialog) EXTENDS(XonoticDialog)
        ATTRIB(XonoticCrosshairDialog, title, string, _("Crosshair settings"))
        ATTRIB(XonoticCrosshairDialog, color, vector, SKINCOLOR_DIALOG_CROSSHAIR)
        ATTRIB(XonoticCrosshairDialog, intendedWidth, float, 0.5)
-       ATTRIB(XonoticCrosshairDialog, rows, float, 12)
+       ATTRIB(XonoticCrosshairDialog, rows, float, 18)
        ATTRIB(XonoticCrosshairDialog, columns, float, 3)
 ENDCLASS(XonoticCrosshairDialog)
 #endif
@@ -24,8 +24,69 @@ void XonoticCrosshairDialog_fill(entity me)
 {
        entity e;
        
-
-               
+       me.TR(me);
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", _("Enable center crosshair dot")));
+               setDependent(e, "crosshair_enabled", 1, 2);
+       me.TR(me);
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Dot size:")));
+                       setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
+               me.TD(me, 1, 2, e = makeXonoticSlider(0.2, 2, 0.1, "crosshair_dot_size"));
+                       setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
+       me.TR(me);
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Dot alpha:")));
+                       setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
+               me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_dot_alpha"));
+                       setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
+       me.TR(me);
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Dot color:")));
+                       setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
+               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "0", _("Use normal crosshair color")));
+                       setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
+       me.TR(me);
+               me.TDempty(me, 0.1);
+               me.TD(me, 1, 0.8, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "1", _("Custom")));
+                       setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
+               me.TD(me, 2, 2, e = makeXonoticColorpickerString("crosshair_dot_color", "crosshair_dot_color"));
+                       setDependentAND3(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2, "crosshair_dot_color_custom", 1, 1);
+       me.TR(me);
+       me.TR(me);
+       me.TR(me);
+               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Crosshair animations:")));
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "crosshair_effect_scalefade", _("Smooth effects of crosshairs")));
+                       setDependent(e, "crosshair_enabled", 1, 2);
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "crosshair_ring", _("Use rings to indicate weapon status")));
+                       makeMulti(e, "crosshair_ring_reload");
+                       setDependent(e, "crosshair_enabled", 1, 2);
+       me.TR(me);
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Hit testing:")));
+               me.TD(me, 1, 2, e = makeXonoticTextSlider("crosshair_hittest"));
+                       e.addValue(e, "Disabled", "0");
+                       e.addValue(e, "TrueAim", "1");
+                       e.addValue(e, "Enemies", "1.25");
+                       e.configureXonoticTextSliderValues(e);
+                       setDependent(e, "crosshair_enabled", 1, 2);
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "crosshair_hittest_blur", _("Blur crosshair if the shot is obstructed")));
+                       setDependentAND(e, "crosshair_hittest", 1, 100, "crosshair_enabled", 1, 2);
+       me.TR(me);
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(0.5, 0, "crosshair_hitindication", _("Animate when hitting an enemy")));
+                       setDependent(e, "crosshair_enabled", 1, 2);
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(0.25, 0, "crosshair_pickup", _("Animate when picking up an item")));
+                       setDependent(e, "crosshair_enabled", 1, 2);
+                       
+       me.TR(me);
+                       
        me.gotoRC(me, me.rows - 1, 0);
                me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
                        e.onClick = Dialog_Close;