]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/akari/healthcross'
authorRudolf Polzer <divVerent@xonotic.org>
Tue, 8 Feb 2011 09:39:23 +0000 (10:39 +0100)
committerRudolf Polzer <divVerent@xonotic.org>
Tue, 8 Feb 2011 09:39:23 +0000 (10:39 +0100)
Conflicts:
qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c

defaultXonotic.cfg
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c

index 0ad17417e2678c5c50d4cb7d33136475832c7d5c..360cac35f566af6d95309c4f1b0d882419f7412d 100644 (file)
@@ -9,6 +9,7 @@
 //
 // e.g. Xonotic 1.5.1 RC1 will be 15101
 set g_xonoticversion git "Xonotic version (formatted for humans)"
+
 gameversion 100 // 0.1.0
 gameversion_min 0 // git builds see all versions
 gameversion_max 65535 // git builds see all versions
@@ -181,6 +182,7 @@ seta crosshair_fireball ""  "crosshair 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_color_by_health 0 "if enabled, crosshair color will depend on current health"
 
 // ring around crosshair, used for various purposes (such as indicating bullets left in clip, nex charge)
 seta crosshair_ring_size 2     "bullet counter ring size for Rifle, velocity ring for Nex"
@@ -1365,7 +1367,6 @@ seta slowmo 1
 seta menu_skin "luminos"
 set menu_slowmo 1
 seta menu_sounds 0 "enables menu sound effects. 1 enables click sounds, 2 also enables hover sounds"
-set menu_picmip_bypass 0 "bypass texture quality enforcement based on system resources, not recommended and may cause crashes!"
 
 r_textbrightness 0.2
 r_textcontrast 0.8
index e5fa8cdbe5c39964861a008d033a3a33abba17b6..2e1a1c3d321da58c5a7006809970659745dbd718 100644 (file)
@@ -899,6 +899,50 @@ void CSQC_UpdateView(float w, float h)
                        }
                        if(wcross_wep != "" && autocvar_crosshair_color_per_weapon)
                                wcross_color = stov(cvar_string(strcat("crosshair_", wcross_wep, "_color")));
+                       else if(autocvar_crosshair_color_by_health)
+                       {
+                               local float x = getstati(STAT_HEALTH);
+                               
+                               //x = red
+                               //y = green
+                               //z = blue
+                               
+                               wcross_color_z = 0;
+                               
+                               if(x > 200)
+                               {
+                                       wcross_color_x = 0;
+                                       wcross_color_y = 1;
+                               }
+                               else if(x > 150)
+                               {
+                                       wcross_color_x = 0.4 - (x-150)*0.02 * 0.4;
+                                       wcross_color_y = 0.9 + (x-150)*0.02 * 0.1;
+                               }
+                               else if(x > 100)
+                               {
+                                       wcross_color_x = 1 - (x-100)*0.02 * 0.6;
+                                       wcross_color_y = 1 - (x-100)*0.02 * 0.1;
+                                       wcross_color_z = 1 - (x-100)*0.02;
+                               }
+                               else if(x > 50)
+                               {
+                                       wcross_color_x = 1;
+                                       wcross_color_y = 1;
+                                       wcross_color_z = 0.2 + (x-50)*0.02 * 0.8;  
+                               }
+                               else if(x > 20)
+                               {
+                                       wcross_color_x = 1;
+                                       wcross_color_y = (x-20)*90/27/100;
+                                       wcross_color_z = (x-20)*90/27/100 * 0.2;
+                               }
+                               else
+                               {
+                                       wcross_color_x = 1;
+                                       wcross_color_y = 0;
+                               }
+                       }
                        else
                                wcross_color = stov(autocvar_crosshair_color);
 
index fe6d027ff851990610549b53b997812961542a1b..df78b4f35c3a2dda7f61af5ccef302cb7e48b09d 100644 (file)
@@ -290,3 +290,4 @@ float autocvar_vid_conheight;
 float autocvar_vid_conwidth;
 float autocvar_vid_pixelheight;
 float autocvar_viewsize;
+float autocvar_crosshair_color_by_health;
index fe0e757496c097ba34bea53a352df80bf7307302..a1ee88dbd24eb3276cbe3125daec129aabcf7749 100644 (file)
@@ -135,12 +135,15 @@ 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 color:")));
-               me.TD(me, 2, 1.8, e = makeXonoticColorpickerString("crosshair_color", "crosshair_color"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair color:"));
+               me.TD(me, 1, 0.9, e = makeXonoticCheckBox(0, "crosshair_color_per_weapon", "Per weapon"));
+               me.TD(me, 1, 0.9, e = makeXonoticCheckBox(0, "crosshair_color_by_health", "By health"));
                setDependent(e, "crosshair_color_per_weapon", 0, 0);
        me.TR(me);
-               me.TDempty(me, 0.3);
-               me.TD(me, 1, 0.7, e = makeXonoticCheckBox(0, "crosshair_color_per_weapon", _("Per weapon")));
+               me.TDempty(me, 0.4);
+               me.TD(me, 2, 2.6, e = makeXonoticColorpickerString("crosshair_color", "crosshair_color"));
+               setDependentAND(e, "crosshair_color_per_weapon", 0, 0, "crosshair_color_by_health", 0, 0);
+       me.TR(me);
        me.TR(me);
                me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", _("Enable center dot")));
        me.TR(me);