Cleaner BoundUserInterfaces (#17736)
This commit is contained in:
@@ -10,7 +10,7 @@ namespace Content.Client.Access.UI
|
||||
{
|
||||
private AgentIDCardWindow? _window;
|
||||
|
||||
public AgentIDCardBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public AgentIDCardBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -10,19 +10,21 @@ namespace Content.Client.Access.UI
|
||||
public sealed class IdCardConsoleBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
private readonly SharedIdCardConsoleSystem _idCardConsoleSystem = default!;
|
||||
|
||||
public IdCardConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
private IdCardConsoleWindow? _window;
|
||||
|
||||
public IdCardConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
_idCardConsoleSystem = EntMan.System<SharedIdCardConsoleSystem>();
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
List<string> accessLevels;
|
||||
|
||||
if (_entityManager.TryGetComponent<IdCardConsoleComponent>(Owner.Owner, out var idCard))
|
||||
if (EntMan.TryGetComponent<IdCardConsoleComponent>(Owner, out var idCard))
|
||||
{
|
||||
accessLevels = idCard.AccessLevels;
|
||||
accessLevels.Sort();
|
||||
@@ -30,10 +32,13 @@ namespace Content.Client.Access.UI
|
||||
else
|
||||
{
|
||||
accessLevels = new List<string>();
|
||||
Logger.ErrorS(SharedIdCardConsoleSystem.Sawmill, $"No IdCardConsole component found for {_entityManager.ToPrettyString(Owner.Owner)}!");
|
||||
_idCardConsoleSystem.Log.Error($"No IdCardConsole component found for {EntMan.ToPrettyString(Owner)}!");
|
||||
}
|
||||
|
||||
_window = new IdCardConsoleWindow(this, _prototypeManager, accessLevels) {Title = _entityManager.GetComponent<MetaDataComponent>(Owner.Owner).EntityName};
|
||||
_window = new IdCardConsoleWindow(this, _prototypeManager, accessLevels)
|
||||
{
|
||||
Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName
|
||||
};
|
||||
|
||||
_window.CrewManifestButton.OnPressed += _ => SendMessage(new CrewManifestOpenUiMessage());
|
||||
_window.PrivilegedIdButton.OnPressed += _ => SendMessage(new ItemSlotButtonPressedEvent(PrivilegedIdCardSlotId));
|
||||
|
||||
@@ -6,12 +6,13 @@ namespace Content.Client.AirlockPainter.UI
|
||||
{
|
||||
public sealed class AirlockPainterBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private AirlockPainterWindow? _window;
|
||||
|
||||
[ViewVariables]
|
||||
private AirlockPainterSystem? _painter;
|
||||
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystems = default!;
|
||||
|
||||
public AirlockPainterBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public AirlockPainterBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -21,7 +22,7 @@ namespace Content.Client.AirlockPainter.UI
|
||||
|
||||
_window = new AirlockPainterWindow();
|
||||
|
||||
_painter = _entitySystems.GetEntitySystem<AirlockPainterSystem>();
|
||||
_painter = EntMan.System<AirlockPainterSystem>();
|
||||
|
||||
_window.OpenCentered();
|
||||
_window.OnClose += Close;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Client.Ame.UI
|
||||
{
|
||||
private AmeWindow? _window;
|
||||
|
||||
public AmeControllerBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public AmeControllerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -3,14 +3,14 @@ using Content.Shared.Gravity;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client. Anomaly.Ui;
|
||||
namespace Content.Client.Anomaly.Ui;
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class AnomalyGeneratorBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
private AnomalyGeneratorWindow? _window;
|
||||
|
||||
public AnomalyGeneratorBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base (owner, uiKey)
|
||||
public AnomalyGeneratorBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public sealed class AnomalyGeneratorBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_window = new (Owner.Owner);
|
||||
_window = new(Owner);
|
||||
|
||||
_window.OpenCentered();
|
||||
_window.OnClose += Close;
|
||||
|
||||
@@ -9,7 +9,7 @@ public sealed class AnomalyScannerBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
private AnomalyScannerMenu? _menu;
|
||||
|
||||
public AnomalyScannerBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public AnomalyScannerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ public sealed class BlockGameBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
private BlockGameMenu? _menu;
|
||||
|
||||
public BlockGameBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public BlockGameBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ public sealed class SpaceVillainArcadeBoundUserInterface : BoundUserInterface
|
||||
|
||||
//public SharedSpaceVillainArcadeComponent SpaceVillainArcade;
|
||||
|
||||
public SpaceVillainArcadeBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public SpaceVillainArcadeBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
SendAction(PlayerAction.RequestData);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public sealed class AirAlarmBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
private AirAlarmWindow? _window;
|
||||
|
||||
public AirAlarmBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public AirAlarmBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public sealed class AirAlarmBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_window = new AirAlarmWindow(Owner);
|
||||
_window = new AirAlarmWindow(this);
|
||||
|
||||
if (State != null)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ public sealed partial class AirAlarmWindow : FancyWindow
|
||||
|
||||
private OptionButton _modes => CModeButton;
|
||||
|
||||
public AirAlarmWindow(ClientUserInterfaceComponent component)
|
||||
public AirAlarmWindow(BoundUserInterface owner)
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
@@ -88,7 +88,7 @@ public sealed partial class AirAlarmWindow : FancyWindow
|
||||
ResyncAllRequested!.Invoke();
|
||||
};
|
||||
|
||||
EntityView.Sprite = IoCManager.Resolve<IEntityManager>().GetComponent<SpriteComponent>(component.Owner);
|
||||
EntityView.SetEntity(owner.Owner);
|
||||
}
|
||||
|
||||
public void UpdateState(AirAlarmUIState state)
|
||||
|
||||
@@ -5,12 +5,13 @@ namespace Content.Client.Atmos.UI
|
||||
{
|
||||
public sealed class GasAnalyzerBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
public GasAnalyzerBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
[ViewVariables]
|
||||
private GasAnalyzerWindow? _window;
|
||||
|
||||
public GasAnalyzerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
private GasAnalyzerWindow? _window;
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Content.Shared.Atmos.Piping.Binary.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.Atmos.UI
|
||||
{
|
||||
@@ -11,10 +10,10 @@ namespace Content.Client.Atmos.UI
|
||||
[UsedImplicitly]
|
||||
public sealed class GasCanisterBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
|
||||
[ViewVariables]
|
||||
private GasCanisterWindow? _window;
|
||||
|
||||
public GasCanisterBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public GasCanisterBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -24,7 +23,7 @@ namespace Content.Client.Atmos.UI
|
||||
|
||||
_window = new GasCanisterWindow();
|
||||
|
||||
if(State != null)
|
||||
if (State != null)
|
||||
UpdateState(State);
|
||||
|
||||
_window.OpenCentered();
|
||||
|
||||
@@ -12,10 +12,13 @@ namespace Content.Client.Atmos.UI
|
||||
[UsedImplicitly]
|
||||
public sealed class GasFilterBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private const float MaxTransferRate = Atmospherics.MaxTransferRate;
|
||||
|
||||
[ViewVariables]
|
||||
private GasFilterWindow? _window;
|
||||
|
||||
public GasFilterBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public GasFilterBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -23,11 +26,11 @@ namespace Content.Client.Atmos.UI
|
||||
{
|
||||
base.Open();
|
||||
|
||||
var atmosSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<AtmosphereSystem>();
|
||||
var atmosSystem = EntMan.System<AtmosphereSystem>();
|
||||
|
||||
_window = new GasFilterWindow(atmosSystem.Gases);
|
||||
|
||||
if(State != null)
|
||||
if (State != null)
|
||||
UpdateState(State);
|
||||
|
||||
_window.OpenCentered();
|
||||
@@ -81,7 +84,7 @@ namespace Content.Client.Atmos.UI
|
||||
_window.SetTransferRate(cast.TransferRate);
|
||||
if (cast.FilteredGas is not null)
|
||||
{
|
||||
var atmos = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<AtmosphereSystem>();
|
||||
var atmos = EntMan.System<AtmosphereSystem>();
|
||||
var gas = atmos.GetGas((Gas) cast.FilteredGas);
|
||||
var gasName = Loc.GetString(gas.Name);
|
||||
_window.SetGasFiltered(gas.ID, gasName);
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
using System;
|
||||
using Content.Client.Atmos.EntitySystems;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Atmos.Piping.Binary.Components;
|
||||
using Content.Shared.Atmos.Piping.Trinary.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.Atmos.UI
|
||||
{
|
||||
@@ -15,11 +11,13 @@ namespace Content.Client.Atmos.UI
|
||||
[UsedImplicitly]
|
||||
public sealed class GasMixerBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
|
||||
private GasMixerWindow? _window;
|
||||
[ViewVariables]
|
||||
private const float MaxPressure = Atmospherics.MaxOutputPressure;
|
||||
|
||||
public GasMixerBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
[ViewVariables]
|
||||
private GasMixerWindow? _window;
|
||||
|
||||
public GasMixerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -29,7 +27,7 @@ namespace Content.Client.Atmos.UI
|
||||
|
||||
_window = new GasMixerWindow();
|
||||
|
||||
if(State != null)
|
||||
if (State != null)
|
||||
UpdateState(State);
|
||||
|
||||
_window.OpenCentered();
|
||||
@@ -49,8 +47,9 @@ namespace Content.Client.Atmos.UI
|
||||
|
||||
private void OnMixerOutputPressurePressed(string value)
|
||||
{
|
||||
float pressure = float.TryParse(value, out var parsed) ? parsed : 0f;
|
||||
if (pressure > MaxPressure) pressure = MaxPressure;
|
||||
var pressure = float.TryParse(value, out var parsed) ? parsed : 0f;
|
||||
if (pressure > MaxPressure)
|
||||
pressure = MaxPressure;
|
||||
|
||||
SendMessage(new GasMixerChangeOutputPressureMessage(pressure));
|
||||
}
|
||||
@@ -58,11 +57,12 @@ namespace Content.Client.Atmos.UI
|
||||
private void OnMixerSetPercentagePressed(string value)
|
||||
{
|
||||
// We don't need to send both nodes because it's just 100.0f - node
|
||||
float node = float.TryParse(value, out var parsed) ? parsed : 1.0f;
|
||||
var node = float.TryParse(value, out var parsed) ? parsed : 1.0f;
|
||||
|
||||
node = Math.Clamp(node, 0f, 100.0f);
|
||||
|
||||
if (_window is not null) node = _window.NodeOneLastEdited ? node : 100.0f - node;
|
||||
if (_window is not null)
|
||||
node = _window.NodeOneLastEdited ? node : 100.0f - node;
|
||||
|
||||
SendMessage(new GasMixerChangeNodePercentageMessage(node));
|
||||
}
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
using System;
|
||||
using Content.Client.Atmos.EntitySystems;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Atmos.Piping.Binary.Components;
|
||||
using Content.Shared.Atmos.Piping.Trinary.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.Atmos.UI
|
||||
{
|
||||
@@ -15,11 +11,13 @@ namespace Content.Client.Atmos.UI
|
||||
[UsedImplicitly]
|
||||
public sealed class GasPressurePumpBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
|
||||
private GasPressurePumpWindow? _window;
|
||||
[ViewVariables]
|
||||
private const float MaxPressure = Atmospherics.MaxOutputPressure;
|
||||
|
||||
public GasPressurePumpBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
[ViewVariables]
|
||||
private GasPressurePumpWindow? _window;
|
||||
|
||||
public GasPressurePumpBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -29,7 +27,7 @@ namespace Content.Client.Atmos.UI
|
||||
|
||||
_window = new GasPressurePumpWindow();
|
||||
|
||||
if(State != null)
|
||||
if (State != null)
|
||||
UpdateState(State);
|
||||
|
||||
_window.OpenCentered();
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Atmos.Piping.Binary.Components;
|
||||
using Content.Shared.Atmos.Piping.Unary.Components;
|
||||
using Content.Shared.Atmos.Piping.Unary.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.Atmos.UI
|
||||
{
|
||||
@@ -13,12 +10,16 @@ namespace Content.Client.Atmos.UI
|
||||
[UsedImplicitly]
|
||||
public sealed class GasThermomachineBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private GasThermomachineWindow? _window;
|
||||
|
||||
[ViewVariables]
|
||||
private float _minTemp = 0.0f;
|
||||
|
||||
[ViewVariables]
|
||||
private float _maxTemp = 0.0f;
|
||||
|
||||
public GasThermomachineBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public GasThermomachineBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -28,7 +29,7 @@ namespace Content.Client.Atmos.UI
|
||||
|
||||
_window = new GasThermomachineWindow();
|
||||
|
||||
if(State != null)
|
||||
if (State != null)
|
||||
UpdateState(State);
|
||||
|
||||
_window.OpenCentered();
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using Content.Shared.Atmos.Piping.Binary.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.Atmos.UI
|
||||
{
|
||||
@@ -12,11 +11,13 @@ namespace Content.Client.Atmos.UI
|
||||
[UsedImplicitly]
|
||||
public sealed class GasVolumePumpBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
|
||||
private GasVolumePumpWindow? _window;
|
||||
[ViewVariables]
|
||||
private const float MaxTransferRate = Atmospherics.MaxTransferRate;
|
||||
|
||||
public GasVolumePumpBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
[ViewVariables]
|
||||
private GasVolumePumpWindow? _window;
|
||||
|
||||
public GasVolumePumpBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -26,7 +27,7 @@ namespace Content.Client.Atmos.UI
|
||||
|
||||
_window = new GasVolumePumpWindow();
|
||||
|
||||
if(State != null)
|
||||
if (State != null)
|
||||
UpdateState(State);
|
||||
|
||||
_window.OpenCentered();
|
||||
@@ -45,8 +46,9 @@ namespace Content.Client.Atmos.UI
|
||||
|
||||
private void OnPumpTransferRatePressed(string value)
|
||||
{
|
||||
float rate = float.TryParse(value, out var parsed) ? parsed : 0f;
|
||||
if (rate > MaxTransferRate) rate = MaxTransferRate;
|
||||
var rate = float.TryParse(value, out var parsed) ? parsed : 0f;
|
||||
if (rate > MaxTransferRate)
|
||||
rate = MaxTransferRate;
|
||||
|
||||
SendMessage(new GasVolumePumpChangeTransferRateMessage(rate));
|
||||
}
|
||||
|
||||
@@ -11,9 +11,8 @@ public sealed class CargoBountyConsoleBoundUserInterface : BoundUserInterface
|
||||
[ViewVariables]
|
||||
private CargoBountyMenu? _menu;
|
||||
|
||||
public CargoBountyConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public CargoBountyConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
|
||||
@@ -38,9 +38,10 @@ namespace Content.Client.Cargo.BUI
|
||||
/// <summary>
|
||||
/// Currently selected product
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
private CargoProductPrototype? _product;
|
||||
|
||||
public CargoOrderConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public CargoOrderConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -48,17 +49,15 @@ namespace Content.Client.Cargo.BUI
|
||||
{
|
||||
base.Open();
|
||||
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
var sysManager = entityManager.EntitySysManager;
|
||||
var spriteSystem = sysManager.GetEntitySystem<SpriteSystem>();
|
||||
var spriteSystem = EntMan.System<SpriteSystem>();
|
||||
_menu = new CargoConsoleMenu(IoCManager.Resolve<IPrototypeManager>(), spriteSystem);
|
||||
var localPlayer = IoCManager.Resolve<IPlayerManager>()?.LocalPlayer?.ControlledEntity;
|
||||
var description = new FormattedMessage();
|
||||
|
||||
string orderRequester;
|
||||
|
||||
if (entityManager.TryGetComponent<MetaDataComponent>(localPlayer, out var metadata))
|
||||
orderRequester = Identity.Name(localPlayer.Value, entityManager);
|
||||
if (EntMan.TryGetComponent<MetaDataComponent>(localPlayer, out var metadata))
|
||||
orderRequester = Identity.Name(localPlayer.Value, EntMan);
|
||||
else
|
||||
orderRequester = string.Empty;
|
||||
|
||||
@@ -138,7 +137,7 @@ namespace Content.Client.Cargo.BUI
|
||||
|
||||
private bool AddOrder()
|
||||
{
|
||||
int orderAmt = _orderMenu?.Amount.Value ?? 0;
|
||||
var orderAmt = _orderMenu?.Amount.Value ?? 0;
|
||||
if (orderAmt < 1 || orderAmt > OrderCapacity)
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -7,9 +7,12 @@ namespace Content.Client.Cargo.BUI;
|
||||
|
||||
public sealed class CargoPalletConsoleBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private CargoPalletMenu? _menu;
|
||||
|
||||
public CargoPalletConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey) {}
|
||||
public CargoPalletConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
|
||||
@@ -9,9 +9,12 @@ namespace Content.Client.Cargo.BUI;
|
||||
[UsedImplicitly]
|
||||
public sealed class CargoShuttleConsoleBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private CargoShuttleMenu? _menu;
|
||||
|
||||
public CargoShuttleConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey) {}
|
||||
public CargoShuttleConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
|
||||
@@ -8,15 +8,17 @@ namespace Content.Client.CartridgeLoader;
|
||||
|
||||
public abstract class CartridgeLoaderBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IEntityManager? _entityManager = default!;
|
||||
|
||||
[ViewVariables]
|
||||
private EntityUid? _activeProgram;
|
||||
|
||||
[ViewVariables]
|
||||
private UIFragment? _activeCartridgeUI;
|
||||
|
||||
[ViewVariables]
|
||||
private Control? _activeUiFragment;
|
||||
|
||||
protected CartridgeLoaderBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
protected CartridgeLoaderBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
}
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
@@ -119,7 +121,7 @@ public abstract class CartridgeLoaderBoundUserInterface : BoundUserInterface
|
||||
|
||||
protected CartridgeComponent? RetrieveCartridgeComponent(EntityUid? cartridgeUid)
|
||||
{
|
||||
return _entityManager?.GetComponentOrNull<CartridgeComponent>(cartridgeUid);
|
||||
return EntMan.GetComponentOrNull<CartridgeComponent>(cartridgeUid);
|
||||
}
|
||||
|
||||
private void SendCartridgeUiReadyEvent(EntityUid cartridgeUid)
|
||||
@@ -130,7 +132,7 @@ public abstract class CartridgeLoaderBoundUserInterface : BoundUserInterface
|
||||
|
||||
private UIFragment? RetrieveCartridgeUI(EntityUid? cartridgeUid)
|
||||
{
|
||||
var component = _entityManager?.GetComponentOrNull<UIFragmentComponent>(cartridgeUid);
|
||||
var component = EntMan.GetComponentOrNull<UIFragmentComponent>(cartridgeUid);
|
||||
component?.Ui?.Setup(this, cartridgeUid);
|
||||
return component?.Ui;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Content.Shared.Chemistry;
|
||||
using Content.Shared.Chemistry.Dispenser;
|
||||
using Content.Shared.Containers.ItemSlots;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
@@ -12,12 +11,11 @@ namespace Content.Client.Chemistry.UI
|
||||
[UsedImplicitly]
|
||||
public sealed class ChemMasterBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[ViewVariables]
|
||||
private ChemMasterWindow? _window;
|
||||
|
||||
public ChemMasterBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public ChemMasterBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -31,7 +29,7 @@ namespace Content.Client.Chemistry.UI
|
||||
// Setup window layout/elements
|
||||
_window = new ChemMasterWindow
|
||||
{
|
||||
Title = _entityManager.GetComponent<MetaDataComponent>(Owner.Owner).EntityName,
|
||||
Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName,
|
||||
};
|
||||
|
||||
_window.OpenCentered();
|
||||
@@ -48,9 +46,10 @@ namespace Content.Client.Chemistry.UI
|
||||
new ChemMasterSetModeMessage(ChemMasterMode.Discard));
|
||||
_window.CreatePillButton.OnPressed += _ => SendMessage(
|
||||
new ChemMasterCreatePillsMessage(
|
||||
(uint)_window.PillDosage.Value, (uint)_window.PillNumber.Value, _window.LabelLine));
|
||||
(uint) _window.PillDosage.Value, (uint) _window.PillNumber.Value, _window.LabelLine));
|
||||
_window.CreateBottleButton.OnPressed += _ => SendMessage(
|
||||
new ChemMasterOutputToBottleMessage((uint)_window.BottleDosage.Value, _window.LabelLine));
|
||||
new ChemMasterOutputToBottleMessage(
|
||||
(uint) _window.BottleDosage.Value, _window.LabelLine));
|
||||
|
||||
for (uint i = 0; i < _window.PillTypeButtons.Length; i++)
|
||||
{
|
||||
|
||||
@@ -11,11 +11,13 @@ namespace Content.Client.Chemistry.UI
|
||||
[UsedImplicitly]
|
||||
public sealed class ReagentDispenserBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[ViewVariables]
|
||||
private ReagentDispenserWindow? _window;
|
||||
|
||||
[ViewVariables]
|
||||
private ReagentDispenserBoundUserInterfaceState? _lastState;
|
||||
|
||||
public ReagentDispenserBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public ReagentDispenserBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -31,7 +33,7 @@ namespace Content.Client.Chemistry.UI
|
||||
// Setup window layout/elements
|
||||
_window = new()
|
||||
{
|
||||
Title = _entityManager.GetComponent<MetaDataComponent>(Owner.Owner).EntityName,
|
||||
Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName,
|
||||
};
|
||||
|
||||
_window.OpenCentered();
|
||||
@@ -52,11 +54,13 @@ namespace Content.Client.Chemistry.UI
|
||||
|
||||
// Setup reagent button actions.
|
||||
_window.OnDispenseReagentButtonPressed += (args, button) => SendMessage(new ReagentDispenserDispenseReagentMessage(button.ReagentId));
|
||||
_window.OnDispenseReagentButtonMouseEntered += (args, button) => {
|
||||
_window.OnDispenseReagentButtonMouseEntered += (args, button) =>
|
||||
{
|
||||
if (_lastState is not null)
|
||||
_window.UpdateContainerInfo(_lastState, button.ReagentId);
|
||||
};
|
||||
_window.OnDispenseReagentButtonMouseExited += (args, button) => {
|
||||
_window.OnDispenseReagentButtonMouseExited += (args, button) =>
|
||||
{
|
||||
if (_lastState is not null)
|
||||
_window.UpdateContainerInfo(_lastState);
|
||||
};
|
||||
@@ -73,7 +77,7 @@ namespace Content.Client.Chemistry.UI
|
||||
{
|
||||
base.UpdateState(state);
|
||||
|
||||
var castState = (ReagentDispenserBoundUserInterfaceState)state;
|
||||
var castState = (ReagentDispenserBoundUserInterfaceState) state;
|
||||
_lastState = castState;
|
||||
|
||||
_window?.UpdateState(castState); //Update window state
|
||||
|
||||
@@ -8,8 +8,13 @@ namespace Content.Client.Chemistry.UI
|
||||
[UsedImplicitly]
|
||||
public sealed class TransferAmountBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private TransferAmountWindow? _window;
|
||||
|
||||
public TransferAmountBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
@@ -27,10 +32,6 @@ namespace Content.Client.Chemistry.UI
|
||||
_window.OpenCentered();
|
||||
}
|
||||
|
||||
public TransferAmountBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
|
||||
@@ -7,9 +7,10 @@ namespace Content.Client.CloningConsole.UI
|
||||
[UsedImplicitly]
|
||||
public sealed class CloningConsoleBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private CloningConsoleWindow? _window;
|
||||
|
||||
public CloningConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public CloningConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -8,15 +8,14 @@ namespace Content.Client.Clothing.UI;
|
||||
[UsedImplicitly]
|
||||
public sealed class ChameleonBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
private readonly ChameleonClothingSystem _chameleon;
|
||||
|
||||
[ViewVariables]
|
||||
private ChameleonMenu? _menu;
|
||||
|
||||
public ChameleonBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public ChameleonBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
_chameleon = _entityManager.System<ChameleonClothingSystem>();
|
||||
_chameleon = EntMan.System<ChameleonClothingSystem>();
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
|
||||
@@ -8,23 +8,31 @@ namespace Content.Client.Communications.UI
|
||||
{
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
|
||||
[ViewVariables] private CommunicationsConsoleMenu? _menu;
|
||||
[ViewVariables]
|
||||
private CommunicationsConsoleMenu? _menu;
|
||||
|
||||
[ViewVariables]
|
||||
public bool CanAnnounce { get; private set; }
|
||||
|
||||
[ViewVariables]
|
||||
public bool CanCall { get; private set; }
|
||||
|
||||
[ViewVariables]
|
||||
public bool CountdownStarted { get; private set; }
|
||||
|
||||
[ViewVariables]
|
||||
public bool AlertLevelSelectable { get; private set; }
|
||||
|
||||
[ViewVariables]
|
||||
public string CurrentLevel { get; private set; } = default!;
|
||||
|
||||
public int Countdown => _expectedCountdownTime == null ? 0 : Math.Max((int)_expectedCountdownTime.Value.Subtract(_gameTiming.CurTime).TotalSeconds, 0);
|
||||
[ViewVariables]
|
||||
private TimeSpan? _expectedCountdownTime;
|
||||
|
||||
public CommunicationsConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
public int Countdown => _expectedCountdownTime == null ? 0 : Math.Max((int) _expectedCountdownTime.Value.Subtract(_gameTiming.CurTime).TotalSeconds, 0);
|
||||
|
||||
public CommunicationsConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Client.Computer
|
||||
{
|
||||
@@ -13,6 +11,8 @@ namespace Content.Client.Computer
|
||||
public class ComputerBoundUserInterface<TWindow, TState> : ComputerBoundUserInterfaceBase where TWindow : BaseWindow, IComputerWindow<TState>, new() where TState : BoundUserInterfaceState
|
||||
{
|
||||
[Dependency] private readonly IDynamicTypeFactory _dynamicTypeFactory = default!;
|
||||
|
||||
[ViewVariables]
|
||||
private TWindow? _window;
|
||||
|
||||
protected override void Open()
|
||||
@@ -26,7 +26,9 @@ namespace Content.Client.Computer
|
||||
}
|
||||
|
||||
// Alas, this constructor has to be copied to the subclass. :(
|
||||
public ComputerBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey) {}
|
||||
public ComputerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
{
|
||||
@@ -58,7 +60,9 @@ namespace Content.Client.Computer
|
||||
[Virtual]
|
||||
public class ComputerBoundUserInterfaceBase : BoundUserInterface
|
||||
{
|
||||
public ComputerBoundUserInterfaceBase(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey) {}
|
||||
public ComputerBoundUserInterfaceBase(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
public new void SendMessage(BoundUserInterfaceMessage msg)
|
||||
{
|
||||
@@ -68,8 +72,13 @@ namespace Content.Client.Computer
|
||||
|
||||
public interface IComputerWindow<TState>
|
||||
{
|
||||
void SetupComputerWindow(ComputerBoundUserInterfaceBase cb) {}
|
||||
void UpdateState(TState state) {}
|
||||
void SetupComputerWindow(ComputerBoundUserInterfaceBase cb)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateState(TState state)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Text.RegularExpressions;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using static Content.Shared.Configurable.ConfigurationComponent;
|
||||
|
||||
namespace Content.Client.Configurable.UI
|
||||
{
|
||||
public sealed class ConfigurationBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private ConfigurationMenu? _menu;
|
||||
|
||||
[ViewVariables]
|
||||
public Regex? Validation { get; internal set; }
|
||||
|
||||
public ConfigurationBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public ConfigurationBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
private ConfigurationMenu? _menu;
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
@@ -2,20 +2,19 @@
|
||||
using Content.Shared.Crayon;
|
||||
using Content.Shared.Decals;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Crayon.UI
|
||||
{
|
||||
public sealed class CrayonBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
public CrayonBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
[ViewVariables]
|
||||
private CrayonWindow? _menu;
|
||||
|
||||
public CrayonBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
private CrayonWindow? _menu;
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using static Content.Shared.Disposal.Components.SharedDisposalRouterComponent;
|
||||
|
||||
namespace Content.Client.Disposal.UI
|
||||
@@ -11,9 +10,10 @@ namespace Content.Client.Disposal.UI
|
||||
[UsedImplicitly]
|
||||
public sealed class DisposalRouterBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private DisposalRouterWindow? _window;
|
||||
|
||||
public DisposalRouterBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public DisposalRouterBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using static Content.Shared.Disposal.Components.SharedDisposalTaggerComponent;
|
||||
|
||||
namespace Content.Client.Disposal.UI
|
||||
@@ -11,9 +10,10 @@ namespace Content.Client.Disposal.UI
|
||||
[UsedImplicitly]
|
||||
public sealed class DisposalTaggerBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private DisposalTaggerWindow? _window;
|
||||
|
||||
public DisposalTaggerBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public DisposalTaggerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -14,16 +14,15 @@ namespace Content.Client.Disposal.UI
|
||||
[UsedImplicitly]
|
||||
public sealed class DisposalUnitBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
// What are you doing here
|
||||
[ViewVariables]
|
||||
public MailingUnitWindow? MailingUnitWindow;
|
||||
|
||||
[ViewVariables]
|
||||
public DisposalUnitWindow? DisposalUnitWindow;
|
||||
|
||||
public DisposalUnitBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public DisposalUnitBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
}
|
||||
|
||||
private void ButtonPressed(UiButton button)
|
||||
@@ -56,7 +55,7 @@ namespace Content.Client.Disposal.UI
|
||||
|
||||
MailingUnitWindow.TargetListContainer.OnItemSelected += TargetSelected;
|
||||
}
|
||||
else if(UiKey is DisposalUnitUiKey)
|
||||
else if (UiKey is DisposalUnitUiKey)
|
||||
{
|
||||
DisposalUnitWindow = new DisposalUnitWindow();
|
||||
|
||||
|
||||
@@ -7,9 +7,10 @@ namespace Content.Client.Fax.UI;
|
||||
[UsedImplicitly]
|
||||
public sealed class FaxBoundUi : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private FaxWindow? _window;
|
||||
|
||||
public FaxBoundUi(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public FaxBoundUi(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,13 @@ namespace Content.Client.Forensics
|
||||
{
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
|
||||
[ViewVariables]
|
||||
private ForensicScannerMenu? _window;
|
||||
|
||||
[ViewVariables]
|
||||
private TimeSpan _printCooldown;
|
||||
|
||||
public ForensicScannerBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public ForensicScannerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
using Content.Shared.Gravity;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.Gravity.UI
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class GravityGeneratorBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private GravityGeneratorWindow? _window;
|
||||
|
||||
public GravityGeneratorBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base (owner, uiKey)
|
||||
public GravityGeneratorBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Content.Client.Gravity.UI
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_window = new GravityGeneratorWindow(this, Owner);
|
||||
_window = new GravityGeneratorWindow(this);
|
||||
|
||||
/*
|
||||
_window.Switch.OnPressed += _ =>
|
||||
|
||||
@@ -14,12 +14,12 @@ namespace Content.Client.Gravity.UI
|
||||
|
||||
private readonly GravityGeneratorBoundUserInterface _owner;
|
||||
|
||||
public GravityGeneratorWindow(GravityGeneratorBoundUserInterface ui, ClientUserInterfaceComponent component)
|
||||
public GravityGeneratorWindow(GravityGeneratorBoundUserInterface owner)
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
_owner = ui;
|
||||
_owner = owner;
|
||||
|
||||
OnButton.Group = _buttonGroup;
|
||||
OffButton.Group = _buttonGroup;
|
||||
@@ -27,7 +27,7 @@ namespace Content.Client.Gravity.UI
|
||||
OnButton.OnPressed += _ => _owner.SetPowerSwitch(true);
|
||||
OffButton.OnPressed += _ => _owner.SetPowerSwitch(false);
|
||||
|
||||
EntityView.Sprite = IoCManager.Resolve<IEntityManager>().GetComponent<SpriteComponent>(component.Owner);
|
||||
EntityView.SetEntity(owner.Owner);
|
||||
}
|
||||
|
||||
public void UpdateState(SharedGravityGeneratorComponent.GeneratorState state)
|
||||
|
||||
@@ -7,9 +7,10 @@ namespace Content.Client.HealthAnalyzer.UI
|
||||
[UsedImplicitly]
|
||||
public sealed class HealthAnalyzerBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private HealthAnalyzerWindow? _window;
|
||||
|
||||
public HealthAnalyzerBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public HealthAnalyzerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -18,7 +19,7 @@ namespace Content.Client.HealthAnalyzer.UI
|
||||
base.Open();
|
||||
_window = new HealthAnalyzerWindow
|
||||
{
|
||||
Title = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Owner).EntityName,
|
||||
Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName,
|
||||
};
|
||||
_window.OnClose += Close;
|
||||
_window.OpenCentered();
|
||||
|
||||
@@ -11,12 +11,13 @@ namespace Content.Client.Humanoid;
|
||||
|
||||
public sealed class HumanoidMarkingModifierBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
public HumanoidMarkingModifierBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
[ViewVariables]
|
||||
private HumanoidMarkingModifierWindow? _window;
|
||||
|
||||
public HumanoidMarkingModifierBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
private HumanoidMarkingModifierWindow? _window;
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Client.Instruments.UI
|
||||
{
|
||||
@@ -10,15 +7,16 @@ namespace Content.Client.Instruments.UI
|
||||
[ViewVariables]
|
||||
private InstrumentMenu? _instrumentMenu;
|
||||
|
||||
[ViewVariables]
|
||||
public InstrumentComponent? Instrument { get; set; }
|
||||
|
||||
public InstrumentBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public InstrumentBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<InstrumentComponent?>(Owner.Owner, out var instrument)) return;
|
||||
if (!EntMan.TryGetComponent<InstrumentComponent?>(Owner, out var instrument)) return;
|
||||
|
||||
Instrument = instrument;
|
||||
_instrumentMenu = new InstrumentMenu(this);
|
||||
|
||||
@@ -29,31 +29,34 @@ namespace Content.Client.Inventory
|
||||
[UsedImplicitly]
|
||||
public sealed class StrippableBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
private const int ButtonSeparation = 4;
|
||||
|
||||
[Dependency] private readonly IPrototypeManager _protoMan = default!;
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
[Dependency] private readonly IUserInterfaceManager _ui = default!;
|
||||
private ExamineSystem _examine = default!;
|
||||
private InventorySystem _inv = default!;
|
||||
private readonly ExamineSystem _examine = default!;
|
||||
private readonly InventorySystem _inv = default!;
|
||||
private readonly SharedCuffableSystem _cuffable;
|
||||
|
||||
[ViewVariables]
|
||||
private StrippingMenu? _strippingMenu;
|
||||
private const int ButtonSeparation = 4;
|
||||
|
||||
[ViewVariables]
|
||||
public const string HiddenPocketEntityId = "StrippingHiddenEntity";
|
||||
private EntityUid _virtualHiddenEntity;
|
||||
|
||||
public StrippableBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
[ViewVariables]
|
||||
private readonly StrippingMenu? _strippingMenu;
|
||||
|
||||
[ViewVariables]
|
||||
private readonly EntityUid _virtualHiddenEntity;
|
||||
|
||||
public StrippableBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
_examine = _entMan.EntitySysManager.GetEntitySystem<ExamineSystem>();
|
||||
_inv = _entMan.EntitySysManager.GetEntitySystem<InventorySystem>();
|
||||
_cuffable = _entMan.System<SharedCuffableSystem>();
|
||||
var title = Loc.GetString("strippable-bound-user-interface-stripping-menu-title", ("ownerName", Identity.Name(Owner.Owner, _entMan)));
|
||||
_examine = EntMan.System<ExamineSystem>();
|
||||
_inv = EntMan.System<InventorySystem>();
|
||||
_cuffable = EntMan.System<SharedCuffableSystem>();
|
||||
|
||||
var title = Loc.GetString("strippable-bound-user-interface-stripping-menu-title", ("ownerName", Identity.Name(Owner, EntMan)));
|
||||
_strippingMenu = new StrippingMenu(title, this);
|
||||
_strippingMenu.OnClose += Close;
|
||||
_virtualHiddenEntity = _entMan.SpawnEntity(HiddenPocketEntityId, MapCoordinates.Nullspace);
|
||||
_virtualHiddenEntity = EntMan.SpawnEntity(HiddenPocketEntityId, MapCoordinates.Nullspace);
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
@@ -66,7 +69,7 @@ namespace Content.Client.Inventory
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
|
||||
_entMan.DeleteEntity(_virtualHiddenEntity);
|
||||
EntMan.DeleteEntity(_virtualHiddenEntity);
|
||||
|
||||
if (!disposing)
|
||||
return;
|
||||
@@ -87,15 +90,15 @@ namespace Content.Client.Inventory
|
||||
|
||||
_strippingMenu.ClearButtons();
|
||||
|
||||
if (_entMan.TryGetComponent(Owner.Owner, out InventoryComponent? inv) && _protoMan.TryIndex<InventoryTemplatePrototype>(inv.TemplateId, out var template))
|
||||
if (EntMan.TryGetComponent<InventoryComponent>(Owner, out var inv) && _protoMan.TryIndex<InventoryTemplatePrototype>(inv.TemplateId, out var template))
|
||||
{
|
||||
foreach (var slot in template.Slots)
|
||||
{
|
||||
AddInventoryButton(slot.Name, template, inv);
|
||||
AddInventoryButton(Owner, slot.Name, template, inv);
|
||||
}
|
||||
}
|
||||
|
||||
if (_entMan.TryGetComponent(Owner.Owner, out HandsComponent? handsComp))
|
||||
if (EntMan.TryGetComponent<HandsComponent>(Owner, out var handsComp))
|
||||
{
|
||||
// good ol hands shit code. there is a GuiHands comparer that does the same thing... but these are hands
|
||||
// and not gui hands... which are different...
|
||||
@@ -125,7 +128,7 @@ namespace Content.Client.Inventory
|
||||
}
|
||||
|
||||
// snare-removal button. This is just the old button before the change to item slots. It is pretty out of place.
|
||||
if (_entMan.TryGetComponent(Owner.Owner, out EnsnareableComponent? snare) && snare.IsEnsnared)
|
||||
if (EntMan.TryGetComponent<EnsnareableComponent>(Owner, out var snare) && snare.IsEnsnared)
|
||||
{
|
||||
var button = new Button()
|
||||
{
|
||||
@@ -156,10 +159,10 @@ namespace Content.Client.Inventory
|
||||
|
||||
button.Pressed += SlotPressed;
|
||||
|
||||
if (_entMan.TryGetComponent(hand.HeldEntity, out HandVirtualItemComponent? virt))
|
||||
if (EntMan.TryGetComponent<HandVirtualItemComponent>(hand.HeldEntity, out var virt))
|
||||
{
|
||||
button.Blocked = true;
|
||||
if (_entMan.TryGetComponent(Owner.Owner, out CuffableComponent? cuff) && _cuffable.GetAllCuffs(cuff).Contains(virt.BlockingEntity))
|
||||
if (EntMan.TryGetComponent<CuffableComponent>(Owner, out var cuff) && _cuffable.GetAllCuffs(cuff).Contains(virt.BlockingEntity))
|
||||
button.BlockedRect.MouseFilter = MouseFilterMode.Ignore;
|
||||
}
|
||||
|
||||
@@ -187,9 +190,9 @@ namespace Content.Client.Inventory
|
||||
_ui.GetUIController<VerbMenuUIController>().OpenVerbMenu(slot.Entity.Value);
|
||||
}
|
||||
|
||||
private void AddInventoryButton(string slotId, InventoryTemplatePrototype template, InventoryComponent inv)
|
||||
private void AddInventoryButton(EntityUid invUid, string slotId, InventoryTemplatePrototype _, InventoryComponent inv)
|
||||
{
|
||||
if (!_inv.TryGetSlotContainer(inv.Owner, slotId, out var container, out var slotDef, inv))
|
||||
if (!_inv.TryGetSlotContainer(invUid, slotId, out var container, out var slotDef, inv))
|
||||
return;
|
||||
|
||||
var entity = container.ContainedEntity;
|
||||
@@ -216,17 +219,19 @@ namespace Content.Client.Inventory
|
||||
|
||||
if (entity == null)
|
||||
{
|
||||
button.SpriteView.Sprite = null;
|
||||
button.SpriteView.SetEntity(null);
|
||||
return;
|
||||
}
|
||||
|
||||
SpriteComponent? sprite;
|
||||
if (_entMan.TryGetComponent(entity, out HandVirtualItemComponent? virt))
|
||||
_entMan.TryGetComponent(virt.BlockingEntity, out sprite);
|
||||
else if (!_entMan.TryGetComponent(entity, out sprite))
|
||||
EntityUid? viewEnt;
|
||||
if (EntMan.TryGetComponent<HandVirtualItemComponent>(entity, out var virt))
|
||||
viewEnt = EntMan.HasComponent<SpriteComponent>(virt.BlockingEntity) ? virt.BlockingEntity : null;
|
||||
else if (EntMan.HasComponent<SpriteComponent>(entity))
|
||||
viewEnt = entity;
|
||||
else
|
||||
return;
|
||||
|
||||
button.SpriteView.Sprite = sprite;
|
||||
button.SpriteView.SetEntity(viewEnt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.Kitchen.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Kitchen.UI
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class MicrowaveBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
[ViewVariables]
|
||||
private MicrowaveMenu? _menu;
|
||||
|
||||
[ViewVariables]
|
||||
private readonly Dictionary<int, EntityUid> _solids = new();
|
||||
private readonly Dictionary<int, Solution.ReagentQuantity> _reagents =new();
|
||||
|
||||
public MicrowaveBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner,uiKey)
|
||||
[ViewVariables]
|
||||
private readonly Dictionary<int, Solution.ReagentQuantity> _reagents = new();
|
||||
|
||||
public MicrowaveBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -40,10 +36,10 @@ namespace Content.Client.Kitchen.UI
|
||||
SendMessage(new MicrowaveEjectSolidIndexedMessage(_solids[args.ItemIndex]));
|
||||
};
|
||||
|
||||
_menu.OnCookTimeSelected += (args,buttonIndex) =>
|
||||
_menu.OnCookTimeSelected += (args, buttonIndex) =>
|
||||
{
|
||||
var actualButton = (MicrowaveMenu.MicrowaveCookTimeButton) args.Button ;
|
||||
SendMessage(new MicrowaveSelectCookTimeMessage(buttonIndex,actualButton.CookTime));
|
||||
var actualButton = (MicrowaveMenu.MicrowaveCookTimeButton) args.Button;
|
||||
SendMessage(new MicrowaveSelectCookTimeMessage(buttonIndex, actualButton.CookTime));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -93,7 +89,7 @@ namespace Content.Client.Kitchen.UI
|
||||
_menu.IngredientsList.Clear();
|
||||
foreach (var entity in containedSolids)
|
||||
{
|
||||
if (_entityManager.Deleted(entity))
|
||||
if (EntMan.Deleted(entity))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -101,11 +97,11 @@ namespace Content.Client.Kitchen.UI
|
||||
// TODO just use sprite view
|
||||
|
||||
Texture? texture;
|
||||
if (_entityManager.TryGetComponent(entity, out IconComponent? iconComponent))
|
||||
if (EntMan.TryGetComponent<IconComponent>(entity, out var iconComponent))
|
||||
{
|
||||
texture = _entityManager.System<SpriteSystem>().GetIcon(iconComponent);
|
||||
texture = EntMan.System<SpriteSystem>().GetIcon(iconComponent);
|
||||
}
|
||||
else if (_entityManager.TryGetComponent(entity, out SpriteComponent? spriteComponent))
|
||||
else if (EntMan.TryGetComponent<SpriteComponent>(entity, out var spriteComponent))
|
||||
{
|
||||
texture = spriteComponent.Icon?.Default;
|
||||
}
|
||||
@@ -114,7 +110,7 @@ namespace Content.Client.Kitchen.UI
|
||||
continue;
|
||||
}
|
||||
|
||||
var solidItem = _menu.IngredientsList.AddItem(_entityManager.GetComponent<MetaDataComponent>(entity).EntityName, texture);
|
||||
var solidItem = _menu.IngredientsList.AddItem(EntMan.GetComponent<MetaDataComponent>(entity).EntityName, texture);
|
||||
var solidIndex = _menu.IngredientsList.IndexOf(solidItem);
|
||||
_solids.Add(solidIndex, entity);
|
||||
}
|
||||
|
||||
@@ -8,18 +8,20 @@ namespace Content.Client.Kitchen.UI
|
||||
{
|
||||
public sealed class ReagentGrinderBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
[ViewVariables]
|
||||
private GrinderMenu? _menu;
|
||||
|
||||
public ReagentGrinderBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey) { }
|
||||
public ReagentGrinderBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_menu = new GrinderMenu(this, _entityManager, _prototypeManager);
|
||||
_menu = new GrinderMenu(this, EntMan, _prototypeManager);
|
||||
_menu.OpenCentered();
|
||||
_menu.OnClose += Close;
|
||||
}
|
||||
@@ -38,10 +40,8 @@ namespace Content.Client.Kitchen.UI
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
{
|
||||
base.UpdateState(state);
|
||||
if (!(state is ReagentGrinderInterfaceState cState))
|
||||
{
|
||||
if (state is not ReagentGrinderInterfaceState cState)
|
||||
return;
|
||||
}
|
||||
|
||||
_menu?.UpdateState(cState);
|
||||
}
|
||||
@@ -52,10 +52,29 @@ namespace Content.Client.Kitchen.UI
|
||||
_menu?.HandleMessage(message);
|
||||
}
|
||||
|
||||
public void StartGrinding(BaseButton.ButtonEventArgs? args = null) => SendMessage(new ReagentGrinderStartMessage(GrinderProgram.Grind));
|
||||
public void StartJuicing(BaseButton.ButtonEventArgs? args = null) => SendMessage(new ReagentGrinderStartMessage(GrinderProgram.Juice));
|
||||
public void EjectAll(BaseButton.ButtonEventArgs? args = null) => SendMessage(new ReagentGrinderEjectChamberAllMessage());
|
||||
public void EjectBeaker(BaseButton.ButtonEventArgs? args = null) => SendMessage(new ItemSlotButtonPressedEvent(SharedReagentGrinder.BeakerSlotId));
|
||||
public void EjectChamberContent(EntityUid uid) => SendMessage(new ReagentGrinderEjectChamberContentMessage(uid));
|
||||
public void StartGrinding(BaseButton.ButtonEventArgs? _ = null)
|
||||
{
|
||||
SendMessage(new ReagentGrinderStartMessage(GrinderProgram.Grind));
|
||||
}
|
||||
|
||||
public void StartJuicing(BaseButton.ButtonEventArgs? _ = null)
|
||||
{
|
||||
SendMessage(new ReagentGrinderStartMessage(GrinderProgram.Juice));
|
||||
}
|
||||
|
||||
public void EjectAll(BaseButton.ButtonEventArgs? _ = null)
|
||||
{
|
||||
SendMessage(new ReagentGrinderEjectChamberAllMessage());
|
||||
}
|
||||
|
||||
public void EjectBeaker(BaseButton.ButtonEventArgs? _ = null)
|
||||
{
|
||||
SendMessage(new ItemSlotButtonPressedEvent(SharedReagentGrinder.BeakerSlotId));
|
||||
}
|
||||
|
||||
public void EjectChamberContent(EntityUid uid)
|
||||
{
|
||||
SendMessage(new ReagentGrinderEjectChamberContentMessage(uid));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Content.Shared.Labels;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.Labels.UI
|
||||
{
|
||||
@@ -9,9 +8,10 @@ namespace Content.Client.Labels.UI
|
||||
/// </summary>
|
||||
public sealed class HandLabelerBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private HandLabelerWindow? _window;
|
||||
|
||||
public HandLabelerBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public HandLabelerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ namespace Content.Client.Lathe.UI
|
||||
[UsedImplicitly]
|
||||
public sealed class LatheBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables] private LatheMenu? _menu;
|
||||
[ViewVariables] private LatheQueueMenu? _queueMenu;
|
||||
[ViewVariables]
|
||||
private LatheMenu? _menu;
|
||||
|
||||
public EntityUid Lathe;
|
||||
[ViewVariables]
|
||||
private LatheQueueMenu? _queueMenu;
|
||||
|
||||
public LatheBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public LatheBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
Lathe = owner.Owner;
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
@@ -55,8 +55,8 @@ namespace Content.Client.Lathe.UI
|
||||
case LatheUpdateState msg:
|
||||
if (_menu != null)
|
||||
_menu.Recipes = msg.Recipes;
|
||||
_menu?.PopulateRecipes(Lathe);
|
||||
_menu?.PopulateMaterials(Lathe);
|
||||
_menu?.PopulateRecipes(Owner);
|
||||
_menu?.PopulateMaterials(Owner);
|
||||
_queueMenu?.PopulateList(msg.Queue);
|
||||
_queueMenu?.SetInfo(msg.CurrentlyProducing);
|
||||
break;
|
||||
|
||||
@@ -16,8 +16,8 @@ namespace Content.Client.Lathe.UI;
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class LatheMenu : DefaultWindow
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
private readonly SpriteSystem _spriteSystem;
|
||||
private readonly LatheSystem _lathe;
|
||||
|
||||
@@ -32,24 +32,24 @@ public sealed partial class LatheMenu : DefaultWindow
|
||||
RobustXamlLoader.Load(this);
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
_spriteSystem = _entityManager.EntitySysManager.GetEntitySystem<SpriteSystem>();
|
||||
_lathe = _entityManager.EntitySysManager.GetEntitySystem<LatheSystem>();
|
||||
_spriteSystem = _entityManager.System<SpriteSystem>();
|
||||
_lathe = _entityManager.System<LatheSystem>();
|
||||
|
||||
Title = _entityManager.GetComponent<MetaDataComponent>(owner.Lathe).EntityName;
|
||||
Title = _entityManager.GetComponent<MetaDataComponent>(owner.Owner).EntityName;
|
||||
|
||||
SearchBar.OnTextChanged += _ =>
|
||||
{
|
||||
PopulateRecipes(owner.Lathe);
|
||||
PopulateRecipes(owner.Owner);
|
||||
};
|
||||
AmountLineEdit.OnTextChanged += _ =>
|
||||
{
|
||||
PopulateRecipes(owner.Lathe);
|
||||
PopulateRecipes(owner.Owner);
|
||||
};
|
||||
|
||||
QueueButton.OnPressed += a => OnQueueButtonPressed?.Invoke(a);
|
||||
ServerListButton.OnPressed += a => OnServerListButtonPressed?.Invoke(a);
|
||||
|
||||
if (_entityManager.TryGetComponent<LatheComponent>(owner.Lathe, out var latheComponent))
|
||||
if (_entityManager.TryGetComponent<LatheComponent>(owner.Owner, out var latheComponent))
|
||||
{
|
||||
if (!latheComponent.DynamicRecipes.Any())
|
||||
{
|
||||
|
||||
@@ -1,18 +1,23 @@
|
||||
using Content.Shared.MachineLinking;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.MachineLinking.UI
|
||||
{
|
||||
public sealed class SignalPortSelectorBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private SignalPortSelectorMenu? _menu;
|
||||
|
||||
[ViewVariables]
|
||||
private string? _selectedTransmitterPort;
|
||||
|
||||
[ViewVariables]
|
||||
private string? _selectedReceiverPort;
|
||||
|
||||
public SignalPortSelectorBoundUserInterface([NotNull] ClientUserInterfaceComponent owner, [NotNull] Enum uiKey) : base(owner, uiKey) { }
|
||||
public SignalPortSelectorBoundUserInterface([NotNull] EntityUid owner, [NotNull] Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
|
||||
@@ -8,9 +8,10 @@ public sealed class SignalTimerBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
|
||||
[ViewVariables]
|
||||
private SignalTimerWindow? _window;
|
||||
|
||||
public SignalTimerBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public SignalTimerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,10 @@ namespace Content.Client.MagicMirror;
|
||||
|
||||
public sealed class MagicMirrorBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private MagicMirrorWindow? _window;
|
||||
|
||||
public MagicMirrorBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public MagicMirrorBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -20,13 +21,13 @@ public sealed class MagicMirrorBoundUserInterface : BoundUserInterface
|
||||
|
||||
_window.OnHairSelected += tuple => SelectHair(MagicMirrorCategory.Hair, tuple.id, tuple.slot);
|
||||
_window.OnHairColorChanged += args => ChangeColor(MagicMirrorCategory.Hair, args.marking, args.slot);
|
||||
_window.OnHairSlotAdded += delegate() { AddSlot(MagicMirrorCategory.Hair); };
|
||||
_window.OnHairSlotAdded += delegate () { AddSlot(MagicMirrorCategory.Hair); };
|
||||
_window.OnHairSlotRemoved += args => RemoveSlot(MagicMirrorCategory.Hair, args);
|
||||
|
||||
_window.OnFacialHairSelected += tuple => SelectHair(MagicMirrorCategory.FacialHair, tuple.id, tuple.slot);
|
||||
_window.OnFacialHairColorChanged +=
|
||||
args => ChangeColor(MagicMirrorCategory.FacialHair, args.marking, args.slot);
|
||||
_window.OnFacialHairSlotAdded += delegate() { AddSlot(MagicMirrorCategory.FacialHair); };
|
||||
_window.OnFacialHairSlotAdded += delegate () { AddSlot(MagicMirrorCategory.FacialHair); };
|
||||
_window.OnFacialHairSlotRemoved += args => RemoveSlot(MagicMirrorCategory.FacialHair, args);
|
||||
|
||||
_window.OpenCentered();
|
||||
|
||||
@@ -9,23 +9,18 @@ namespace Content.Client.Mech.Ui;
|
||||
[UsedImplicitly]
|
||||
public sealed class MechBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _ent = default!;
|
||||
|
||||
private readonly EntityUid _mech;
|
||||
|
||||
[ViewVariables]
|
||||
private MechMenu? _menu;
|
||||
|
||||
public MechBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public MechBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
_mech = owner.Owner;
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_menu = new(_mech);
|
||||
_menu = new(Owner);
|
||||
|
||||
_menu.OnClose += Close;
|
||||
_menu.OpenCenteredLeft();
|
||||
@@ -49,7 +44,7 @@ public sealed class MechBoundUserInterface : BoundUserInterface
|
||||
|
||||
public void UpdateEquipmentControls(MechBoundUiState state)
|
||||
{
|
||||
if (!_ent.TryGetComponent<MechComponent>(_mech, out var mechComp))
|
||||
if (!EntMan.TryGetComponent<MechComponent>(Owner, out var mechComp))
|
||||
return;
|
||||
|
||||
foreach (var ent in mechComp.EquipmentContainer.ContainedEntities)
|
||||
@@ -77,7 +72,7 @@ public sealed class MechBoundUserInterface : BoundUserInterface
|
||||
|
||||
public UIFragment? GetEquipmentUi(EntityUid? uid)
|
||||
{
|
||||
var component = _ent.GetComponentOrNull<UIFragmentComponent>(uid);
|
||||
var component = EntMan.GetComponentOrNull<UIFragmentComponent>(uid);
|
||||
component?.Ui?.Setup(this, uid);
|
||||
return component?.Ui;
|
||||
}
|
||||
|
||||
@@ -1,25 +1,22 @@
|
||||
using Content.Shared.Medical.CrewMonitoring;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.Medical.CrewMonitoring
|
||||
{
|
||||
public sealed class CrewMonitoringBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
private readonly IEntityManager _entManager;
|
||||
[ViewVariables]
|
||||
private CrewMonitoringWindow? _menu;
|
||||
|
||||
public CrewMonitoringBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public CrewMonitoringBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
_entManager = IoCManager.Resolve<IEntityManager>();
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
EntityUid? gridUid = null;
|
||||
|
||||
if (_entManager.TryGetComponent<TransformComponent>(Owner.Owner, out var xform))
|
||||
if (EntMan.TryGetComponent<TransformComponent>(Owner, out var xform))
|
||||
{
|
||||
gridUid = xform.GridUid;
|
||||
}
|
||||
@@ -37,7 +34,7 @@ namespace Content.Client.Medical.CrewMonitoring
|
||||
switch (state)
|
||||
{
|
||||
case CrewMonitoringState st:
|
||||
_entManager.TryGetComponent<TransformComponent>(Owner.Owner, out var xform);
|
||||
EntMan.TryGetComponent<TransformComponent>(Owner, out var xform);
|
||||
|
||||
_menu?.ShowSensors(st.Sensors, xform?.Coordinates, st.Snap, st.Precision);
|
||||
break;
|
||||
|
||||
@@ -7,19 +7,20 @@ namespace Content.Client.NetworkConfigurator;
|
||||
|
||||
public sealed class NetworkConfiguratorBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
private readonly NetworkConfiguratorSystem _netConfig;
|
||||
|
||||
private NetworkConfiguratorListMenu? _listMenu;
|
||||
[ViewVariables]
|
||||
private NetworkConfiguratorConfigurationMenu? _configurationMenu;
|
||||
|
||||
[ViewVariables]
|
||||
private NetworkConfiguratorLinkMenu? _linkMenu;
|
||||
|
||||
private NetworkConfiguratorSystem _netConfig;
|
||||
[ViewVariables]
|
||||
private NetworkConfiguratorListMenu? _listMenu;
|
||||
|
||||
public NetworkConfiguratorBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public NetworkConfiguratorBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
_netConfig = _entityManager.System<NetworkConfiguratorSystem>();
|
||||
_netConfig = EntMan.System<NetworkConfiguratorSystem>();
|
||||
}
|
||||
|
||||
public void OnRemoveButtonPressed(string address)
|
||||
@@ -48,7 +49,7 @@ public sealed class NetworkConfiguratorBoundUserInterface : BoundUserInterface
|
||||
_configurationMenu.Clear.OnPressed += _ => OnConfigButtonPressed(NetworkConfiguratorButtonKey.Clear);
|
||||
_configurationMenu.Copy.OnPressed += _ => OnConfigButtonPressed(NetworkConfiguratorButtonKey.Copy);
|
||||
_configurationMenu.Show.OnPressed += OnShowPressed;
|
||||
_configurationMenu.Show.Pressed = _netConfig.ConfiguredListIsTracked(Owner.Owner);
|
||||
_configurationMenu.Show.Pressed = _netConfig.ConfiguredListIsTracked(Owner);
|
||||
_configurationMenu.OpenCentered();
|
||||
break;
|
||||
case NetworkConfiguratorUiKey.Link:
|
||||
@@ -61,7 +62,7 @@ public sealed class NetworkConfiguratorBoundUserInterface : BoundUserInterface
|
||||
|
||||
private void OnShowPressed(BaseButton.ButtonEventArgs args)
|
||||
{
|
||||
_netConfig.ToggleVisualization(Owner.Owner, args.Button.Pressed);
|
||||
_netConfig.ToggleVisualization(Owner, args.Button.Pressed);
|
||||
}
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
|
||||
@@ -8,9 +8,10 @@ namespace Content.Client.Nuke
|
||||
[UsedImplicitly]
|
||||
public sealed class NukeBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private NukeMenu? _menu;
|
||||
|
||||
public NukeBoundUserInterface([NotNull] ClientUserInterfaceComponent owner, [NotNull] Enum uiKey) : base(owner, uiKey)
|
||||
public NukeBoundUserInterface([NotNull] EntityUid owner, [NotNull] Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -57,10 +58,8 @@ namespace Content.Client.Nuke
|
||||
switch (state)
|
||||
{
|
||||
case NukeUiState msg:
|
||||
{
|
||||
_menu.UpdateState(msg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ using Content.Shared.Containers.ItemSlots;
|
||||
using Content.Shared.CrewManifest;
|
||||
using Content.Shared.PDA;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Shared.Configuration;
|
||||
|
||||
@@ -14,14 +13,13 @@ namespace Content.Client.PDA
|
||||
[UsedImplicitly]
|
||||
public sealed class PdaBoundUserInterface : CartridgeLoaderBoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IEntityManager? _entityManager = default!;
|
||||
[Dependency] private readonly IConfigurationManager _configManager = default!;
|
||||
|
||||
[ViewVariables]
|
||||
private PdaMenu? _menu;
|
||||
|
||||
public PdaBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public PdaBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
@@ -132,7 +130,7 @@ namespace Content.Client.PDA
|
||||
|
||||
private PdaBorderColorComponent? GetBorderColorComponent()
|
||||
{
|
||||
return _entityManager?.GetComponentOrNull<PdaBorderColorComponent>(Owner.Owner);
|
||||
return EntMan.GetComponentOrNull<PdaBorderColorComponent>(Owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,16 @@ using Content.Shared.PDA;
|
||||
using Content.Shared.PDA.Ringer;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.PDA.Ringer
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class RingerBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private RingtoneMenu? _menu;
|
||||
|
||||
public RingerBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public RingerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -10,16 +10,16 @@ namespace Content.Client.Paper.UI
|
||||
[UsedImplicitly]
|
||||
public sealed class PaperBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private PaperWindow? _window;
|
||||
|
||||
public PaperBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public PaperBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
var entityMgr = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
_window = new PaperWindow();
|
||||
_window.OnClose += Close;
|
||||
@@ -33,7 +33,7 @@ namespace Content.Client.Paper.UI
|
||||
}
|
||||
};
|
||||
|
||||
if (entityMgr.TryGetComponent<PaperVisualsComponent>(Owner.Owner, out var visuals))
|
||||
if (EntMan.TryGetComponent<PaperVisualsComponent>(Owner, out var visuals))
|
||||
{
|
||||
_window.InitVisuals(visuals);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,10 @@ namespace Content.Client.ParticleAccelerator.UI
|
||||
{
|
||||
public sealed class ParticleAcceleratorBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private ParticleAcceleratorControlMenu? _menu;
|
||||
|
||||
public ParticleAcceleratorBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public ParticleAcceleratorBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Player;
|
||||
|
||||
namespace Content.Client.Pinpointer.UI;
|
||||
|
||||
public sealed class StationMapBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private StationMapWindow? _window;
|
||||
|
||||
public StationMapBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public StationMapBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@ public sealed class StationMapBoundUserInterface : BoundUserInterface
|
||||
_window?.Close();
|
||||
EntityUid? gridUid = null;
|
||||
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<TransformComponent>(Owner.Owner, out var xform))
|
||||
if (EntMan.TryGetComponent<TransformComponent>(Owner, out var xform))
|
||||
{
|
||||
gridUid = xform.GridUid;
|
||||
}
|
||||
|
||||
_window = new StationMapWindow(gridUid, Owner.Owner);
|
||||
_window = new StationMapWindow(gridUid, Owner);
|
||||
_window.OpenCentered();
|
||||
_window.OnClose += Close;
|
||||
}
|
||||
|
||||
@@ -2,29 +2,28 @@
|
||||
using Content.Shared.APC;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Client.Power.APC
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class ApcBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables] private ApcMenu? _menu;
|
||||
[ViewVariables]
|
||||
private ApcMenu? _menu;
|
||||
|
||||
public ApcBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_menu = new ApcMenu(this,Owner);
|
||||
_menu = new ApcMenu(this);
|
||||
_menu.OnClose += Close;
|
||||
_menu.OpenCentered();
|
||||
}
|
||||
|
||||
public ApcBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
{
|
||||
base.UpdateState(state);
|
||||
|
||||
@@ -18,12 +18,12 @@ namespace Content.Client.Power.APC.UI
|
||||
public sealed partial class ApcMenu : FancyWindow
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
public ApcMenu(ApcBoundUserInterface owner, ClientUserInterfaceComponent component)
|
||||
public ApcMenu(ApcBoundUserInterface owner)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
EntityView.Sprite = _entityManager.GetComponent<SpriteComponent>(component.Owner);
|
||||
EntityView.SetEntity(owner.Owner);
|
||||
BreakerButton.OnPressed += _ => owner.BreakerPressed();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +1,14 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Content.Client.Computer;
|
||||
using Content.Client.IoC;
|
||||
using Content.Shared.Power;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Power;
|
||||
@@ -25,12 +17,14 @@ namespace Content.Client.Power;
|
||||
public sealed partial class PowerMonitoringWindow : DefaultWindow, IComputerWindow<PowerMonitoringConsoleBoundInterfaceState>
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
private readonly SpriteSystem _spriteSystem = default!;
|
||||
|
||||
public PowerMonitoringWindow()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
SetSize = MinSize = new Vector2(300, 450);
|
||||
IoCManager.InjectDependencies(this);
|
||||
_spriteSystem = IoCManager.Resolve<IEntityManager>().System<SpriteSystem>();
|
||||
MasterTabContainer.SetTabTitle(0, Loc.GetString("power-monitoring-window-tab-sources"));
|
||||
MasterTabContainer.SetTabTitle(1, Loc.GetString("power-monitoring-window-tab-loads"));
|
||||
}
|
||||
@@ -45,7 +39,7 @@ public sealed partial class PowerMonitoringWindow : DefaultWindow, IComputerWind
|
||||
// This means filtering out loads that are not either:
|
||||
// + Batteries (always important)
|
||||
// + Meaningful (size above 0)
|
||||
loads = loads.Where(a => a.IsBattery || (a.Size > 0.0f)).ToArray();
|
||||
loads = loads.Where(a => a.IsBattery || a.Size > 0.0f).ToArray();
|
||||
}
|
||||
UpdateList(TotalLoadsNum, scc.TotalLoads, LoadsList, loads);
|
||||
}
|
||||
@@ -69,7 +63,7 @@ public sealed partial class PowerMonitoringWindow : DefaultWindow, IComputerWind
|
||||
_prototypeManager.TryIndex(ent.IconEntityPrototypeId, out EntityPrototype? entityPrototype);
|
||||
IRsiStateLike? iconState = null;
|
||||
if (entityPrototype != null)
|
||||
iconState = SpriteComponent.GetPrototypeIcon(entityPrototype, StaticIoC.ResC);
|
||||
iconState = _spriteSystem.GetPrototypeIcon(entityPrototype);
|
||||
var icon = iconState?.GetFrame(RSI.State.Direction.South, 0);
|
||||
var item = list[i];
|
||||
item.Text = $"{ent.NameLocalized} {Loc.GetString("power-monitoring-window-value", ("value", ent.Size))}";
|
||||
@@ -81,6 +75,8 @@ public sealed partial class PowerMonitoringWindow : DefaultWindow, IComputerWind
|
||||
[UsedImplicitly]
|
||||
public sealed class PowerMonitoringConsoleBoundUserInterface : ComputerBoundUserInterface<PowerMonitoringWindow, PowerMonitoringConsoleBoundInterfaceState>
|
||||
{
|
||||
public PowerMonitoringConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey) {}
|
||||
public PowerMonitoringConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,14 +4,11 @@ using Content.Client.Computer;
|
||||
using Content.Shared.Solar;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Client.Power
|
||||
@@ -19,6 +16,7 @@ namespace Content.Client.Power
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class SolarControlWindow : DefaultWindow, IComputerWindow<SolarControlConsoleBoundInterfaceState>
|
||||
{
|
||||
[ViewVariables]
|
||||
private SolarControlConsoleBoundInterfaceState _lastState = new(0, 0, 0, 0);
|
||||
|
||||
public SolarControlWindow()
|
||||
@@ -28,9 +26,10 @@ namespace Content.Client.Power
|
||||
|
||||
public void SetupComputerWindow(ComputerBoundUserInterfaceBase cb)
|
||||
{
|
||||
PanelRotation.OnTextEntered += text => {
|
||||
double value;
|
||||
if (!double.TryParse((string?) text.Text, out value)) return;
|
||||
PanelRotation.OnTextEntered += text =>
|
||||
{
|
||||
if (!double.TryParse((string?) text.Text, out var value))
|
||||
return;
|
||||
|
||||
SolarControlConsoleAdjustMessage msg = new()
|
||||
{
|
||||
@@ -43,9 +42,11 @@ namespace Content.Client.Power
|
||||
_lastState.Rotation = msg.Rotation;
|
||||
NotARadar.UpdateState(_lastState);
|
||||
};
|
||||
PanelVelocity.OnTextEntered += text => {
|
||||
double value;
|
||||
if (!double.TryParse((string?) text.Text, out value)) return;
|
||||
|
||||
PanelVelocity.OnTextEntered += text =>
|
||||
{
|
||||
if (!double.TryParse((string?) text.Text, out var value))
|
||||
return;
|
||||
|
||||
SolarControlConsoleAdjustMessage msg = new()
|
||||
{
|
||||
@@ -61,14 +62,14 @@ namespace Content.Client.Power
|
||||
};
|
||||
}
|
||||
|
||||
private string FormatAngle(Angle d)
|
||||
private static string FormatAngle(Angle d)
|
||||
{
|
||||
return d.Degrees.ToString("F1");
|
||||
}
|
||||
|
||||
// The idea behind this is to prevent every update from the server
|
||||
// breaking the textfield.
|
||||
private void UpdateField(LineEdit field, string newValue)
|
||||
private static void UpdateField(LineEdit field, string newValue)
|
||||
{
|
||||
if (!field.HasKeyboardFocus())
|
||||
{
|
||||
@@ -92,7 +93,7 @@ namespace Content.Client.Power
|
||||
{
|
||||
// This is used for client-side prediction of the panel rotation.
|
||||
// This makes the display feel a lot smoother.
|
||||
private IGameTiming _gameTiming = IoCManager.Resolve<IGameTiming>();
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
|
||||
private SolarControlConsoleBoundInterfaceState _lastState = new(0, 0, 0, 0);
|
||||
|
||||
@@ -105,6 +106,7 @@ namespace Content.Client.Power
|
||||
|
||||
public SolarControlNotARadar()
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
MinSize = new Vector2(SizeFull, SizeFull);
|
||||
}
|
||||
|
||||
@@ -114,7 +116,7 @@ namespace Content.Client.Power
|
||||
_lastStateTime = _gameTiming.CurTime;
|
||||
}
|
||||
|
||||
public Angle PredictedPanelRotation => _lastState.Rotation + (_lastState.AngularVelocity * ((_gameTiming.CurTime - _lastStateTime).TotalSeconds));
|
||||
public Angle PredictedPanelRotation => _lastState.Rotation + _lastState.AngularVelocity * (_gameTiming.CurTime - _lastStateTime).TotalSeconds;
|
||||
|
||||
protected override void Draw(DrawingHandleScreen handle)
|
||||
{
|
||||
@@ -137,7 +139,7 @@ namespace Content.Client.Power
|
||||
|
||||
for (var i = 0; i < gridLinesRadial; i++)
|
||||
{
|
||||
Angle angle = (Math.PI / gridLinesRadial) * i;
|
||||
Angle angle = Math.PI / gridLinesRadial * i;
|
||||
var aExtent = angle.ToVec() * RadiusCircle;
|
||||
handle.DrawLine(new Vector2(point, point) - aExtent, new Vector2(point, point) + aExtent, gridLines);
|
||||
}
|
||||
@@ -162,6 +164,8 @@ namespace Content.Client.Power
|
||||
[UsedImplicitly]
|
||||
public sealed class SolarControlConsoleBoundUserInterface : ComputerBoundUserInterface<SolarControlWindow, SolarControlConsoleBoundInterfaceState>
|
||||
{
|
||||
public SolarControlConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey) {}
|
||||
public SolarControlConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@ namespace Content.Client.Research.UI
|
||||
{
|
||||
public sealed class DiskConsoleBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private DiskConsoleMenu? _menu;
|
||||
|
||||
public DiskConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public DiskConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
|
||||
@@ -5,9 +5,10 @@ namespace Content.Client.Research.UI
|
||||
{
|
||||
public sealed class ResearchClientBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private ResearchClientServerSelectionMenu? _menu;
|
||||
|
||||
public ResearchClientBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public ResearchClientBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
SendMessage(new ResearchClientSyncMessage());
|
||||
}
|
||||
|
||||
@@ -7,20 +7,18 @@ namespace Content.Client.Research.UI;
|
||||
[UsedImplicitly]
|
||||
public sealed class ResearchConsoleBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
|
||||
[ViewVariables]
|
||||
private ResearchConsoleMenu? _consoleMenu;
|
||||
|
||||
|
||||
public ResearchConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public ResearchConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
var owner = Owner.Owner;
|
||||
var owner = Owner;
|
||||
|
||||
_consoleMenu = new ResearchConsoleMenu(owner);
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Content.Shared.Salvage;
|
||||
using Content.Shared.Salvage.Expeditions;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
@@ -8,9 +7,10 @@ namespace Content.Client.Salvage.UI;
|
||||
[UsedImplicitly]
|
||||
public sealed class SalvageExpeditionConsoleBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private SalvageExpeditionWindow? _window;
|
||||
|
||||
public SalvageExpeditionConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public SalvageExpeditionConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,13 @@ using Content.Client.Computer;
|
||||
using Content.Client.Shuttles.UI;
|
||||
using Content.Shared.Shuttles.BUIStates;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.Shuttles.BUI;
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class EmergencyConsoleBoundUserInterface : ComputerBoundUserInterface<EmergencyConsoleWindow, EmergencyConsoleBoundUserInterfaceState>
|
||||
{
|
||||
public EmergencyConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey) {}
|
||||
public EmergencyConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,16 +9,17 @@ namespace Content.Client.Shuttles.BUI;
|
||||
[UsedImplicitly]
|
||||
public sealed class IFFConsoleBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private IFFConsoleWindow? _window;
|
||||
|
||||
public IFFConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public IFFConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_window = new IFFConsoleWindow();
|
||||
_window.OnClose += Close;
|
||||
_window.ShowIFF += SendIFFMessage;
|
||||
|
||||
@@ -8,13 +8,17 @@ namespace Content.Client.Shuttles.BUI;
|
||||
[UsedImplicitly]
|
||||
public sealed class RadarConsoleBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private RadarConsoleWindow? _window;
|
||||
|
||||
public RadarConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey) {}
|
||||
public RadarConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_window = new RadarConsoleWindow();
|
||||
_window.OnClose += Close;
|
||||
_window.OpenCentered();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Content.Client.Shuttles.UI;
|
||||
using Content.Shared.Shuttles.BUIStates;
|
||||
using Content.Shared.Shuttles.Components;
|
||||
using Content.Shared.Shuttles.Events;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
@@ -10,9 +9,12 @@ namespace Content.Client.Shuttles.BUI;
|
||||
[UsedImplicitly]
|
||||
public sealed class ShuttleConsoleBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private ShuttleConsoleWindow? _window;
|
||||
|
||||
public ShuttleConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey) {}
|
||||
public ShuttleConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
@@ -51,17 +53,17 @@ public sealed class ShuttleConsoleBoundUserInterface : BoundUserInterface
|
||||
|
||||
private void OnStopAutodockPressed(EntityUid obj)
|
||||
{
|
||||
SendMessage(new StopAutodockRequestMessage() {DockEntity = obj});
|
||||
SendMessage(new StopAutodockRequestMessage() { DockEntity = obj });
|
||||
}
|
||||
|
||||
private void OnAutodockPressed(EntityUid obj)
|
||||
{
|
||||
SendMessage(new AutodockRequestMessage() {DockEntity = obj});
|
||||
SendMessage(new AutodockRequestMessage() { DockEntity = obj });
|
||||
}
|
||||
|
||||
private void OnUndockPressed(EntityUid obj)
|
||||
{
|
||||
SendMessage(new UndockRequestMessage() {DockEntity = obj});
|
||||
SendMessage(new UndockRequestMessage() { DockEntity = obj });
|
||||
}
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
|
||||
@@ -52,13 +52,13 @@ namespace Content.Client.Shuttles.Systems
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TryComp<ShuttleConsoleComponent>(console, out var shuttleConsoleComponent))
|
||||
if (!HasComp<ShuttleConsoleComponent>(console))
|
||||
{
|
||||
Logger.Warning($"Unable to set Helmsman console to {console}");
|
||||
Log.Warning($"Unable to set Helmsman console to {console}");
|
||||
return;
|
||||
}
|
||||
|
||||
component.Console = shuttleConsoleComponent;
|
||||
component.Console = console;
|
||||
ActionBlockerSystem.UpdateCanMove(uid);
|
||||
_input.Contexts.SetActiveContext("shuttle");
|
||||
}
|
||||
|
||||
@@ -5,10 +5,12 @@ namespace Content.Client.StationRecords;
|
||||
|
||||
public sealed class GeneralStationRecordConsoleBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private GeneralStationRecordConsoleWindow? _window = default!;
|
||||
|
||||
public GeneralStationRecordConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
{}
|
||||
public GeneralStationRecordConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Content.Client.Examine;
|
||||
using Content.Client.Storage.UI;
|
||||
using Content.Client.UserInterface.Controls;
|
||||
using Content.Client.Verbs;
|
||||
using Content.Client.Verbs.UI;
|
||||
using Content.Shared.Input;
|
||||
using Content.Shared.Interaction;
|
||||
@@ -17,9 +16,10 @@ namespace Content.Client.Storage
|
||||
[UsedImplicitly]
|
||||
public sealed class StorageBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables] private StorageWindow? _window;
|
||||
[ViewVariables]
|
||||
private StorageWindow? _window;
|
||||
|
||||
public StorageBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public StorageBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -29,9 +29,10 @@ namespace Content.Client.Storage
|
||||
|
||||
if (_window == null)
|
||||
{
|
||||
var entMan = IoCManager.Resolve<IEntityManager>();
|
||||
_window = new StorageWindow(entMan)
|
||||
{Title = entMan.GetComponent<MetaDataComponent>(Owner.Owner).EntityName};
|
||||
_window = new StorageWindow(EntMan)
|
||||
{
|
||||
Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName
|
||||
};
|
||||
|
||||
_window.EntityList.GenerateItem += _window.GenerateButton;
|
||||
_window.EntityList.ItemPressed += InteractWithItem;
|
||||
@@ -48,14 +49,14 @@ namespace Content.Client.Storage
|
||||
|
||||
public void InteractWithItem(BaseButton.ButtonEventArgs args, ListData cData)
|
||||
{
|
||||
if (cData is not EntityListData {Uid: var entity})
|
||||
if (cData is not EntityListData { Uid: var entity })
|
||||
return;
|
||||
|
||||
if (args.Event.Function == EngineKeyFunctions.UIClick)
|
||||
{
|
||||
SendMessage(new StorageInteractWithItemEvent(entity));
|
||||
}
|
||||
else if (IoCManager.Resolve<IEntityManager>().EntityExists(entity))
|
||||
else if (EntMan.EntityExists(entity))
|
||||
{
|
||||
OnButtonPressed(args.Event, entity);
|
||||
}
|
||||
@@ -63,12 +64,9 @@ namespace Content.Client.Storage
|
||||
|
||||
private void OnButtonPressed(GUIBoundKeyEventArgs args, EntityUid entity)
|
||||
{
|
||||
var entitySys = IoCManager.Resolve<IEntitySystemManager>();
|
||||
var entities = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
if (args.Function == ContentKeyFunctions.ExamineEntity)
|
||||
{
|
||||
entitySys.GetEntitySystem<ExamineSystem>()
|
||||
EntMan.System<ExamineSystem>()
|
||||
.DoExamine(entity);
|
||||
}
|
||||
else if (args.Function == EngineKeyFunctions.UseSecondary)
|
||||
@@ -77,12 +75,12 @@ namespace Content.Client.Storage
|
||||
}
|
||||
else if (args.Function == ContentKeyFunctions.ActivateItemInWorld)
|
||||
{
|
||||
entities.EntityNetManager?.SendSystemNetworkMessage(
|
||||
EntMan.EntityNetManager?.SendSystemNetworkMessage(
|
||||
new InteractInventorySlotEvent(entity, altInteract: false));
|
||||
}
|
||||
else if (args.Function == ContentKeyFunctions.AltActivateItemInWorld)
|
||||
{
|
||||
entities.RaisePredictiveEvent(new InteractInventorySlotEvent(entity, altInteract: true));
|
||||
EntMan.RaisePredictiveEvent(new InteractInventorySlotEvent(entity, altInteract: true));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -8,13 +8,14 @@ namespace Content.Client.Store.Ui;
|
||||
[UsedImplicitly]
|
||||
public sealed class StoreBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private StoreMenu? _menu;
|
||||
|
||||
[ViewVariables]
|
||||
private string _windowName = Loc.GetString("store-ui-default-title");
|
||||
|
||||
public StoreBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public StoreBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
|
||||
@@ -36,7 +36,7 @@ public sealed class StrippableSystem : SharedStrippableSystem
|
||||
if (!TryComp(uid, out ClientUserInterfaceComponent? uiComp))
|
||||
return;
|
||||
|
||||
foreach (var ui in uiComp.Interfaces)
|
||||
foreach (var ui in uiComp.OpenInterfaces.Values)
|
||||
{
|
||||
if (ui is StrippableBoundUserInterface stripUi)
|
||||
stripUi.DirtyMenu();
|
||||
|
||||
@@ -6,18 +6,19 @@ namespace Content.Client.SurveillanceCamera.UI;
|
||||
|
||||
public sealed class SurveillanceCameraMonitorBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
private readonly EyeLerpingSystem _eyeLerpingSystem;
|
||||
private readonly SurveillanceCameraMonitorSystem _surveillanceCameraMonitorSystem;
|
||||
|
||||
[ViewVariables]
|
||||
private SurveillanceCameraMonitorWindow? _window;
|
||||
|
||||
[ViewVariables]
|
||||
private EntityUid? _currentCamera;
|
||||
|
||||
public SurveillanceCameraMonitorBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public SurveillanceCameraMonitorBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
_eyeLerpingSystem = _entityManager.EntitySysManager.GetEntitySystem<EyeLerpingSystem>();
|
||||
_surveillanceCameraMonitorSystem = _entityManager.EntitySysManager.GetEntitySystem<SurveillanceCameraMonitorSystem>();
|
||||
_eyeLerpingSystem = EntMan.System<EyeLerpingSystem>();
|
||||
_surveillanceCameraMonitorSystem = EntMan.System<SurveillanceCameraMonitorSystem>();
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
@@ -54,7 +55,7 @@ public sealed class SurveillanceCameraMonitorBoundUserInterface : BoundUserInter
|
||||
|
||||
private void OnCameraSwitchTimer()
|
||||
{
|
||||
_surveillanceCameraMonitorSystem.AddTimer(Owner.Owner, _window!.OnSwitchTimerComplete);
|
||||
_surveillanceCameraMonitorSystem.AddTimer(Owner, _window!.OnSwitchTimerComplete);
|
||||
}
|
||||
|
||||
private void OnCameraRefresh()
|
||||
@@ -85,7 +86,7 @@ public sealed class SurveillanceCameraMonitorBoundUserInterface : BoundUserInter
|
||||
|
||||
if (_currentCamera != null)
|
||||
{
|
||||
_surveillanceCameraMonitorSystem.RemoveTimer(Owner.Owner);
|
||||
_surveillanceCameraMonitorSystem.RemoveTimer(Owner);
|
||||
_eyeLerpingSystem.RemoveEye(_currentCamera.Value);
|
||||
_currentCamera = null;
|
||||
}
|
||||
@@ -104,7 +105,7 @@ public sealed class SurveillanceCameraMonitorBoundUserInterface : BoundUserInter
|
||||
_currentCamera = cast.ActiveCamera;
|
||||
}
|
||||
|
||||
if (_entityManager.TryGetComponent(cast.ActiveCamera, out EyeComponent? eye))
|
||||
if (EntMan.TryGetComponent<EyeComponent>(cast.ActiveCamera, out var eye))
|
||||
{
|
||||
_window.UpdateState(eye.Eye, cast.Subnets, cast.ActiveAddress, cast.ActiveSubnet, cast.Cameras);
|
||||
}
|
||||
|
||||
@@ -5,15 +5,16 @@ namespace Content.Client.SurveillanceCamera.UI;
|
||||
|
||||
public sealed class SurveillanceCameraSetupBoundUi : BoundUserInterface
|
||||
{
|
||||
private SurveillanceCameraSetupWindow? _window;
|
||||
private SurveillanceCameraSetupUiKey _type;
|
||||
[ViewVariables]
|
||||
private readonly SurveillanceCameraSetupUiKey _type;
|
||||
|
||||
public SurveillanceCameraSetupBoundUi(ClientUserInterfaceComponent component, Enum uiKey) : base(component, uiKey)
|
||||
[ViewVariables]
|
||||
private SurveillanceCameraSetupWindow? _window;
|
||||
|
||||
public SurveillanceCameraSetupBoundUi(EntityUid component, Enum uiKey) : base(component, uiKey)
|
||||
{
|
||||
if (uiKey is not SurveillanceCameraSetupUiKey key)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_type = key;
|
||||
}
|
||||
|
||||
@@ -5,19 +5,21 @@ using Robust.Client.GameObjects;
|
||||
namespace Content.Client.UserInterface.Systems.Atmos.GasTank
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class GasTankBoundUserInterface
|
||||
: BoundUserInterface
|
||||
public sealed class GasTankBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
public GasTankBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) :
|
||||
base(owner, uiKey)
|
||||
[ViewVariables]
|
||||
private GasTankWindow? _window;
|
||||
|
||||
public GasTankBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
private GasTankWindow? _window;
|
||||
|
||||
public void SetOutputPressure(in float value)
|
||||
{
|
||||
SendMessage(new GasTankSetPressureMessage {Pressure = value});
|
||||
SendMessage(new GasTankSetPressureMessage
|
||||
{
|
||||
Pressure = value
|
||||
});
|
||||
}
|
||||
|
||||
public void ToggleInternals()
|
||||
|
||||
@@ -11,9 +11,10 @@ namespace Content.Client.VendingMachines
|
||||
[ViewVariables]
|
||||
private VendingMachineMenu? _menu;
|
||||
|
||||
[ViewVariables]
|
||||
private List<VendingMachineInventoryEntry> _cachedInventory = new();
|
||||
|
||||
public VendingMachineBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public VendingMachineBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -21,12 +22,11 @@ namespace Content.Client.VendingMachines
|
||||
{
|
||||
base.Open();
|
||||
|
||||
var entMan = IoCManager.Resolve<IEntityManager>();
|
||||
var vendingMachineSys = entMan.System<VendingMachineSystem>();
|
||||
var vendingMachineSys = EntMan.System<VendingMachineSystem>();
|
||||
|
||||
_cachedInventory = vendingMachineSys.GetAllInventory(Owner.Owner);
|
||||
_cachedInventory = vendingMachineSys.GetAllInventory(Owner);
|
||||
|
||||
_menu = new VendingMachineMenu {Title = entMan.GetComponent<MetaDataComponent>(Owner.Owner).EntityName};
|
||||
_menu = new VendingMachineMenu { Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName };
|
||||
|
||||
_menu.OnClose += Close;
|
||||
_menu.OnItemSelected += OnItemSelected;
|
||||
|
||||
@@ -5,12 +5,13 @@ namespace Content.Client.VoiceMask;
|
||||
|
||||
public sealed class VoiceMaskBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
public VoiceMaskBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
[ViewVariables]
|
||||
private VoiceMaskNameChangeWindow? _window;
|
||||
|
||||
public VoiceMaskBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
private VoiceMaskNameChangeWindow? _window;
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
@@ -8,9 +8,10 @@ namespace Content.Client.Weapons.Melee.UI;
|
||||
/// </summary>
|
||||
public sealed class MeleeSpeechBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private MeleeSpeechWindow? _window;
|
||||
|
||||
public MeleeSpeechBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public MeleeSpeechBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -50,7 +51,9 @@ public sealed class MeleeSpeechBoundUserInterface : BoundUserInterface
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
if (!disposing) return;
|
||||
_window?.Dispose();
|
||||
}
|
||||
if (!disposing)
|
||||
return;
|
||||
|
||||
_window?.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
using Content.Shared.Wires;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.Wires.UI
|
||||
{
|
||||
public sealed class WiresBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private WiresMenu? _menu;
|
||||
|
||||
public WiresBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public WiresBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@ namespace Content.Client.Xenoarchaeology.Ui;
|
||||
[UsedImplicitly]
|
||||
public sealed class AnalysisConsoleBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private AnalysisConsoleMenu? _consoleMenu;
|
||||
|
||||
public AnalysisConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public AnalysisConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
|
||||
Reference in New Issue
Block a user