Allow C4's auto-starting when stickied quality to be toggled (#10434)
This commit is contained in:
@@ -38,5 +38,11 @@ namespace Content.Server.Explosion.Components
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("startOnStick")]
|
[DataField("startOnStick")]
|
||||||
public bool StartOnStick;
|
public bool StartOnStick;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Allows changing the start-on-stick quality.
|
||||||
|
/// </summary>
|
||||||
|
[DataField("canToggleStartOnStick")]
|
||||||
|
public bool AllowToggleStartOnStick;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,6 +87,15 @@ public sealed partial class TriggerSystem
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (component.AllowToggleStartOnStick)
|
||||||
|
{
|
||||||
|
args.Verbs.Add(new AlternativeVerb()
|
||||||
|
{
|
||||||
|
Text = Loc.GetString("verb-toggle-start-on-stick"),
|
||||||
|
Act = () => ToggleStartOnStick(uid, args.User, component)
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CycleDelay(OnUseTimerTriggerComponent component, EntityUid user)
|
private void CycleDelay(OnUseTimerTriggerComponent component, EntityUid user)
|
||||||
@@ -116,6 +125,20 @@ public sealed partial class TriggerSystem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ToggleStartOnStick(EntityUid grenade, EntityUid user, OnUseTimerTriggerComponent comp)
|
||||||
|
{
|
||||||
|
if (comp.StartOnStick)
|
||||||
|
{
|
||||||
|
comp.StartOnStick = false;
|
||||||
|
_popupSystem.PopupEntity(Loc.GetString("popup-start-on-stick-off"), grenade, Filter.Entities(user));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
comp.StartOnStick = true;
|
||||||
|
_popupSystem.PopupEntity(Loc.GetString("popup-start-on-stick-on"), grenade, Filter.Entities(user));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void OnTimerUse(EntityUid uid, OnUseTimerTriggerComponent component, UseInHandEvent args)
|
private void OnTimerUse(EntityUid uid, OnUseTimerTriggerComponent component, UseInHandEvent args)
|
||||||
{
|
{
|
||||||
if (args.Handled) return;
|
if (args.Handled) return;
|
||||||
|
|||||||
@@ -6,3 +6,7 @@ verb-trigger-timer-cycle = Cycle Time Delay
|
|||||||
examine-trigger-timer = The timer is set to {$time} seconds.
|
examine-trigger-timer = The timer is set to {$time} seconds.
|
||||||
|
|
||||||
popup-trigger-timer-set = Timer set to {$time} seconds.
|
popup-trigger-timer-set = Timer set to {$time} seconds.
|
||||||
|
|
||||||
|
verb-toggle-start-on-stick = Toggle auto-activation
|
||||||
|
popup-start-on-stick-off = The device will no longer activate automatically when planted
|
||||||
|
popup-start-on-stick-on = The device will now activate automatically when planted
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
initialBeepDelay: 0
|
initialBeepDelay: 0
|
||||||
beepSound: /Audio/Machines/Nuke/general_beep.ogg
|
beepSound: /Audio/Machines/Nuke/general_beep.ogg
|
||||||
startOnStick: true
|
startOnStick: true
|
||||||
|
canToggleStartOnStick: true
|
||||||
- type: TriggerOnSignal
|
- type: TriggerOnSignal
|
||||||
- type: SignalReceiver
|
- type: SignalReceiver
|
||||||
- type: Sticky
|
- type: Sticky
|
||||||
|
|||||||
Reference in New Issue
Block a user