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

@@ -101,8 +101,9 @@ namespace Content.Server.Disposal.Tube
/// <param name="msg">A user interface message from the client.</param>
private void OnUiAction(EntityUid uid, DisposalRouterComponent router, SharedDisposalRouterComponent.UiActionMessage msg)
{
if (!EntityManager.EntityExists(msg.Session.AttachedEntity))
if (!EntityManager.EntityExists(msg.Actor))
return;
if (TryComp<PhysicsComponent>(uid, out var physBody) && physBody.BodyType != BodyType.Static)
return;
@@ -279,9 +280,9 @@ namespace Content.Server.Disposal.Tube
private void OnOpenTaggerUI(EntityUid uid, DisposalTaggerComponent tagger, BoundUIOpenedEvent args)
{
if (_uiSystem.TryGetUi(uid, DisposalTaggerUiKey.Key, out var bui))
if (_uiSystem.HasUi(uid, DisposalTaggerUiKey.Key))
{
_uiSystem.SetUiState(bui,
_uiSystem.SetUiState(uid, DisposalTaggerUiKey.Key,
new DisposalTaggerUserInterfaceState(tagger.Tag));
}
}
@@ -292,13 +293,9 @@ namespace Content.Server.Disposal.Tube
/// <returns>Returns a <see cref="SharedDisposalRouterComponent.DisposalRouterUserInterfaceState"/></returns>
private void UpdateRouterUserInterface(EntityUid uid, DisposalRouterComponent router)
{
var bui = _uiSystem.GetUiOrNull(uid, DisposalRouterUiKey.Key);
if (bui == null)
return;
if (router.Tags.Count <= 0)
{
_uiSystem.SetUiState(bui, new DisposalRouterUserInterfaceState(""));
_uiSystem.SetUiState(uid, DisposalRouterUiKey.Key, new DisposalRouterUserInterfaceState(""));
return;
}
@@ -312,7 +309,7 @@ namespace Content.Server.Disposal.Tube
taglist.Remove(taglist.Length - 2, 2);
_uiSystem.SetUiState(bui, new DisposalRouterUserInterfaceState(taglist.ToString()));
_uiSystem.SetUiState(uid, DisposalRouterUiKey.Key, new DisposalRouterUserInterfaceState(taglist.ToString()));
}
private void OnAnchorChange(EntityUid uid, DisposalTubeComponent component, ref AnchorStateChangedEvent args)