Convert almost all IActivate instances that open UIs to ActivatableUI (#7028)
* Chem master * Drone support for handhelds * Vending machines, scanners * Cloners, R&D computers * make research a little less sussy * Unfuck wires * PA control computer * Unfuck merge * Clean up git gore for good * Disposals * Microwaves * paper * Magic mirror * More vendors for drones * Solar computer whitelist * EFR review updates
This commit is contained in:
@@ -1,28 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.Chemistry.Components.SolutionManager;
|
||||
using Content.Server.Chemistry.EntitySystems;
|
||||
using Content.Server.Hands.Components;
|
||||
using Content.Server.Labels.Components;
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Server.UserInterface;
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Containers.ItemSlots;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Item;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Random.Helpers;
|
||||
using Content.Shared.Sound;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.Chemistry.Components
|
||||
{
|
||||
@@ -33,9 +24,8 @@ namespace Content.Server.Chemistry.Components
|
||||
/// Messages sent from the client are used to handle ui button presses.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(IActivate))]
|
||||
[ComponentReference(typeof(SharedChemMasterComponent))]
|
||||
public sealed class ChemMasterComponent : SharedChemMasterComponent, IActivate
|
||||
public sealed class ChemMasterComponent : SharedChemMasterComponent
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entities = default!;
|
||||
|
||||
@@ -385,30 +375,6 @@ namespace Content.Server.Chemistry.Components
|
||||
UpdateUserInterface();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when you click the owner entity with an empty hand. Opens the UI client-side if possible.
|
||||
/// </summary>
|
||||
/// <param name="args">Data relevant to the event such as the actor which triggered it.</param>
|
||||
void IActivate.Activate(ActivateEventArgs args)
|
||||
{
|
||||
if (!_entities.TryGetComponent(args.User, out ActorComponent? actor))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_entities.TryGetComponent(args.User, out HandsComponent? hands))
|
||||
{
|
||||
Owner.PopupMessage(args.User, Loc.GetString("chem-master-component-activate-no-hands"));
|
||||
return;
|
||||
}
|
||||
|
||||
var activeHandEntity = hands.GetActiveHandItem?.Owner;
|
||||
if (activeHandEntity == null)
|
||||
{
|
||||
UserInterface?.Open(actor.PlayerSession);
|
||||
}
|
||||
}
|
||||
|
||||
private void ClickSound()
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(Owner), _clickSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f));
|
||||
|
||||
Reference in New Issue
Block a user