Revert "Update submodule to 0.34.0.0 (#10356)" (#10359)

This commit is contained in:
metalgearsloth
2022-08-06 16:48:21 +10:00
committed by GitHub
parent bab54e5e3e
commit 45bd1edd5b
69 changed files with 86 additions and 79 deletions

View File

@@ -1,10 +1,10 @@
using System.Linq;
using System.Linq;
using Content.Server.Arcade.Components;
using Content.Server.UserInterface;
using Content.Shared.Arcade;
using Robust.Shared.Utility;
using Robust.Server.GameObjects;
using Robust.Server.Player;
namespace Content.Server.Arcade
{
@@ -19,7 +19,6 @@ namespace Content.Server.Arcade
base.Initialize();
SubscribeLocalEvent<BlockGameArcadeComponent, AfterActivatableUIOpenEvent>(OnAfterUIOpen);
SubscribeLocalEvent<SpaceVillainArcadeComponent, AfterActivatableUIOpenEvent>(OnAfterUIOpenSV);
SubscribeLocalEvent<BlockGameArcadeComponent, BoundUIClosedEvent>((_,c,args) => c.UnRegisterPlayerSession((IPlayerSession)args.Session));
InitializeBlockGame();
InitializeSpaceVillain();
}

View File

@@ -48,7 +48,7 @@ namespace Content.Server.Arcade.Components
UpdatePlayerStatus(temp);
}
public void UnRegisterPlayerSession(IPlayerSession session)
private void UnRegisterPlayerSession(IPlayerSession session)
{
if (_player == session)
{
@@ -72,6 +72,7 @@ namespace Content.Server.Arcade.Components
if (UserInterface != null)
{
UserInterface.OnReceiveMessage += UserInterfaceOnOnReceiveMessage;
UserInterface.OnClosed += UnRegisterPlayerSession;
}
_game = new BlockGame(this);
}

View File

@@ -35,6 +35,7 @@ namespace Content.Server.Atmos.Components
if (UserInterface != null)
{
UserInterface.OnReceiveMessage += UserInterfaceOnReceiveMessage;
UserInterface.OnClosed += UserInterfaceOnClose;
}
_entities.TryGetComponent(Owner, out _appearance);
@@ -95,7 +96,12 @@ namespace Content.Server.Atmos.Components
Resync();
}
public void UpdateAppearance(bool open)
private void UserInterfaceOnClose(IPlayerSession obj)
{
UpdateAppearance(false);
}
private void UpdateAppearance(bool open)
{
_appearance?.SetData(GasAnalyzerVisuals.VisualState,
open ? GasAnalyzerVisualState.Working : GasAnalyzerVisualState.Off);

View File

@@ -21,7 +21,6 @@ namespace Content.Server.Atmos.EntitySystems
base.Initialize();
SubscribeLocalEvent<GasAnalyzableComponent, GetVerbsEvent<ExamineVerb>>(OnGetExamineVerbs);
SubscribeLocalEvent<GasAnalyzerComponent, BoundUIClosedEvent>((_,c,_) => c.UpdateAppearance(false));
}
private void OnGetExamineVerbs(EntityUid uid, GasAnalyzableComponent component, GetVerbsEvent<ExamineVerb> args)

View File

@@ -645,12 +645,12 @@ namespace Content.Server.Storage.EntitySystems
DebugTools.Assert(storedStorageComp != storageComp, $"Storage component contains itself!? Entity: {uid}");
}
if (!TryComp(entity, out ServerUserInterfaceComponent? ui))
continue;
foreach (var bui in ui.Interfaces.Values)
if (TryComp(entity, out ServerUserInterfaceComponent? uiComponent))
{
_uiSystem.TryClose(uid, bui.UiKey, session, ui);
foreach (var ui in uiComponent.Interfaces)
{
ui.Close(session);
}
}
}
}

View File

@@ -17,7 +17,6 @@ namespace Content.Server.UserInterface
{
[Dependency] private readonly IAdminManager _adminManager = default!;
[Dependency] private readonly ActionBlockerSystem _blockerSystem = default!;
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
public override void Initialize()
{
@@ -57,7 +56,11 @@ namespace Content.Server.UserInterface
if (!TryComp(args.Performer, out ActorComponent? actor))
return;
args.Handled = _uiSystem.TryToggleUi(uid, args.Key, actor.PlayerSession);
if (!component.TryGetBoundUserInterface(args.Key, out var bui))
return;
bui.Toggle(actor.PlayerSession);
args.Handled = true;
}
private void AddOpenUiVerb(EntityUid uid, ActivatableUIComponent component, GetVerbsEvent<ActivationVerb> args)

View File

@@ -4,10 +4,9 @@ namespace Content.Server.UserInterface
{
public static class UserInterfaceHelpers
{
[Obsolete("Use UserInterfaceSystem")]
public static BoundUserInterface? GetUIOrNull(this EntityUid entity, Enum uiKey)
public static BoundUserInterface? GetUIOrNull(this EntityUid entity, object uiKey)
{
return IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<UserInterfaceSystem>().GetUiOrNull(entity, uiKey);
return IoCManager.Resolve<IEntityManager>().GetComponentOrNull<ServerUserInterfaceComponent>(entity)?.GetBoundUserInterfaceOrNull(uiKey);
}
}
}