* Station AI overlay * implement * Bunch of ports * Fix a heap of bugs and basic scouting * helldivers * Shuffle interactions a bit * navmap stuff * Revert "navmap stuff" This reverts commit d1f89dd4be83233e22cf5dd062b2581f3c6da062. * AI wires implemented * Fix examines * Optimise the overlay significantly * Back to old static * BUI radial working * lots of work * Saving work * thanks fork * alright * pc * AI upload console * AI upload * stuff * Fix copy-paste shitcode * AI actions * navmap work * Fixes * first impressions * a * reh * Revert "navmap work" This reverts commit 6f63fea6e9245e189f368f97be3e32e9b210580e. # Conflicts: # Content.Client/Silicons/StationAi/StationAiOverlay.cs * OD * radar * weh * Fix examines * scoop mine eyes * fixes * reh * Optimise * Final round of optimisations * Fixes * fixes
49 lines
1.5 KiB
C#
49 lines
1.5 KiB
C#
using Content.Shared.Emag.Systems;
|
|
using Content.Shared.Popups;
|
|
using Content.Shared.Silicons.Laws.Components;
|
|
using Content.Shared.Wires;
|
|
|
|
namespace Content.Shared.Silicons.Laws;
|
|
|
|
/// <summary>
|
|
/// This handles getting and displaying the laws for silicons.
|
|
/// </summary>
|
|
public abstract partial class SharedSiliconLawSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
|
|
|
/// <inheritdoc/>
|
|
public override void Initialize()
|
|
{
|
|
InitializeUpdater();
|
|
SubscribeLocalEvent<EmagSiliconLawComponent, GotEmaggedEvent>(OnGotEmagged);
|
|
SubscribeLocalEvent<EmagSiliconLawComponent, OnAttemptEmagEvent>(OnAttemptEmag);
|
|
}
|
|
|
|
protected virtual void OnAttemptEmag(EntityUid uid, EmagSiliconLawComponent component, ref OnAttemptEmagEvent args)
|
|
{
|
|
//prevent self emagging
|
|
if (uid == args.UserUid)
|
|
{
|
|
_popup.PopupClient(Loc.GetString("law-emag-cannot-emag-self"), uid, args.UserUid);
|
|
args.Handled = true;
|
|
return;
|
|
}
|
|
|
|
if (component.RequireOpenPanel &&
|
|
TryComp<WiresPanelComponent>(uid, out var panel) &&
|
|
!panel.Open)
|
|
{
|
|
_popup.PopupClient(Loc.GetString("law-emag-require-panel"), uid, args.UserUid);
|
|
args.Handled = true;
|
|
}
|
|
|
|
}
|
|
|
|
protected virtual void OnGotEmagged(EntityUid uid, EmagSiliconLawComponent component, ref GotEmaggedEvent args)
|
|
{
|
|
component.OwnerName = Name(args.UserUid);
|
|
args.Handled = true;
|
|
}
|
|
}
|