]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix crosshair selection to show REAL size
authorRudolf Polzer <divverent@alientrap.org>
Tue, 27 Dec 2011 20:04:05 +0000 (21:04 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 27 Dec 2011 20:04:05 +0000 (21:04 +0100)
qcsrc/menu/xonotic/crosshairbutton.c

index caaa1232211c8cd51b84dc7c5af073e2de0d7bed..c3921c3a41cf22d2fbd4c63b17faf86fea52dd3b 100644 (file)
@@ -69,12 +69,20 @@ void XonoticCrosshairButton_draw(entity me)
        vector sz, rgb;
        float a;
 
-       rgb = stov(cvar_string("crosshair_color"));
-       a = cvar("crosshair_alpha");
 
-       if(!me.checked && !me.focused && me.cvarValueFloat != -1)
+       if(me.cvarValueFloat == -1)
+       {
+               rgb = stov(cvar_string("crosshair_color"));
+               a = cvar("crosshair_alpha");
+       }
+       else if(me.checked || me.focused)
+       {
+               a = 1;
+               rgb = '1 1 1';
+       }
+       else
        {
-               a *= me.disabledAlpha;
+               a = me.disabledAlpha;
                rgb = '1 1 1';
        }
 
@@ -90,14 +98,16 @@ void XonoticCrosshairButton_draw(entity me)
        SUPER(XonoticCrosshairButton).draw(me);
 
        sz = draw_PictureSize(me.src3);
-       sz = globalToBoxSize(sz, draw_scale);
+       sz = globalToBoxSize(sz, me.size);
        if(me.cvarValueFloat == -1)
        {
-               sz = (6 * '1 1 0' + sz * cvar("crosshair_size")) * 0.08; // (6 * '1 1 0' + ...) * 0.08 here to make visible size changes happen also at bigger sizes
+               sz = sz * cvar("crosshair_size"); // (6 * '1 1 0' + ...) * 0.08 here to make visible size changes happen also at bigger sizes
+               /*
                if(sz_x > 0.95)
                        sz = sz * (0.95 / sz_x);
                if(sz_y > 0.95)
                        sz = sz * (0.95 / sz_y);
+               */
        }
        else // show the crosshair picker at full size
                sz = '0.95 0.95 0';