From 307e642a6d11d636009c31e2788db78f5554244d Mon Sep 17 00:00:00 2001 From: mirrorcult Date: Fri, 11 Feb 2022 19:01:37 -0700 Subject: [PATCH] Admin freeze (#6668) --- .../Administration/AdminVerbSystem.cs | 21 ++++++++++ .../Administration/AdminFrozenComponent.cs | 9 ++++ .../Administration/AdminFrozenSystem.cs | 21 ++++++++++ .../en-US/administration/admin-verbs.ftl | 2 + .../Textures/Interface/VerbIcons/snow.svg | 39 ++++++++++++++++++ .../Interface/VerbIcons/snow.svg.192dpi.png | Bin 0 -> 3194 bytes .../VerbIcons/snow.svg.192dpi.png.yml | 2 + 7 files changed, 94 insertions(+) create mode 100644 Content.Shared/Administration/AdminFrozenComponent.cs create mode 100644 Content.Shared/Administration/AdminFrozenSystem.cs create mode 100644 Resources/Textures/Interface/VerbIcons/snow.svg create mode 100644 Resources/Textures/Interface/VerbIcons/snow.svg.192dpi.png create mode 100644 Resources/Textures/Interface/VerbIcons/snow.svg.192dpi.png.yml diff --git a/Content.Server/Administration/AdminVerbSystem.cs b/Content.Server/Administration/AdminVerbSystem.cs index e30b8d4b0d..da6b7fd169 100644 --- a/Content.Server/Administration/AdminVerbSystem.cs +++ b/Content.Server/Administration/AdminVerbSystem.cs @@ -20,6 +20,7 @@ using Content.Shared.Database; using Content.Shared.GameTicking; using Content.Shared.Interaction.Helpers; using Content.Shared.Inventory; +using Content.Shared.Movement.Components; using Content.Shared.Popups; using Content.Shared.Verbs; using Robust.Server.Console; @@ -77,6 +78,26 @@ namespace Content.Server.Administration _console.RemoteExecuteCommand(player, $"openahelp \"{targetActor.PlayerSession.UserId}\""); verb.Impact = LogImpact.Low; args.Verbs.Add(verb); + + // Freeze + var frozen = HasComp(args.Target); + args.Verbs.Add(new Verb + { + Priority = -1, // This is just so it doesn't change position in the menu between freeze/unfreeze. + Text = frozen + ? Loc.GetString("admin-verbs-unfreeze") + : Loc.GetString("admin-verbs-freeze"), + Category = VerbCategory.Admin, + IconTexture = "/Textures/Interface/VerbIcons/snow.svg.192dpi.png", + Act = () => + { + if (frozen) + RemComp(args.Target); + else + EnsureComp(args.Target); + }, + Impact = LogImpact.Medium, + }); } // TeleportTo diff --git a/Content.Shared/Administration/AdminFrozenComponent.cs b/Content.Shared/Administration/AdminFrozenComponent.cs new file mode 100644 index 0000000000..591e2a83d2 --- /dev/null +++ b/Content.Shared/Administration/AdminFrozenComponent.cs @@ -0,0 +1,9 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.Administration; + +[RegisterComponent, Friend(typeof(AdminFrozenSystem))] +[NetworkedComponent] +public sealed class AdminFrozenComponent : Component +{ +} diff --git a/Content.Shared/Administration/AdminFrozenSystem.cs b/Content.Shared/Administration/AdminFrozenSystem.cs new file mode 100644 index 0000000000..68aad166d3 --- /dev/null +++ b/Content.Shared/Administration/AdminFrozenSystem.cs @@ -0,0 +1,21 @@ +using Content.Shared.Interaction.Events; +using Content.Shared.Item; +using Content.Shared.Movement; +using Content.Shared.Throwing; + +namespace Content.Shared.Administration; + +public sealed class AdminFrozenSystem : EntitySystem +{ + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent((_, _, args) => args.Cancel()); + SubscribeLocalEvent((_, _, args) => args.Cancel()); + SubscribeLocalEvent((_, _, args) => args.Cancel()); + SubscribeLocalEvent((_, _, args) => args.Cancel()); + SubscribeLocalEvent((_, _, args) => args.Cancel()); + SubscribeLocalEvent((_, _, args) => args.Cancel()); + } +} diff --git a/Resources/Locale/en-US/administration/admin-verbs.ftl b/Resources/Locale/en-US/administration/admin-verbs.ftl index 1a12ad2f44..5bd9845e42 100644 --- a/Resources/Locale/en-US/administration/admin-verbs.ftl +++ b/Resources/Locale/en-US/administration/admin-verbs.ftl @@ -4,3 +4,5 @@ explode-verb-get-data-text = Explode ahelp-verb-get-data-text = Message admin-verbs-teleport-to = Teleport To admin-verbs-teleport-here = Teleport Here +admin-verbs-freeze = Freeze +admin-verbs-unfreeze = Unfreeze diff --git a/Resources/Textures/Interface/VerbIcons/snow.svg b/Resources/Textures/Interface/VerbIcons/snow.svg new file mode 100644 index 0000000000..b62d2ebe2b --- /dev/null +++ b/Resources/Textures/Interface/VerbIcons/snow.svg @@ -0,0 +1,39 @@ + + + + + + + diff --git a/Resources/Textures/Interface/VerbIcons/snow.svg.192dpi.png b/Resources/Textures/Interface/VerbIcons/snow.svg.192dpi.png new file mode 100644 index 0000000000000000000000000000000000000000..8d877261daa15b0d986543e230e8ae0f349cf5f4 GIT binary patch literal 3194 zcmV-=42AQFP) zK~!jg?VEd0Q&%3x55!kx?K;@1b=Rg;w{}-|>n_VM>yBMUM`ojf+iCAArLa)aYDEx5 zK{gOccqABtV4wvo*hmGel$Qz;iG)W&ges9J$YW@bw-`tOQxcM#{X^q~dvo)k7`vT* z{^Q)=`JLbQ-kjI(900Hr;o;$~d_I4qy1IJk`0?X^u~)lxfz4*K<#M?mK1D8<>)C8J z`$fk!Z&XxN^g$Grm6d(=Xxq^qjl4*H5%~X(T?9HfI5?Opwny9ZD$v!{bs>#LqXz^8 zte(|~Beod=fiUZD1VNlnpFW)#7#R5Ke8x0y#K*@UymRM{3PK3``}=hq4(BTbK^6f3 z!1e3b`_ZH5_3PIM006+l!(%~eYHGGjCeuO)VP|KjCN3^6_{FL*K|@1>0xhDowN=Gr zG9#+1s|V1}_ zg*u&1hgZSL$;qlR1LNc4dH?`K6+4nhq~BT>;vDez_g_&^P;g73P{6#ryaqCvyvq3b z!Gj0afAh^ZchqV%?w7HIMx%j6MMcu!;NZ6men}+K;%_Gc&VfVqyX# zY+_;pW@l#?`}z6dcSaio`uqF8o|BU!92*;h5I&i1m`vt>fl8&qG%l0Lw26s{xxi=; zYHn`E2;9GaKkgSarnR*d(}+|meQZr#Qvz?_zWuCjKtRCqoSdApk&zKS+73bp7ob-Z z002NF5(!aJQGwgHZ~x%x)vFOrn5{W6>w{QP! z?b@{qaE*03ohjkZ&}y~t%9Se}Jv}`$=w}fT5gX9{$YioBx=bpSTKs|}5@|7&Nz*z&^yfox2tg5U~8w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zw^}8RI0h){QUf!GBYzv@eV*UGc$|5yu6m0^Wp01x(;1eBofU!0QKBHFgDu5Qw%;H@DdB4SNxX{l7F)4{uU?@rU{^jSOg6DLl*Sz20p zTcertLI$eUYFJoUcn@_n?vS3Ie#$UM3j~7kW5e+S387FpZ&$g5LgDy)#r0h8i{86;Z<Z^GuTzppq{SQ#C(m$f*4^Db!)CKF6aG(v zjT<*Eij9q>`}p|G%A#Gnb`5jup2y?$8{6#Lw{H!NMoV;cb+v7H|0z&eS^4w+w*m;U z%RCcB&xIFu>;7ji&|dr^a6ahl>@0bD4;uggfI^{wot>Q}_GsH~L`6lp-?(vOgvaAO gJb3Wn7JIe(KY|w}48P27Jpcdz07*qoM6N<$f&#(?@c;k- literal 0 HcmV?d00001 diff --git a/Resources/Textures/Interface/VerbIcons/snow.svg.192dpi.png.yml b/Resources/Textures/Interface/VerbIcons/snow.svg.192dpi.png.yml new file mode 100644 index 0000000000..5c43e23305 --- /dev/null +++ b/Resources/Textures/Interface/VerbIcons/snow.svg.192dpi.png.yml @@ -0,0 +1,2 @@ +sample: + filter: true