]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Better positions for waypointsprite icons
authorFreddy <schro.sb@gmail.com>
Sun, 4 Feb 2018 19:45:13 +0000 (20:45 +0100)
committerFreddy <schro.sb@gmail.com>
Sun, 4 Feb 2018 19:45:13 +0000 (20:45 +0100)
defaultClient.cfg
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh

index 6b8c0f7d621825bc66215d64b5749b1d6a9906ce..794ff4287786bfd51e3f6b04db50cf40ba6a69af 100644 (file)
@@ -386,6 +386,7 @@ seta g_waypointsprite_turrets 1 "disable turret waypoints"
 seta g_waypointsprite_turrets_maxdist 5000 "max distance for turret waypoints"
 seta g_waypointsprite_uppercase 1
 seta g_waypointsprite_text 0 "Always show text instead of icons, setting this to 0 will still use text if the icon is unavailable"
+seta g_waypointsprite_iconsize 64
 
 alias "g_waypointsprite_personal"      "impulse 30"
 alias "g_waypointsprite_personal_p"    "impulse 31"
index 6ad7bf5c6fea012e8adab0a0b644ec6ddfc3ecac..f7f64fe16aa69ff5dad53f449695098ab33c8512 100644 (file)
@@ -695,11 +695,6 @@ void Draw_WaypointSprite(entity this)
     draw_beginBoldFont();
     if (this.health >= 0)
     {
-        if(autocvar_g_waypointsprite_text || !icon_found)
-            o = drawspritetext(o, ang, (SPRITE_HEALTHBAR_WIDTH + 2 * SPRITE_HEALTHBAR_BORDER) * t, rgb, a, waypointsprite_fontsize * '1 1 0', txt);
-        else
-            drawpic_aspect(o, pic, vec2(SPRITE_HEALTHBAR_WIDTH * t, SPRITE_HEALTHBAR_HEIGHT * t), rgb, a, DRAWFLAG_NORMAL);
-
         float align, marg;
         if (this.build_finished)
             align = 0.5;
@@ -726,6 +721,11 @@ void Draw_WaypointSprite(entity this)
                 a * SPRITE_HEALTHBAR_HEALTHALPHA,
                 DRAWFLAG_NORMAL
                  );
+
+        if(autocvar_g_waypointsprite_text || !icon_found)
+            o = drawspritetext(o, ang, (SPRITE_HEALTHBAR_WIDTH + 2 * SPRITE_HEALTHBAR_BORDER) * t, rgb, a, waypointsprite_fontsize * '1 1 0', txt);
+        else
+            drawpic(o - vec2(iconsize/2, autocvar_g_waypointsprite_iconsize*t + 2*marg + SPRITE_HEALTHBAR_HEIGHT*t), pic, '1 1 0'*iconsize, rgb, a, DRAWFLAG_NORMAL);
     }
     else
     {
index d032a26ee0b70271b6f1c917dff1cb881c786625..2695bedc97602bb7616457859f5166d00564f3f8 100644 (file)
@@ -54,6 +54,7 @@ bool autocvar_g_waypointsprite_turrets = true;
 float autocvar_g_waypointsprite_turrets_maxdist = 5000;
 bool autocvar_g_waypointsprite_uppercase;
 bool autocvar_g_waypointsprite_text;
+float autocvar_g_waypointsprite_iconsize = 64;
 
 float waypointsprite_fadedistance;
 float waypointsprite_normdistance;