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

@@ -90,19 +90,14 @@ public sealed class CrayonSystem : SharedCrayonSystem
if (args.Handled)
return;
if (!TryComp<ActorComponent>(args.User, out var actor) ||
!_uiSystem.TryGetUi(uid, SharedCrayonComponent.CrayonUiKey.Key, out var ui))
if (!_uiSystem.HasUi(uid, SharedCrayonComponent.CrayonUiKey.Key))
{
return;
}
_uiSystem.ToggleUi(ui, actor.PlayerSession);
if (ui.SubscribedSessions.Contains(actor.PlayerSession))
{
// Tell the user interface the selected stuff
_uiSystem.SetUiState(ui, new CrayonBoundUserInterfaceState(component.SelectedState, component.SelectableColor, component.Color));
}
_uiSystem.TryToggleUi(uid, SharedCrayonComponent.CrayonUiKey.Key, args.User);
_uiSystem.SetUiState(uid, SharedCrayonComponent.CrayonUiKey.Key, new CrayonBoundUserInterfaceState(component.SelectedState, component.SelectableColor, component.Color));
args.Handled = true;
}
@@ -140,8 +135,8 @@ public sealed class CrayonSystem : SharedCrayonSystem
private void OnCrayonDropped(EntityUid uid, CrayonComponent component, DroppedEvent args)
{
if (TryComp<ActorComponent>(args.User, out var actor))
_uiSystem.TryClose(uid, SharedCrayonComponent.CrayonUiKey.Key, actor.PlayerSession);
// TODO: Use the existing event.
_uiSystem.CloseUi(uid, SharedCrayonComponent.CrayonUiKey.Key, args.User);
}
private void UseUpCrayon(EntityUid uid, EntityUid user)