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:
Rane
2022-03-12 13:26:06 -05:00
committed by GitHub
parent 865c9630bd
commit 926e36d81d
48 changed files with 305 additions and 584 deletions

View File

@@ -1,23 +1,15 @@
using System.Collections.Generic;
using Content.Shared.Interaction;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Player;
using System;
using System.Linq;
using Content.Server.Popups;
using Content.Server.Power.Components;
using Content.Server.WireHacking;
using Content.Shared.Access.Components;
using Content.Shared.Access.Systems;
using Content.Shared.VendingMachines;
using Robust.Server.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Content.Server.Throwing;
using Robust.Shared.Maths;
using Content.Shared.Acts;
using static Content.Shared.VendingMachines.SharedVendingMachineComponent;
@@ -34,7 +26,6 @@ namespace Content.Server.VendingMachines.systems
{
base.Initialize();
SubscribeLocalEvent<VendingMachineComponent, ComponentInit>(OnComponentInit);
SubscribeLocalEvent<VendingMachineComponent, ActivateInWorldEvent>(HandleActivate);
SubscribeLocalEvent<VendingMachineComponent, PowerChangedEvent>(OnPowerChanged);
SubscribeLocalEvent<VendingMachineComponent, InventorySyncRequestMessage>(OnInventoryRequestMessage);
SubscribeLocalEvent<VendingMachineComponent, VendingMachineEjectMessage>(OnInventoryEjectMessage);
@@ -72,30 +63,6 @@ namespace Content.Server.VendingMachines.systems
AuthorizedVend(uid, entity, args.ID, component);
}
private void HandleActivate(EntityUid uid, VendingMachineComponent component, ActivateInWorldEvent args)
{
if (!TryComp<ActorComponent>(args.User, out var actor))
{
return;
}
if (!IsPowered(uid, component))
{
return;
}
if (TryComp<WiresComponent>(uid, out var wires))
{
if (wires.IsPanelOpen)
{
wires.OpenInterface(actor.PlayerSession);
return;
}
}
component.UserInterface?.Toggle(actor.PlayerSession);
}
private void OnPowerChanged(EntityUid uid, VendingMachineComponent component, PowerChangedEvent args)
{
TryUpdateVisualState(uid, null, component);