]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Center icon when item has no time
authorterencehill <piuntn@gmail.com>
Mon, 10 Aug 2015 23:50:02 +0000 (01:50 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 10 Aug 2015 23:50:02 +0000 (01:50 +0200)
qcsrc/client/hud.qc

index 585fd6ec3f0e5ccfd6963b1c52b66f42eb23d824..55de7b7f5a467e5427a185564dd3dd3609fe31f6 100644 (file)
@@ -4720,6 +4720,8 @@ void DrawItemsTimeItem(vector myPos, vector mySize, float ar, float itemcode, fl
 
        if(t > 0 && autocvar_hud_panel_itemstime_text)
                drawstring_aspect(numpos, ftos(t), eX * ((ar - 1)/ar) * mySize_x + eY * mySize_y, color, panel_fg_alpha, DRAWFLAG_NORMAL);
+       else
+               picpos.x = myPos.x + mySize.x / 2 - mySize.y / 2;
        if(item_availableTime)
                drawpic_aspect_skin_expanding(picpos, GetItemsTimePicture(itemcode), '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha * picalpha, DRAWFLAG_NORMAL, item_availableTime);
        drawpic_aspect_skin(picpos, GetItemsTimePicture(itemcode), '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha * picalpha, DRAWFLAG_NORMAL);