From 01f75af3bdd5d217cecfb6fe960a2808a2c8d37a Mon Sep 17 00:00:00 2001 From: Vonsant Date: Fri, 8 Nov 2024 22:02:24 +0300 Subject: [PATCH] Delete HyperLink abuse --- .../Corvax/HyperLink/HyperLinkSystem.cs | 21 ------------- .../Corvax/HyperLink/HyperLinkComponent.cs | 11 ------- .../Corvax/HyperLink/HyperLinkSystem.cs | 30 ------------------- .../Corvax/HyperLink/SharedHyperLinkSystem.cs | 15 ---------- Resources/Maps/corvax_paper.yml | 4 --- runclient - Debug.bat | 2 ++ runserver - Debug.bat | 3 ++ 7 files changed, 5 insertions(+), 81 deletions(-) delete mode 100644 Content.Client/Corvax/HyperLink/HyperLinkSystem.cs delete mode 100644 Content.Server/Corvax/HyperLink/HyperLinkComponent.cs delete mode 100644 Content.Server/Corvax/HyperLink/HyperLinkSystem.cs delete mode 100644 Content.Shared/Corvax/HyperLink/SharedHyperLinkSystem.cs create mode 100644 runclient - Debug.bat create mode 100644 runserver - Debug.bat diff --git a/Content.Client/Corvax/HyperLink/HyperLinkSystem.cs b/Content.Client/Corvax/HyperLink/HyperLinkSystem.cs deleted file mode 100644 index 48e1fa4032b..00000000000 --- a/Content.Client/Corvax/HyperLink/HyperLinkSystem.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Inspired by Nyanotrasen - -using Content.Shared.HyperLink; -using Robust.Client.UserInterface; - -namespace Content.Client.HyperLink; - -public sealed class HyperLinkSystem : EntitySystem -{ - public override void Initialize() - { - base.Initialize(); - SubscribeNetworkEvent(OnOpenURL); - } - - private void OnOpenURL(OpenURLEvent args) - { - var uriOpener = IoCManager.Resolve(); - uriOpener.OpenUri(args.URL); - } -} \ No newline at end of file diff --git a/Content.Server/Corvax/HyperLink/HyperLinkComponent.cs b/Content.Server/Corvax/HyperLink/HyperLinkComponent.cs deleted file mode 100644 index 21e827dce69..00000000000 --- a/Content.Server/Corvax/HyperLink/HyperLinkComponent.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Inspired by Nyanotrasen - -namespace Content.Server.HyperLink; - -[RegisterComponent] -public sealed partial class HyperLinkComponent : Component -{ - [DataField("url")] - [ViewVariables(VVAccess.ReadWrite)] - public string URL = string.Empty; -} \ No newline at end of file diff --git a/Content.Server/Corvax/HyperLink/HyperLinkSystem.cs b/Content.Server/Corvax/HyperLink/HyperLinkSystem.cs deleted file mode 100644 index 6ef56d88a57..00000000000 --- a/Content.Server/Corvax/HyperLink/HyperLinkSystem.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Inspired by Nyanotrasen - -using Robust.Shared.Player; -using Content.Shared.Interaction; -using Content.Shared.HyperLink; - -namespace Content.Server.HyperLink; - -public sealed class HyperLinkSystem : EntitySystem -{ - public override void Initialize() - { - base.Initialize(); - SubscribeLocalEvent(OnActivate); - } - - private void OnActivate(EntityUid uid, HyperLinkComponent component, ActivateInWorldEvent args) - { - if (!TryComp(args.User, out var actor)) - return; - - OpenURL(actor.PlayerSession, component.URL); - } - - public void OpenURL(ICommonSession session, string url) - { - var ev = new OpenURLEvent(url); - RaiseNetworkEvent(ev, session.Channel); - } -} diff --git a/Content.Shared/Corvax/HyperLink/SharedHyperLinkSystem.cs b/Content.Shared/Corvax/HyperLink/SharedHyperLinkSystem.cs deleted file mode 100644 index 8c171cae59e..00000000000 --- a/Content.Shared/Corvax/HyperLink/SharedHyperLinkSystem.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Inspired by Nyanotrasen - -using Robust.Shared.Serialization; - -namespace Content.Shared.HyperLink; - -[Serializable, NetSerializable] -public sealed class OpenURLEvent : EntityEventArgs -{ - public string URL { get; } - public OpenURLEvent(string url) - { - URL = url; - } -} \ No newline at end of file diff --git a/Resources/Maps/corvax_paper.yml b/Resources/Maps/corvax_paper.yml index ae4d3e556c7..fb8de5942ac 100644 --- a/Resources/Maps/corvax_paper.yml +++ b/Resources/Maps/corvax_paper.yml @@ -25365,15 +25365,11 @@ entities: - type: Transform pos: 49.838795,21.556015 parent: 2 - - type: HyperLink - url: https://youtu.be/xvFZjo5PgG0 - uid: 22009 components: - type: Transform pos: 25.341877,25.460508 parent: 2 - - type: HyperLink - url: https://youtu.be/xvFZjo5PgG0 - proto: BookTemple entities: - uid: 1036 diff --git a/runclient - Debug.bat b/runclient - Debug.bat new file mode 100644 index 00000000000..96237c34411 --- /dev/null +++ b/runclient - Debug.bat @@ -0,0 +1,2 @@ +@echo off +dotnet run --project Content.Client diff --git a/runserver - Debug.bat b/runserver - Debug.bat new file mode 100644 index 00000000000..5c3f8acecdf --- /dev/null +++ b/runserver - Debug.bat @@ -0,0 +1,3 @@ +@echo off +dotnet run --project Content.Server +pause