Kaynağa Gözat

fix inventory rendering bug

Kolja Strohm 3 yıl önce
ebeveyn
işleme
637114d113
1 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. 3 3
      FactoryCraft/Game.cpp

+ 3 - 3
FactoryCraft/Game.cpp

@@ -78,13 +78,13 @@ void Game::updateInventory( Framework::Array<ItemSlot*>& itemBar, int pos )
         {
             tr.renderText( 5 + index * 50, 5, slot->zStack()->zItem()->getName(), *invB, 0xFFFFFFFF );
             int size = slot->zStack()->getSize();
-            const char *units[] = { "", "K", "M", "G", "T", "P"};
+            const char* units[] = { "", "K", "M", "G", "T", "P" };
             int index = 0;
-            for(; index < 6 && size > 1024; index++ )
+            for( ; index < 6 && size > 1024; index++ )
                 size = size / 1024;
             Text count = size;
             count += units[ index ];
-            tr.renderText( 45 - tr.getTextBreite( count ), 45 - tr.getTextHeight( count ), count, *invB, 0xFFFFFFFF );
+            tr.renderText( 45 - tr.getTextBreite( count ) + index * 50, 45 - tr.getTextHeight( count ), count, *invB, 0xFFFFFFFF );
         }
         index++;
     }