@using Sasalka @inherits PanelComponent @namespace Sasalka.Ui
@if ( PlayerInventory.Items.Count > 0 ) { @foreach ( var item in PlayerInventory.Items ) { } }
@code { Dedugan Player => Dedugan.Local; Inventar PlayerInventory => Player?.Inventory; void UseItem( Sasalka.InventoryItem item ) { Player?.Inventory?.EquipItem( item ); } void DropItem( Sasalka.InventoryItem item ) { Player?.Inventory?.DropItem( item, Player.CameraPivot.WorldPosition + Player.Camera.LocalRotation.Right * 50 ); } protected override void OnUpdate() { if ( Input.Pressed( "Score" ) ) { Inventar.IsInventoryOpen = !Inventar.IsInventoryOpen; } } protected override int BuildHash() { if ( !Inventar.IsInventoryOpen || PlayerInventory == null ) return -1; var hash = new HashCode(); hash.Add( Inventar.IsInventoryOpen ); return hash.ToHashCode(); } }