mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-29 23:57:29 +00:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
414be58480 | ||
|
|
36ee8429c5 | ||
|
|
eaa5cfec1f | ||
|
|
1b4e3dc602 | ||
|
|
368918d46a | ||
|
|
04efdf82f6 | ||
|
|
ac50abeab8 | ||
|
|
c9dbb1c9a1 |
@@ -21,8 +21,11 @@ public sealed class SignalTimerBoundUserInterface : BoundUserInterface
|
|||||||
_window = this.CreateWindow<SignalTimerWindow>();
|
_window = this.CreateWindow<SignalTimerWindow>();
|
||||||
_window.OnStartTimer += StartTimer;
|
_window.OnStartTimer += StartTimer;
|
||||||
_window.OnCurrentTextChanged += OnTextChanged;
|
_window.OnCurrentTextChanged += OnTextChanged;
|
||||||
_window.OnCurrentDelayMinutesChanged += OnDelayChanged;
|
// Begin Monolith
|
||||||
_window.OnCurrentDelaySecondsChanged += OnDelayChanged;
|
// _window.OnCurrentDelayMinutesChanged += OnDelayChanged;
|
||||||
|
// _window.OnCurrentDelaySecondsChanged += OnDelayChanged;
|
||||||
|
_window.OnCurrentDelayChanged += OnDelayChanged;
|
||||||
|
// End Monolith
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StartTimer()
|
public void StartTimer()
|
||||||
@@ -35,11 +38,11 @@ public sealed class SignalTimerBoundUserInterface : BoundUserInterface
|
|||||||
SendMessage(new SignalTimerTextChangedMessage(newText));
|
SendMessage(new SignalTimerTextChangedMessage(newText));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDelayChanged(string newDelay)
|
private void OnDelayChanged(TimeSpan newDelay) // Monolith - Change from string to TimeSpan
|
||||||
{
|
{
|
||||||
if (_window == null)
|
if (_window == null)
|
||||||
return;
|
return;
|
||||||
SendMessage(new SignalTimerDelayChangedMessage(_window.GetDelay()));
|
SendMessage(new SignalTimerDelayChangedMessage(newDelay)); // Mono
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -54,8 +57,11 @@ public sealed class SignalTimerBoundUserInterface : BoundUserInterface
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
_window.SetCurrentText(cast.CurrentText);
|
_window.SetCurrentText(cast.CurrentText);
|
||||||
_window.SetCurrentDelayMinutes(cast.CurrentDelayMinutes);
|
// Begin Monolith
|
||||||
_window.SetCurrentDelaySeconds(cast.CurrentDelaySeconds);
|
// _window.SetCurrentDelayMinutes(cast.CurrentDelayMinutes);
|
||||||
|
// _window.SetCurrentDelaySeconds(cast.CurrentDelaySeconds);
|
||||||
|
_window.SetCurrentDelay(cast.CurrentDelay);
|
||||||
|
// End Monolith
|
||||||
_window.SetShowText(cast.ShowText);
|
_window.SetShowText(cast.ShowText);
|
||||||
_window.SetTriggerTime(cast.TriggerTime);
|
_window.SetTriggerTime(cast.TriggerTime);
|
||||||
_window.SetTimerStarted(cast.TimerStarted);
|
_window.SetTimerStarted(cast.TimerStarted);
|
||||||
|
|||||||
@@ -7,10 +7,14 @@
|
|||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
<BoxContainer Name="DelayEdit" Orientation="Horizontal">
|
<BoxContainer Name="DelayEdit" Orientation="Horizontal">
|
||||||
<Label Name="CurrentDelay" Text="{Loc signal-timer-menu-delay}" />
|
<Label Name="CurrentDelay" Text="{Loc signal-timer-menu-delay}" />
|
||||||
|
<!-- Mono: Changed from integer MM:SS to float seconds
|
||||||
<LineEdit Name="CurrentDelayEditMinutes" MinWidth="32" />
|
<LineEdit Name="CurrentDelayEditMinutes" MinWidth="32" />
|
||||||
<Label Name="Colon" Text=":" />
|
<Label Name="Colon" Text=":" />
|
||||||
<LineEdit Name="CurrentDelayEditSeconds" MinWidth="32" />
|
<LineEdit Name="CurrentDelayEditSeconds" MinWidth="32" />
|
||||||
<Label Name="DelayInfo" Text=" (mm:ss)" />
|
<Label Name="DelayInfo" Text=" (mm:ss)" />
|
||||||
|
-->
|
||||||
|
<FloatSpinBox Name="CurrentDelayEdit" MinWidth="32" />
|
||||||
|
<Label Text="s" />
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
<Button Name="StartTimer" Text="{Loc signal-timer-menu-start}" />
|
<Button Name="StartTimer" Text="{Loc signal-timer-menu-start}" />
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
|
|||||||
@@ -15,8 +15,11 @@ public sealed partial class SignalTimerWindow : DefaultWindow
|
|||||||
private const int MaxTextLength = 5;
|
private const int MaxTextLength = 5;
|
||||||
|
|
||||||
public event Action<string>? OnCurrentTextChanged;
|
public event Action<string>? OnCurrentTextChanged;
|
||||||
public event Action<string>? OnCurrentDelayMinutesChanged;
|
// Begin Monolith
|
||||||
public event Action<string>? OnCurrentDelaySecondsChanged;
|
// public event Action<string>? OnCurrentDelayMinutesChanged;
|
||||||
|
// public event Action<string>? OnCurrentDelaySecondsChanged;
|
||||||
|
public event Action<TimeSpan>? OnCurrentDelayChanged;
|
||||||
|
// End Monolith
|
||||||
|
|
||||||
private TimeSpan? _triggerTime;
|
private TimeSpan? _triggerTime;
|
||||||
|
|
||||||
@@ -30,8 +33,11 @@ public sealed partial class SignalTimerWindow : DefaultWindow
|
|||||||
IoCManager.InjectDependencies(this);
|
IoCManager.InjectDependencies(this);
|
||||||
|
|
||||||
CurrentTextEdit.OnTextChanged += e => OnCurrentTextChange(e.Text);
|
CurrentTextEdit.OnTextChanged += e => OnCurrentTextChange(e.Text);
|
||||||
CurrentDelayEditMinutes.OnTextChanged += e => OnCurrentDelayMinutesChange(e.Text);
|
// Begin Monolith
|
||||||
CurrentDelayEditSeconds.OnTextChanged += e => OnCurrentDelaySecondsChange(e.Text);
|
// CurrentDelayEditMinutes.OnTextChanged += e => OnCurrentDelayMinutesChange(e.Text);
|
||||||
|
// CurrentDelayEditSeconds.OnTextChanged += e => OnCurrentDelaySecondsChange(e.Text);
|
||||||
|
CurrentDelayEdit.OnValueChanged += e => CurrentDelayChange(TimeSpan.FromSeconds(e.Value));
|
||||||
|
// End Monolith
|
||||||
StartTimer.OnPressed += _ => StartTimerWeh();
|
StartTimer.OnPressed += _ => StartTimerWeh();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,81 +83,93 @@ public sealed partial class SignalTimerWindow : DefaultWindow
|
|||||||
OnCurrentTextChanged?.Invoke(text);
|
OnCurrentTextChanged?.Invoke(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnCurrentDelayMinutesChange(string text)
|
// Begin Monolith
|
||||||
|
// public void OnCurrentDelayMinutesChange(string text)
|
||||||
|
// {
|
||||||
|
// List<char> toRemove = new();
|
||||||
|
|
||||||
|
// foreach (var a in text)
|
||||||
|
// {
|
||||||
|
// if (!char.IsDigit(a))
|
||||||
|
// toRemove.Add(a);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// foreach (var a in toRemove)
|
||||||
|
// {
|
||||||
|
// CurrentDelayEditMinutes.Text = text.Replace(a.ToString(),"");
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (CurrentDelayEditMinutes.Text == "")
|
||||||
|
// return;
|
||||||
|
|
||||||
|
// while (CurrentDelayEditMinutes.Text[0] == '0' && CurrentDelayEditMinutes.Text.Length > 2)
|
||||||
|
// {
|
||||||
|
// CurrentDelayEditMinutes.Text = CurrentDelayEditMinutes.Text.Remove(0, 1);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (CurrentDelayEditMinutes.Text.Length > 2)
|
||||||
|
// {
|
||||||
|
// CurrentDelayEditMinutes.Text = CurrentDelayEditMinutes.Text.Remove(2);
|
||||||
|
// }
|
||||||
|
// OnCurrentDelayMinutesChanged?.Invoke(CurrentDelayEditMinutes.Text);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public void OnCurrentDelaySecondsChange(string text)
|
||||||
|
// {
|
||||||
|
// List<char> toRemove = new();
|
||||||
|
|
||||||
|
// foreach (var a in text)
|
||||||
|
// {
|
||||||
|
// if (!char.IsDigit(a))
|
||||||
|
// toRemove.Add(a);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// foreach (var a in toRemove)
|
||||||
|
// {
|
||||||
|
// CurrentDelayEditSeconds.Text = text.Replace(a.ToString(), "");
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (CurrentDelayEditSeconds.Text == "")
|
||||||
|
// return;
|
||||||
|
|
||||||
|
// while (CurrentDelayEditSeconds.Text[0] == '0' && CurrentDelayEditSeconds.Text.Length > 2)
|
||||||
|
// {
|
||||||
|
// CurrentDelayEditSeconds.Text = CurrentDelayEditSeconds.Text.Remove(0, 1);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (CurrentDelayEditSeconds.Text.Length > 2)
|
||||||
|
// {
|
||||||
|
// CurrentDelayEditSeconds.Text = CurrentDelayEditSeconds.Text.Remove(2);
|
||||||
|
// }
|
||||||
|
// OnCurrentDelaySecondsChanged?.Invoke(CurrentDelayEditSeconds.Text);
|
||||||
|
// }
|
||||||
|
|
||||||
|
public void CurrentDelayChange(TimeSpan newValue)
|
||||||
{
|
{
|
||||||
List<char> toRemove = new();
|
OnCurrentDelayChanged?.Invoke(newValue);
|
||||||
|
|
||||||
foreach (var a in text)
|
|
||||||
{
|
|
||||||
if (!char.IsDigit(a))
|
|
||||||
toRemove.Add(a);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var a in toRemove)
|
|
||||||
{
|
|
||||||
CurrentDelayEditMinutes.Text = text.Replace(a.ToString(),"");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CurrentDelayEditMinutes.Text == "")
|
|
||||||
return;
|
|
||||||
|
|
||||||
while (CurrentDelayEditMinutes.Text[0] == '0' && CurrentDelayEditMinutes.Text.Length > 2)
|
|
||||||
{
|
|
||||||
CurrentDelayEditMinutes.Text = CurrentDelayEditMinutes.Text.Remove(0, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CurrentDelayEditMinutes.Text.Length > 2)
|
|
||||||
{
|
|
||||||
CurrentDelayEditMinutes.Text = CurrentDelayEditMinutes.Text.Remove(2);
|
|
||||||
}
|
|
||||||
OnCurrentDelayMinutesChanged?.Invoke(CurrentDelayEditMinutes.Text);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnCurrentDelaySecondsChange(string text)
|
|
||||||
{
|
|
||||||
List<char> toRemove = new();
|
|
||||||
|
|
||||||
foreach (var a in text)
|
|
||||||
{
|
|
||||||
if (!char.IsDigit(a))
|
|
||||||
toRemove.Add(a);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var a in toRemove)
|
|
||||||
{
|
|
||||||
CurrentDelayEditSeconds.Text = text.Replace(a.ToString(), "");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CurrentDelayEditSeconds.Text == "")
|
|
||||||
return;
|
|
||||||
|
|
||||||
while (CurrentDelayEditSeconds.Text[0] == '0' && CurrentDelayEditSeconds.Text.Length > 2)
|
|
||||||
{
|
|
||||||
CurrentDelayEditSeconds.Text = CurrentDelayEditSeconds.Text.Remove(0, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CurrentDelayEditSeconds.Text.Length > 2)
|
|
||||||
{
|
|
||||||
CurrentDelayEditSeconds.Text = CurrentDelayEditSeconds.Text.Remove(2);
|
|
||||||
}
|
|
||||||
OnCurrentDelaySecondsChanged?.Invoke(CurrentDelayEditSeconds.Text);
|
|
||||||
}
|
}
|
||||||
|
// End Monolith
|
||||||
|
|
||||||
public void SetCurrentText(string text)
|
public void SetCurrentText(string text)
|
||||||
{
|
{
|
||||||
CurrentTextEdit.Text = text;
|
CurrentTextEdit.Text = text;
|
||||||
}
|
}
|
||||||
|
// Begin Monolith
|
||||||
|
// public void SetCurrentDelayMinutes(string delay)
|
||||||
|
// {
|
||||||
|
// CurrentDelayEditMinutes.Text = delay;
|
||||||
|
// }
|
||||||
|
|
||||||
public void SetCurrentDelayMinutes(string delay)
|
// public void SetCurrentDelaySeconds(string delay)
|
||||||
|
// {
|
||||||
|
// CurrentDelayEditSeconds.Text = delay;
|
||||||
|
// }
|
||||||
|
|
||||||
|
public void SetCurrentDelay(TimeSpan delay)
|
||||||
{
|
{
|
||||||
CurrentDelayEditMinutes.Text = delay;
|
CurrentDelayEdit.Value = (float)delay.TotalSeconds;
|
||||||
}
|
}
|
||||||
|
// End Monolith
|
||||||
public void SetCurrentDelaySeconds(string delay)
|
|
||||||
{
|
|
||||||
CurrentDelayEditSeconds.Text = delay;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetShowText(bool showTime)
|
public void SetShowText(bool showTime)
|
||||||
{
|
{
|
||||||
TextEdit.Visible = showTime;
|
TextEdit.Visible = showTime;
|
||||||
@@ -176,8 +194,10 @@ public sealed partial class SignalTimerWindow : DefaultWindow
|
|||||||
public void SetHasAccess(bool hasAccess)
|
public void SetHasAccess(bool hasAccess)
|
||||||
{
|
{
|
||||||
CurrentTextEdit.Editable = hasAccess;
|
CurrentTextEdit.Editable = hasAccess;
|
||||||
CurrentDelayEditMinutes.Editable = hasAccess;
|
// Begin Monolith
|
||||||
CurrentDelayEditSeconds.Editable = hasAccess;
|
// CurrentDelayEditMinutes.Editable = hasAccess;
|
||||||
|
// CurrentDelayEditSeconds.Editable = hasAccess;
|
||||||
|
// End Monolith
|
||||||
StartTimer.Disabled = !hasAccess;
|
StartTimer.Disabled = !hasAccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,10 +206,13 @@ public sealed partial class SignalTimerWindow : DefaultWindow
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public TimeSpan GetDelay()
|
public TimeSpan GetDelay()
|
||||||
{
|
{
|
||||||
if (!double.TryParse(CurrentDelayEditMinutes.Text, out var minutes))
|
// Begin Monolith
|
||||||
minutes = 0;
|
// if (!double.TryParse(CurrentDelayEditMinutes.Text, out var minutes))
|
||||||
if (!double.TryParse(CurrentDelayEditSeconds.Text, out var seconds))
|
// minutes = 0;
|
||||||
seconds = 0;
|
// if (!double.TryParse(CurrentDelayEditSeconds.Text, out var seconds))
|
||||||
return TimeSpan.FromMinutes(minutes) + TimeSpan.FromSeconds(seconds);
|
// seconds = 0;
|
||||||
|
// return TimeSpan.FromMinutes(minutes) + TimeSpan.FromSeconds(seconds);
|
||||||
|
return TimeSpan.FromSeconds(CurrentDelayEdit.Value);
|
||||||
|
// End Monolith
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,8 +51,11 @@ public sealed class SignalTimerSystem : EntitySystem
|
|||||||
if (_ui.HasUi(uid, SignalTimerUiKey.Key))
|
if (_ui.HasUi(uid, SignalTimerUiKey.Key))
|
||||||
{
|
{
|
||||||
_ui.SetUiState(uid, SignalTimerUiKey.Key, new SignalTimerBoundUserInterfaceState(component.Label,
|
_ui.SetUiState(uid, SignalTimerUiKey.Key, new SignalTimerBoundUserInterfaceState(component.Label,
|
||||||
TimeSpan.FromSeconds(component.Delay).Minutes.ToString("D2"),
|
// Begin Monolith
|
||||||
TimeSpan.FromSeconds(component.Delay).Seconds.ToString("D2"),
|
// TimeSpan.FromSeconds(component.Delay).Minutes.ToString("D2"),
|
||||||
|
// TimeSpan.FromSeconds(component.Delay).Seconds.ToString("D2"),
|
||||||
|
TimeSpan.FromSeconds(component.Delay),
|
||||||
|
// End Monolith
|
||||||
component.CanEditLabel,
|
component.CanEditLabel,
|
||||||
time,
|
time,
|
||||||
active != null,
|
active != null,
|
||||||
@@ -73,8 +76,11 @@ public sealed class SignalTimerSystem : EntitySystem
|
|||||||
if (_ui.HasUi(uid, SignalTimerUiKey.Key))
|
if (_ui.HasUi(uid, SignalTimerUiKey.Key))
|
||||||
{
|
{
|
||||||
_ui.SetUiState(uid, SignalTimerUiKey.Key, new SignalTimerBoundUserInterfaceState(signalTimer.Label,
|
_ui.SetUiState(uid, SignalTimerUiKey.Key, new SignalTimerBoundUserInterfaceState(signalTimer.Label,
|
||||||
TimeSpan.FromSeconds(signalTimer.Delay).Minutes.ToString("D2"),
|
// Begin Monolith
|
||||||
TimeSpan.FromSeconds(signalTimer.Delay).Seconds.ToString("D2"),
|
// TimeSpan.FromSeconds(signalTimer.Delay).Minutes.ToString("D2"),
|
||||||
|
// TimeSpan.FromSeconds(signalTimer.Delay).Seconds.ToString("D2"),
|
||||||
|
TimeSpan.FromSeconds(signalTimer.Delay),
|
||||||
|
// End Monolith
|
||||||
signalTimer.CanEditLabel,
|
signalTimer.CanEditLabel,
|
||||||
TimeSpan.Zero,
|
TimeSpan.Zero,
|
||||||
false,
|
false,
|
||||||
|
|||||||
@@ -33,33 +33,37 @@ public sealed class InteractorSystem : SharedInteractorSystem
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var i = count - 1;
|
// Mono
|
||||||
var netEnt = ent.Comp.TargetEntities[i].Item1;
|
for (var i = count - 1; i >= 0; i--)
|
||||||
var target = GetEntity(netEnt);
|
|
||||||
_constructionQuery.TryComp(target, out var construction);
|
|
||||||
var originalCount = construction?.InteractionQueue?.Count ?? 0;
|
|
||||||
if (!InteractWith(ent, target))
|
|
||||||
{
|
{
|
||||||
// have to remove it since user's filter was bad due to unhandled interaction
|
var netEnt = ent.Comp.TargetEntities[i].Item1;
|
||||||
RemoveTarget(ent, target);
|
var target = GetEntity(netEnt);
|
||||||
Machine.Failed(ent.Owner);
|
_constructionQuery.TryComp(target, out var construction);
|
||||||
return;
|
var originalCount = construction?.InteractionQueue?.Count ?? 0;
|
||||||
}
|
if (!InteractWith(ent, target))
|
||||||
|
{
|
||||||
|
// have to remove it since user's filter was bad due to unhandled interaction
|
||||||
|
// RemoveTarget(ent, target); // Mono
|
||||||
|
Machine.Failed(ent.Owner);
|
||||||
|
continue; // Mono
|
||||||
|
}
|
||||||
|
|
||||||
// construction supercode queues it instead of starting a doafter now, assume that queuing means it has started
|
// construction supercode queues it instead of starting a doafter now, assume that queuing means it has started
|
||||||
var newCount = construction?.InteractionQueue?.Count ?? 0;
|
var newCount = construction?.InteractionQueue?.Count ?? 0;
|
||||||
if (newCount > originalCount
|
if (newCount > originalCount
|
||||||
|| HasDoAfter(ent))
|
|| HasDoAfter(ent))
|
||||||
{
|
{
|
||||||
Machine.Started(ent.Owner);
|
Machine.Started(ent.Owner);
|
||||||
UpdateAppearance(ent, InteractorState.Active);
|
UpdateAppearance(ent, InteractorState.Active);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// no doafter, complete it immediately
|
// no doafter, complete it immediately
|
||||||
TryRemoveTarget(ent, target);
|
TryRemoveTarget(ent, target);
|
||||||
Machine.Completed(ent.Owner);
|
Machine.Completed(ent.Owner);
|
||||||
UpdateAppearance(ent);
|
UpdateAppearance(ent);
|
||||||
|
}
|
||||||
|
break; // Mono
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using Content.Shared.DeviceLinking;
|
||||||
|
using Content.Shared.Research.Prototypes;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
|
namespace Content.Server._Goobstation.Lathe;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Lets a lathe produce the last made recipe, controlled by signal port.
|
||||||
|
/// The port must be added by something else e.g. AutomationSlots
|
||||||
|
/// </summary>
|
||||||
|
[RegisterComponent, Access(typeof(LatheAutomationSystem))]
|
||||||
|
public sealed partial class LatheAutomationComponent : Component
|
||||||
|
{
|
||||||
|
[ViewVariables]
|
||||||
|
public LatheRecipePrototype? LastRecipe;
|
||||||
|
|
||||||
|
[DataField]
|
||||||
|
public ProtoId<SinkPortPrototype> PrintPort = "LathePrint";
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
using Content.Shared._Goobstation.Factory;
|
||||||
|
using Content.Server.Lathe;
|
||||||
|
using Content.Shared.DeviceLinking.Events;
|
||||||
|
using Content.Shared.Lathe;
|
||||||
|
|
||||||
|
namespace Content.Server._Goobstation.Lathe;
|
||||||
|
|
||||||
|
public sealed class LatheAutomationSystem : EntitySystem
|
||||||
|
{
|
||||||
|
[Dependency] private readonly AutomationSystem _automation = default!;
|
||||||
|
[Dependency] private readonly LatheSystem _lathe = default!;
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
SubscribeLocalEvent<LatheAutomationComponent, LatheStartPrintingEvent>(OnStartPrinting);
|
||||||
|
SubscribeLocalEvent<LatheAutomationComponent, SignalReceivedEvent>(OnSignalReceived);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnStartPrinting(Entity<LatheAutomationComponent> ent, ref LatheStartPrintingEvent args)
|
||||||
|
{
|
||||||
|
ent.Comp.LastRecipe = args.Recipe;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnSignalReceived(Entity<LatheAutomationComponent> ent, ref SignalReceivedEvent args)
|
||||||
|
{
|
||||||
|
if (!_automation.IsAutomated(ent))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (args.Port != ent.Comp.PrintPort)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (ent.Comp.LastRecipe is not {} recipe)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_lathe.TryAddToQueue(ent.Owner, recipe, 1);
|
||||||
|
_lathe.TryStartProducing(ent.Owner); // Won't do anything otherwise
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,24 +15,33 @@ public enum SignalTimerUiKey : byte
|
|||||||
public sealed class SignalTimerBoundUserInterfaceState : BoundUserInterfaceState
|
public sealed class SignalTimerBoundUserInterfaceState : BoundUserInterfaceState
|
||||||
{
|
{
|
||||||
public string CurrentText;
|
public string CurrentText;
|
||||||
public string CurrentDelayMinutes;
|
// Begin Monolith
|
||||||
public string CurrentDelaySeconds;
|
// public string CurrentDelayMinutes;
|
||||||
|
// public string CurrentDelaySeconds;
|
||||||
|
public TimeSpan CurrentDelay;
|
||||||
|
// End Monolith
|
||||||
public bool ShowText;
|
public bool ShowText;
|
||||||
public TimeSpan TriggerTime;
|
public TimeSpan TriggerTime;
|
||||||
public bool TimerStarted;
|
public bool TimerStarted;
|
||||||
public bool HasAccess;
|
public bool HasAccess;
|
||||||
|
|
||||||
public SignalTimerBoundUserInterfaceState(string currentText,
|
public SignalTimerBoundUserInterfaceState(string currentText,
|
||||||
string currentDelayMinutes,
|
// Begin Monolith
|
||||||
string currentDelaySeconds,
|
// string currentDelayMinutes,
|
||||||
|
// string currentDelaySeconds,
|
||||||
|
TimeSpan currentDelay,
|
||||||
|
// End Monolith
|
||||||
bool showText,
|
bool showText,
|
||||||
TimeSpan triggerTime,
|
TimeSpan triggerTime,
|
||||||
bool timerStarted,
|
bool timerStarted,
|
||||||
bool hasAccess)
|
bool hasAccess)
|
||||||
{
|
{
|
||||||
CurrentText = currentText;
|
CurrentText = currentText;
|
||||||
CurrentDelayMinutes = currentDelayMinutes;
|
// Begin Monolith
|
||||||
CurrentDelaySeconds = currentDelaySeconds;
|
// CurrentDelayMinutes = currentDelayMinutes;
|
||||||
|
// CurrentDelaySeconds = currentDelaySeconds;
|
||||||
|
CurrentDelay = currentDelay;
|
||||||
|
// End Monolith
|
||||||
ShowText = showText;
|
ShowText = showText;
|
||||||
TriggerTime = triggerTime;
|
TriggerTime = triggerTime;
|
||||||
TimerStarted = timerStarted;
|
TimerStarted = timerStarted;
|
||||||
|
|||||||
@@ -126,10 +126,7 @@ public sealed class AutomationSystem : EntitySystem
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsAutomated(EntityUid uid)
|
public bool IsAutomated(EntityUid uid) => _automatedQuery.HasComp(uid);
|
||||||
{
|
|
||||||
return _automatedQuery.HasComp(uid);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool HasSlot(Entity<AutomationSlotsComponent?> ent, string port, bool input)
|
public bool HasSlot(Entity<AutomationSlotsComponent?> ent, string port, bool input)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -100,3 +100,7 @@ signal-port-description-rad-low = Signal port set to HIGH if the tank is below 6
|
|||||||
|
|
||||||
signal-port-name-rad-full = Full
|
signal-port-name-rad-full = Full
|
||||||
signal-port-description-rad-full = Signal port set to HIGH if the tank is above 66% pressure, LOW otherwise.
|
signal-port-description-rad-full = Signal port set to HIGH if the tank is above 66% pressure, LOW otherwise.
|
||||||
|
|
||||||
|
# Lathe
|
||||||
|
signal-port-name-lathe-print = Print last recipe
|
||||||
|
signal-port-description-lathe-print = Signal port that prints the last set recipe when pulsed.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
- type: entity
|
- type: entity
|
||||||
parent: BaseMachinePowered
|
parent: [ BaseMachinePowered, BaseAutomatedMachine ] # Goob: Automation
|
||||||
id: FaxMachineBase
|
id: FaxMachineBase
|
||||||
name: long range fax machine
|
name: long range fax machine
|
||||||
description: Bluespace technologies on the application of bureaucracy.
|
description: Bluespace technologies on the application of bureaucracy.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
- type: entity
|
- type: entity
|
||||||
id: MachineFlatpacker
|
id: MachineFlatpacker
|
||||||
parent: [ BaseMachinePowered, ConstructibleMachine ]
|
parent: [ BaseMachinePowered, ConstructibleMachine, BaseAutomatedMachine ] # Goob: Automation + silo
|
||||||
name: Flatpacker 1001
|
name: Flatpacker 1001
|
||||||
description: An industrial machine used for expediting machine construction across the station.
|
description: An industrial machine used for expediting machine construction across the station.
|
||||||
components:
|
components:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
- type: entity
|
- type: entity
|
||||||
id: BaseLathe
|
id: BaseLathe
|
||||||
parent: [ BaseMachinePowered, ConstructibleMachine ]
|
parent: [ BaseMachinePowered, ConstructibleMachine, BaseAutomatedMachine ] # Goob: Automation
|
||||||
abstract: true
|
abstract: true
|
||||||
name: lathe
|
name: lathe
|
||||||
components:
|
components:
|
||||||
@@ -55,6 +55,10 @@
|
|||||||
- !type:AutomatedMaterialStorage
|
- !type:AutomatedMaterialStorage
|
||||||
input: AutomationSlotMaterials
|
input: AutomationSlotMaterials
|
||||||
output: null
|
output: null
|
||||||
|
- !type:AutomatedPorts
|
||||||
|
sinks:
|
||||||
|
- LathePrint
|
||||||
|
- type: LatheAutomation # Goobstation
|
||||||
- type: TechnologyDatabase
|
- type: TechnologyDatabase
|
||||||
supportedDisciplines: # DeltaV - don't add it to every map
|
supportedDisciplines: # DeltaV - don't add it to every map
|
||||||
- Industrial
|
- Industrial
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
- type: entity
|
- type: entity
|
||||||
id: KitchenMicrowave
|
id: KitchenMicrowave
|
||||||
parent: [ BaseMachinePowered, SmallConstructibleMachine ]
|
parent: [ BaseMachinePowered, SmallConstructibleMachine, BaseAutomatedMachine ] # Goob: Automation
|
||||||
name: microwave
|
name: microwave
|
||||||
description: It's magic.
|
description: It's magic.
|
||||||
components:
|
components:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
- type: entity
|
- type: entity
|
||||||
id: KitchenReagentGrinder
|
id: KitchenReagentGrinder
|
||||||
parent: [ BaseMachinePowered, SmallConstructibleMachine ]
|
parent: [ BaseMachinePowered, SmallConstructibleMachine, BaseAutomatedMachine ] # Goob: Automation
|
||||||
name: reagent grinder
|
name: reagent grinder
|
||||||
description: From BlenderTech. Will It Blend? Let's find out!
|
description: From BlenderTech. Will It Blend? Let's find out!
|
||||||
suffix: grinder/juicer
|
suffix: grinder/juicer
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
- type: entity
|
- type: entity
|
||||||
abstract: true
|
abstract: true
|
||||||
id: DisposalUnitBase
|
id: DisposalUnitBase
|
||||||
parent: BaseMachinePowered
|
parent: [ BaseMachinePowered, BaseAutomatedMachine ] # Goob: Automation
|
||||||
description: A pneumatic waste disposal unit.
|
description: A pneumatic waste disposal unit.
|
||||||
placement:
|
placement:
|
||||||
mode: SnapgridCenter
|
mode: SnapgridCenter
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
- type: entity
|
- type: entity
|
||||||
id: RadiationCollector
|
id: RadiationCollector
|
||||||
|
parent: BaseAutomatedMachine # Goob: Automation
|
||||||
name: radiation collector
|
name: radiation collector
|
||||||
suffix: Empty tank
|
suffix: Empty tank
|
||||||
description: A machine that collects radiation and turns it into power. Requires plasma gas to function.
|
description: A machine that collects radiation and turns it into power. Requires plasma gas to function.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
- type: entity
|
- type: entity
|
||||||
abstract: true
|
abstract: true
|
||||||
parent: [ BaseStructureDynamic, BasePaperLabelableVisualized ]
|
parent: [ BaseStructureDynamic, BasePaperLabelableVisualized, BaseAutomatedMachine ]
|
||||||
id: GasCanister
|
id: GasCanister
|
||||||
name: gas canister
|
name: gas canister
|
||||||
description: A canister that can contain any type of gas. It can be attached to connector ports using a wrench.
|
description: A canister that can contain any type of gas. It can be attached to connector ports using a wrench.
|
||||||
|
|||||||
@@ -59,6 +59,14 @@
|
|||||||
- material: Cable
|
- material: Cable
|
||||||
amount: 1
|
amount: 1
|
||||||
doAfter: 1
|
doAfter: 1
|
||||||
|
# Mono
|
||||||
|
- to: timer
|
||||||
|
steps:
|
||||||
|
- material: Steel
|
||||||
|
amount: 1
|
||||||
|
- material: Cable
|
||||||
|
amount: 2
|
||||||
|
doAfter: 1
|
||||||
- node: logic_gate
|
- node: logic_gate
|
||||||
entity: LogicGateOr
|
entity: LogicGateOr
|
||||||
edges:
|
edges:
|
||||||
@@ -124,3 +132,17 @@
|
|||||||
- !type:SpawnPrototype
|
- !type:SpawnPrototype
|
||||||
prototype: PartRodMetal1
|
prototype: PartRodMetal1
|
||||||
amount: 1
|
amount: 1
|
||||||
|
# Mono
|
||||||
|
- node: timer
|
||||||
|
entity: SignalTimerItem
|
||||||
|
edges:
|
||||||
|
- to: empty
|
||||||
|
steps:
|
||||||
|
- tool: Prying
|
||||||
|
doAfter: 2
|
||||||
|
completed:
|
||||||
|
- !type:SpawnPrototype
|
||||||
|
prototype: SheetSteel1
|
||||||
|
- !type:SpawnPrototype
|
||||||
|
prototype: CableApcStack1
|
||||||
|
amount: 2
|
||||||
@@ -1133,6 +1133,9 @@
|
|||||||
objectType: Structure
|
objectType: Structure
|
||||||
placementMode: SnapgridCenter
|
placementMode: SnapgridCenter
|
||||||
canBuildInImpassable: false
|
canBuildInImpassable: false
|
||||||
|
icon:
|
||||||
|
sprite: _NF/Structures/conveyor.rsi # Mono
|
||||||
|
state: conveyor_stopped_cw
|
||||||
conditions:
|
conditions:
|
||||||
- !type:TileNotBlocked
|
- !type:TileNotBlocked
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,6 @@
|
|||||||
- LatheUpgradeKitCryo
|
- LatheUpgradeKitCryo
|
||||||
# End DeltaV Additions
|
# End DeltaV Additions
|
||||||
# Begin Goobstation Additions
|
# Begin Goobstation Additions
|
||||||
- UpgradeKitAutomation
|
|
||||||
- RoboticArmCircuitboard
|
- RoboticArmCircuitboard
|
||||||
- StorageBinCircuitboard
|
- StorageBinCircuitboard
|
||||||
- InteractorCircuitboard
|
- InteractorCircuitboard
|
||||||
|
|||||||
@@ -106,3 +106,10 @@
|
|||||||
id: DisposalEject
|
id: DisposalEject
|
||||||
name: signal-port-name-eject
|
name: signal-port-name-eject
|
||||||
description: signal-port-description-eject
|
description: signal-port-description-eject
|
||||||
|
|
||||||
|
# Lathe
|
||||||
|
|
||||||
|
- type: sinkPort
|
||||||
|
id: LathePrint
|
||||||
|
name: signal-port-name-lathe-print
|
||||||
|
description: signal-port-description-lathe-print
|
||||||
|
|||||||
@@ -4,31 +4,6 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
- type: entity
|
|
||||||
parent: BaseItem
|
|
||||||
id: UpgradeKitAutomation
|
|
||||||
name: automation upgrade kit
|
|
||||||
description: An upgrade kit with all the parts needed to upgrade a machine. This one allows extra automation options by linking robotic arms.
|
|
||||||
components:
|
|
||||||
- type: Sprite
|
|
||||||
sprite: _DV/Objects/Tools/lathe_upgrade_kit.rsi
|
|
||||||
state: icon
|
|
||||||
- type: UpgradeKit
|
|
||||||
whitelist:
|
|
||||||
components:
|
|
||||||
- AutomationSlots # automation needs code to support it, can't work on literally any machine
|
|
||||||
blacklist:
|
|
||||||
components:
|
|
||||||
- Automated
|
|
||||||
- UpgradedMachine
|
|
||||||
components:
|
|
||||||
- type: UpgradedMachine
|
|
||||||
upgrade: upgrade-kit-automation
|
|
||||||
- type: Automated
|
|
||||||
- type: DeviceNetwork
|
|
||||||
deviceNetId: Wireless
|
|
||||||
receiveFrequencyId: BasicDevice
|
|
||||||
|
|
||||||
# for entities that come pre-automated
|
# for entities that come pre-automated
|
||||||
- type: entity
|
- type: entity
|
||||||
abstract: true
|
abstract: true
|
||||||
|
|||||||
@@ -13,4 +13,3 @@
|
|||||||
recipes:
|
recipes:
|
||||||
- LatheUpgradeKitHyper
|
- LatheUpgradeKitHyper
|
||||||
- LatheUpgradeKitCryo
|
- LatheUpgradeKitCryo
|
||||||
- UpgradeKitAutomation
|
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
- type: latheRecipe
|
|
||||||
parent: BaseUpgradeKit
|
|
||||||
id: UpgradeKitAutomation
|
|
||||||
result: UpgradeKitAutomation
|
|
||||||
materials:
|
|
||||||
Glass: 500
|
|
||||||
Steel: 200
|
|
||||||
Silver: 300
|
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
- type: entity
|
||||||
|
parent: BaseLogicItem
|
||||||
|
id: SignalTimerItem
|
||||||
|
name: timer
|
||||||
|
description: Sends a signal after a specified time after receiving a signal.
|
||||||
|
components:
|
||||||
|
- type: Sprite
|
||||||
|
layers:
|
||||||
|
- state: base
|
||||||
|
- sprite: _Mono/Objects/Devices/gates.rsi
|
||||||
|
state: timer
|
||||||
|
- type: Construction
|
||||||
|
node: timer
|
||||||
|
- type: SignalTimer
|
||||||
|
canEditLabel: false
|
||||||
|
- type: DeviceLinkSource
|
||||||
|
ports:
|
||||||
|
- Start
|
||||||
|
- Timer
|
||||||
|
- type: DeviceLinkSink
|
||||||
|
ports:
|
||||||
|
- Trigger
|
||||||
|
- type: ActivatableUI
|
||||||
|
key: enum.SignalTimerUiKey.Key
|
||||||
|
- type: UserInterface
|
||||||
|
interfaces:
|
||||||
|
enum.SignalTimerUiKey.Key:
|
||||||
|
type: SignalTimerBoundUserInterface
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
- type: construction
|
||||||
|
name: timer
|
||||||
|
id: Timer
|
||||||
|
graph: LogicGate
|
||||||
|
startNode: start
|
||||||
|
targetNode: timer
|
||||||
|
category: construction-category-tools
|
||||||
|
description: Sends a signal after a specified time after receiving a signal.
|
||||||
|
icon: { sprite: _Mono/Objects/Devices/gates.rsi, state: timer }
|
||||||
|
objectType: Item
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"license": "CC-BY-SA-3.0",
|
||||||
|
"copyright": "Sprite timer made by Ilya246 for SS14, modified from Textures/Objects/Devices/gates.rsi.",
|
||||||
|
"size": {
|
||||||
|
"x": 32,
|
||||||
|
"y": 32
|
||||||
|
},
|
||||||
|
"states": [
|
||||||
|
{
|
||||||
|
"name": "timer"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
Reference in New Issue
Block a user