Set alert level command (#8507)

* Add force mode for setting alert level

* Add console command for changing alert level

* Filename typo

* Return delta disableSelection property

* Make locked a component property

* Not lock green level after nuke disarm
This commit is contained in:
Morbo
2022-05-29 07:36:50 +03:00
committed by GitHub
parent 594499a9a2
commit 1fc7c72b22
5 changed files with 73 additions and 5 deletions

View File

@@ -85,8 +85,9 @@ public sealed class AlertLevelSystem : EntitySystem
/// <param name="playSound">Play the alert level's sound.</param>
/// <param name="announce">Say the alert level's announcement.</param>
/// <param name="force">Force the alert change. This applies if the alert level is not selectable or not.</param>
/// <param name="locked">Will it be possible to change level by crew.</param>
public void SetLevel(EntityUid station, string level, bool playSound, bool announce, bool force = false,
MetaDataComponent? dataComponent = null, AlertLevelComponent? component = null)
bool locked = false, MetaDataComponent? dataComponent = null, AlertLevelComponent? component = null)
{
if (!Resolve(station, ref component, ref dataComponent)
|| component.AlertLevels == null
@@ -99,7 +100,8 @@ public sealed class AlertLevelSystem : EntitySystem
if (!force)
{
if (!detail.Selectable
|| component.CurrentDelay > 0)
|| component.CurrentDelay > 0
|| component.IsLevelLocked)
{
return;
}
@@ -109,6 +111,7 @@ public sealed class AlertLevelSystem : EntitySystem
}
component.CurrentLevel = level;
component.IsLevelLocked = locked;
var stationName = dataComponent.EntityName;