Skip to content

Commit

Permalink
Fix network configurator verbs and misc fixes (#16210)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangiebel authored May 7, 2023
1 parent d072cb6 commit 5c86778
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,22 +293,22 @@ private void OnAddInteractVerb(EntityUid uid, NetworkConfiguratorComponent confi
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>
Expand Down Expand Up @@ -356,9 +356,9 @@ private void OnAddSwitchModeVerb(EntityUid uid, NetworkConfiguratorComponent con

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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/DeviceLinking/sink_ports.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 5c86778

Please sign in to comment.