From: Freddy Date: Sun, 4 Feb 2018 19:45:13 +0000 (+0100) Subject: Better positions for waypointsprite icons X-Git-Tag: xonotic-v0.8.5~2328^2~13 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a4b6aa83c2b7870f339ea9dec16dab96500c2861;p=xonotic%2Fxonotic-data.pk3dir.git Better positions for waypointsprite icons --- diff --git a/defaultClient.cfg b/defaultClient.cfg index 6b8c0f7d6..794ff4287 100644 --- a/defaultClient.cfg +++ b/defaultClient.cfg @@ -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" diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index 6ad7bf5c6..f7f64fe16 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -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 { diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh index d032a26ee..2695bedc9 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh @@ -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;