Fixed HandsGui and added an icon to access worn inventories (#279)
* Fixed HandsGui children so that HandsGui is clickable * Added TextureButton for opening Storage items * Update ClientInventoryComponent.cs Fixed HandleComponentState so that it only updates the inventory when there are changes. * Implemented storage button on Inventory Adds a small button on the bottom right of Storage items when inside the inventory. When the button is pressed it opens the Storage UI.
This commit is contained in:
committed by
Pieter-Jan Briers
parent
1d9d01b355
commit
151d3a3672
@@ -34,6 +34,7 @@ namespace Content.Server.GameObjects
|
||||
[Dependency] private readonly IMapManager _mapManager;
|
||||
[Dependency] private readonly IPlayerManager _playerManager;
|
||||
[Dependency] private readonly IEntityManager _entityManager;
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
|
||||
#pragma warning restore 649
|
||||
|
||||
private Container storage;
|
||||
@@ -174,12 +175,18 @@ namespace Content.Server.GameObjects
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
_ensureInitialCalculated();
|
||||
var user_session = eventArgs.User.GetComponent<BasicActorComponent>().playerSession;
|
||||
OpenStorageUI(eventArgs.User);
|
||||
return false;
|
||||
}
|
||||
|
||||
public void OpenStorageUI(IEntity Character)
|
||||
{
|
||||
_ensureInitialCalculated();
|
||||
var user_session = Character.GetComponent<BasicActorComponent>().playerSession;
|
||||
Logger.DebugS("Storage", "Storage (UID {0}) \"used\" by player session (UID {1}).", Owner.Uid, user_session.AttachedEntityUid);
|
||||
SubscribeSession(user_session);
|
||||
SendNetworkMessage(new OpenStorageUIMessage(), user_session.ConnectedClient);
|
||||
UpdateClientInventory(user_session);
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -301,16 +308,15 @@ namespace Content.Server.GameObjects
|
||||
entity.GetComponent<ITransformComponent>().WorldPosition = ourtransform.WorldPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
case CloseStorageUIMessage _:
|
||||
{
|
||||
var session = _playerManager.GetSessionByChannel(netChannel);
|
||||
|
||||
UnsubscribeSession(session);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user