New component: change alert level on trigger (#36581)
* adds component that lets change alert level on trigger * oops, put stuff on wrong folder * missclick, forgor a file * slarti finds ways to improve code * Apply suggestions from code review --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
@@ -116,6 +116,20 @@ public sealed class AlertLevelSystem : EntitySystem
|
||||
return alert.CurrentDelay;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the default alert level for a station entity.
|
||||
/// Returns an empty string if the station has no alert levels defined.
|
||||
/// </summary>
|
||||
/// <param name="station">The station entity.</param>
|
||||
public string GetDefaultLevel(Entity<AlertLevelComponent?> station)
|
||||
{
|
||||
if (!Resolve(station.Owner, ref station.Comp) || station.Comp.AlertLevels == null)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
return station.Comp.AlertLevels.DefaultLevel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the alert level based on the station's entity ID.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user