]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix network configurator verbs and misc fixes (#16210)
authorJulian Giebel <juliangiebel@live.de>
Sun, 7 May 2023 10:58:12 +0000 (12:58 +0200)
committerGitHub <noreply@github.com>
Sun, 7 May 2023 10:58:12 +0000 (20:58 +1000)
Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs
Content.Shared/DeviceNetwork/Components/NetworkConfiguratorComponent.cs
Resources/Prototypes/DeviceLinking/sink_ports.yml

index c6ef1bcbc71d7c28e84e1f49e4dfd3640e6fa2c7..dd29e8e2e33f398a97623b3722b41e68cc7124ef 100644 (file)
@@ -293,22 +293,22 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
             Impact = LogImpact.Low
         };
 
-        if (configurator.LinkModeActive)
+        if (configurator.LinkModeActive && (HasComp<DeviceLinkSinkComponent>(args.Target) || HasComp<DeviceLinkSourceComponent>(args.Target)))
         {
             var linkStarted = configurator.ActiveDeviceLink.HasValue;
             verb.Text = Loc.GetString(linkStarted ? "network-configurator-link" : "network-configurator-start-link");
             verb.Icon = new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/VerbIcons/in.svg.192dpi.png"));
+            args.Verbs.Add(verb);
         }
-        else if (!HasComp<DeviceNetworkComponent>(args.Target))
+        else if (HasComp<DeviceNetworkComponent>(args.Target))
         {
             var isDeviceList = HasComp<DeviceListComponent>(args.Target);
             verb.Text = Loc.GetString(isDeviceList ? "network-configurator-configure" : "network-configurator-save-device");
             verb.Icon = isDeviceList
                 ? new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/VerbIcons/settings.svg.192dpi.png"))
                 : new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/VerbIcons/in.svg.192dpi.png"));
+            args.Verbs.Add(verb);
         }
-
-        args.Verbs.Add(verb);
     }
 
     /// <summary>
@@ -356,9 +356,9 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
 
         AlternativeVerb verb = new()
         {
-            Text = Loc.GetString("network-configurator-save-device"),
-            Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/in.svg.192dpi.png")),
-            Act = () => TryAddNetworkDevice(args.Target, args.Using.Value, args.User),
+            Text = Loc.GetString("network-configurator-switch-mode"),
+            Icon = new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/VerbIcons/settings.svg.192dpi.png")),
+            Act = () => SwitchMode(args.User, args.Target, configurator),
             Impact = LogImpact.Low
         };
         args.Verbs.Add(verb);
index 761cde436c307670a0d6307d723415fdeb862ab0..128c328f289def9c8fb2aef75d1211407ad0cd76 100644 (file)
@@ -17,7 +17,7 @@ public sealed class NetworkConfiguratorComponent : Component
     /// </summary>
     [DataField("linkModeActive")]
     [ViewVariables(VVAccess.ReadWrite)]
-    public bool LinkModeActive = false;
+    public bool LinkModeActive = true;
 
     /// <summary>
     /// The entity containing a <see cref="DeviceListComponent"/> this configurator is currently interacting with
index 37817eddaa15c7f0a6d94420b96c5746a00e0dcc..fbe809c6c334167ea1f9ea51e9c60dfea14e93df 100644 (file)
@@ -1,7 +1,7 @@
 - type: sinkPort
   id: AutoClose
-  name: signal-port-name-autoclose
-  description: signal-port-description-autoclose
+  name: signal-port-name-hold-open
+  description: signal-port-description-hold-open
 
 - type: sinkPort
   id: Toggle