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:
@@ -17,6 +17,7 @@ using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using ActivatableUISystem = Content.Shared.UserInterface.ActivatableUISystem;
|
||||
|
||||
namespace Content.Server.Wires;
|
||||
|
||||
@@ -393,11 +394,11 @@ public sealed class WiresSystem : SharedWiresSystem
|
||||
|
||||
private void OnWiresActionMessage(EntityUid uid, WiresComponent component, WiresActionMessage args)
|
||||
{
|
||||
if (args.Session.AttachedEntity == null)
|
||||
if (args.Actor == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var player = (EntityUid) args.Session.AttachedEntity;
|
||||
var player = (EntityUid) args.Actor;
|
||||
|
||||
if (!EntityManager.TryGetComponent(player, out HandsComponent? handsComponent))
|
||||
{
|
||||
@@ -458,7 +459,7 @@ public sealed class WiresSystem : SharedWiresSystem
|
||||
{
|
||||
if (TryComp(args.User, out ActorComponent? actor))
|
||||
{
|
||||
_uiSystem.TryOpen(uid, WiresUiKey.Key, actor.PlayerSession);
|
||||
_uiSystem.OpenUi(uid, WiresUiKey.Key, actor.PlayerSession);
|
||||
args.Handled = true;
|
||||
}
|
||||
}
|
||||
@@ -468,7 +469,8 @@ public sealed class WiresSystem : SharedWiresSystem
|
||||
{
|
||||
if (args.Open)
|
||||
return;
|
||||
_uiSystem.TryCloseAll(ent, WiresUiKey.Key);
|
||||
|
||||
_uiSystem.CloseUi(ent.Owner, WiresUiKey.Key);
|
||||
}
|
||||
|
||||
private void OnAttemptOpenActivatableUI(EntityUid uid, ActivatableUIRequiresPanelComponent component, ActivatableUIOpenAttemptEvent args)
|
||||
@@ -574,18 +576,17 @@ public sealed class WiresSystem : SharedWiresSystem
|
||||
|
||||
statuses.Sort((a, b) => a.position.CompareTo(b.position));
|
||||
|
||||
_uiSystem.TrySetUiState(uid, WiresUiKey.Key, new WiresBoundUserInterfaceState(
|
||||
_uiSystem.SetUiState((uid, ui), WiresUiKey.Key, new WiresBoundUserInterfaceState(
|
||||
clientList.ToArray(),
|
||||
statuses.Select(p => new StatusEntry(p.key, p.value)).ToArray(),
|
||||
Loc.GetString(wires.BoardName),
|
||||
wires.SerialNumber,
|
||||
wires.WireSeed), ui: ui);
|
||||
wires.WireSeed));
|
||||
}
|
||||
|
||||
public void OpenUserInterface(EntityUid uid, ICommonSession player)
|
||||
{
|
||||
if (_uiSystem.TryGetUi(uid, WiresUiKey.Key, out var ui))
|
||||
_uiSystem.OpenUi(ui, player);
|
||||
_uiSystem.OpenUi(uid, WiresUiKey.Key, player);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -629,7 +630,7 @@ public sealed class WiresSystem : SharedWiresSystem
|
||||
|
||||
if (!args.WiresAccessible)
|
||||
{
|
||||
_uiSystem.TryCloseAll(uid, WiresUiKey.Key);
|
||||
_uiSystem.CloseUi(uid, WiresUiKey.Key);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user