|
@@ -31,6 +31,11 @@ Game::Game( Bildschirm* zScreen )
|
|
|
elements.add( logout );
|
|
|
debug = initTextFeld( 10, 40, 500, 40, TextFeld::Style::Text | TextFeld::Style::Mehrzeilig, "" );
|
|
|
elements.add( debug );
|
|
|
+ invB = new Bild();
|
|
|
+ invB->neuBild( zScreen->getBackBufferSize().x - 20, 50, 0 );
|
|
|
+ invB->setAlpha3D( 1 );
|
|
|
+ inventory = initBildZ( 10, zScreen->getBackBufferSize().y - 60, zScreen->getBackBufferSize().x - 20, 50, BildZ::Style::Sichtbar | BildZ::Style::Alpha, invB );
|
|
|
+ elements.add( inventory );
|
|
|
}
|
|
|
|
|
|
void Game::updatePosition( Vec3<float> position, bool target, Vec3<int> targetPos )
|
|
@@ -54,4 +59,26 @@ void Game::updatePosition( Vec3<float> position, bool target, Vec3<int> targetPo
|
|
|
txt += ")";
|
|
|
}
|
|
|
debug->setText( txt );
|
|
|
+}
|
|
|
+
|
|
|
+void Game::updateInventory( Framework::Array<ItemSlot*>& itemBar, int pos )
|
|
|
+{
|
|
|
+ invB->fillRegion( 0, 0, invB->getBreite(), invB->getHeight(), 0 );
|
|
|
+ TextRenderer tr;
|
|
|
+ tr.setSchriftZ( dynamic_cast<Schrift*>(uiFactory.initParam.schrift->getThis()) );
|
|
|
+ tr.setSchriftSize( 12 );
|
|
|
+ int index = 0;
|
|
|
+ for( auto slot : itemBar )
|
|
|
+ {
|
|
|
+ if( pos == index )
|
|
|
+ {
|
|
|
+ invB->fillRegion( 50 * index, 0, 50, 50, 0x7F202020 );
|
|
|
+ }
|
|
|
+ if( slot && slot->zStack() && slot->zStack()->zItem() )
|
|
|
+ {
|
|
|
+ tr.renderText( 5 + index * 50, 5, slot->zStack()->zItem()->getName(), *invB, 0xFFFFFFFF );
|
|
|
+ }
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ inventory->setRender();
|
|
|
}
|