Content update for UI prediction (#27214)

* Content update for UI refactor

* Big update

* Sharing

* Remaining content updates

* First big update

* Prototype updates

* AUGH

* Fix UI comp ref

* Cleanup

- Fix predicted message, fix item slots, fix interaction range check.

* Fix regressions

* Make this predictive

idk why it wasn't.

* Fix slime merge

* Merge conflict

* Fix merge
This commit is contained in:
metalgearsloth
2024-04-26 18:16:24 +10:00
committed by GitHub
parent 32b81de8c5
commit 5896e68752
279 changed files with 1308 additions and 1582 deletions

View File

@@ -79,9 +79,7 @@ public sealed class CryostorageSystem : SharedCryostorageSystem
private void OnRemoveItemBuiMessage(Entity<CryostorageComponent> ent, ref CryostorageRemoveItemBuiMessage args)
{
var (_, comp) = ent;
if (args.Session.AttachedEntity is not { } attachedEntity)
return;
var attachedEntity = args.Actor;
var cryoContained = GetEntity(args.StoredEntity);
if (!comp.StoredPlayers.Contains(cryoContained) || !IsInPausedMap(cryoContained))
@@ -114,6 +112,7 @@ public sealed class CryostorageSystem : SharedCryostorageSystem
AdminLog.Add(LogType.Action, LogImpact.High,
$"{ToPrettyString(attachedEntity):player} removed item {ToPrettyString(entity)} from cryostorage-contained player " +
$"{ToPrettyString(cryoContained):player}, stored in cryostorage {ToPrettyString(ent)}");
_container.TryRemoveFromContainer(entity.Value);
_transform.SetCoordinates(entity.Value, Transform(attachedEntity).Coordinates);
_hands.PickupOrDrop(attachedEntity, entity.Value);
@@ -122,8 +121,8 @@ public sealed class CryostorageSystem : SharedCryostorageSystem
private void UpdateCryostorageUIState(Entity<CryostorageComponent> ent)
{
var state = new CryostorageBuiState(GetAllContainedData(ent).ToList());
_ui.TrySetUiState(ent, CryostorageUIKey.Key, state);
var state = new CryostorageBuiState(GetAllContainedData(ent));
_ui.SetUiState(ent.Owner, CryostorageUIKey.Key, state);
}
private void OnPlayerSpawned(Entity<CryostorageContainedComponent> ent, ref PlayerSpawnCompleteEvent args)
@@ -293,12 +292,17 @@ public sealed class CryostorageSystem : SharedCryostorageSystem
_chatManager.ChatMessageToOne(ChatChannel.Server, msg, msg, uid, false, actor.PlayerSession.Channel);
}
private IEnumerable<CryostorageContainedPlayerData> GetAllContainedData(Entity<CryostorageComponent> ent)
private List<CryostorageContainedPlayerData> GetAllContainedData(Entity<CryostorageComponent> ent)
{
var data = new List<CryostorageContainedPlayerData>();
data.EnsureCapacity(ent.Comp.StoredPlayers.Count);
foreach (var contained in ent.Comp.StoredPlayers)
{
yield return GetContainedData(contained);
data.Add(GetContainedData(contained));
}
return data;
}
private CryostorageContainedPlayerData GetContainedData(EntityUid uid)