number of things, fixing warnings, AtmosAlarmType instead of AtmosMonitorAlarmType
This commit is contained in:
@@ -13,7 +13,8 @@ public sealed class AirAlarmBoundUserInterface : BoundUserInterface
|
||||
private AirAlarmWindow? _window;
|
||||
|
||||
public AirAlarmBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
@@ -21,7 +22,10 @@ public sealed class AirAlarmBoundUserInterface : BoundUserInterface
|
||||
|
||||
_window = new AirAlarmWindow();
|
||||
|
||||
if (State != null) UpdateState(State);
|
||||
if (State != null)
|
||||
{
|
||||
UpdateState(State);
|
||||
}
|
||||
|
||||
_window.OpenCentered();
|
||||
|
||||
|
||||
@@ -50,7 +50,9 @@ public sealed partial class AirAlarmWindow : DefaultWindow
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
foreach (var mode in Enum.GetValues<AirAlarmMode>())
|
||||
{
|
||||
_modes.AddItem($"{mode}", (int) mode);
|
||||
}
|
||||
|
||||
_modes.OnItemSelected += args =>
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ public sealed partial class PumpControl : BoxContainer
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
this.Name = address;
|
||||
Name = address;
|
||||
|
||||
_data = data;
|
||||
_address = address;
|
||||
@@ -60,7 +60,9 @@ public sealed partial class PumpControl : BoxContainer
|
||||
_externalBound.IsValid += value => value >= 0;
|
||||
|
||||
foreach (var value in Enum.GetValues<VentPumpDirection>())
|
||||
{
|
||||
_pumpDirection.AddItem(Loc.GetString($"{value}"), (int) value);
|
||||
}
|
||||
|
||||
_pumpDirection.SelectId((int) _data.PumpDirection);
|
||||
_pumpDirection.OnItemSelected += args =>
|
||||
@@ -71,7 +73,9 @@ public sealed partial class PumpControl : BoxContainer
|
||||
};
|
||||
|
||||
foreach (var value in Enum.GetValues<VentPressureBound>())
|
||||
{
|
||||
_pressureCheck.AddItem(Loc.GetString($"{value}"), (int) value);
|
||||
}
|
||||
|
||||
_pressureCheck.SelectId((int) _data.PressureChecks);
|
||||
_pressureCheck.OnItemSelected += args =>
|
||||
|
||||
@@ -34,7 +34,7 @@ public sealed partial class ScrubberControl : BoxContainer
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
this.Name = address;
|
||||
Name = address;
|
||||
|
||||
_data = data;
|
||||
_address = address;
|
||||
@@ -64,7 +64,9 @@ public sealed partial class ScrubberControl : BoxContainer
|
||||
_volumeRate.IsValid += value => value >= 0;
|
||||
|
||||
foreach (var value in Enum.GetValues<ScrubberPumpDirection>())
|
||||
{
|
||||
_pumpDirection.AddItem(Loc.GetString($"{value}"), (int) value);
|
||||
}
|
||||
|
||||
_pumpDirection.SelectId((int) _data.PumpDirection);
|
||||
_pumpDirection.OnItemSelected += args =>
|
||||
@@ -116,7 +118,9 @@ public sealed partial class ScrubberControl : BoxContainer
|
||||
var intersect = _data.FilterGases.Intersect(data.FilterGases);
|
||||
|
||||
foreach (var value in Enum.GetValues<Gas>())
|
||||
{
|
||||
if (!intersect.Contains(value))
|
||||
_gasControls[value].Pressed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -208,18 +208,18 @@ public sealed partial class ThresholdControl : BoxContainer
|
||||
_modifier = modifier > 0 ? modifier : 1;
|
||||
_value = value;
|
||||
|
||||
this.HorizontalExpand = true;
|
||||
this.Orientation = LayoutOrientation.Vertical;
|
||||
HorizontalExpand = true;
|
||||
Orientation = LayoutOrientation.Vertical;
|
||||
|
||||
this.AddChild(new Label { Text = Loc.GetString($"air-alarm-ui-thresholds-{name}") });
|
||||
AddChild(new Label { Text = Loc.GetString($"air-alarm-ui-thresholds-{name}") });
|
||||
_bound = new FloatSpinBox(.01f, 2);
|
||||
this.AddChild(_bound);
|
||||
AddChild(_bound);
|
||||
|
||||
_boundEnabled = new CheckBox
|
||||
{
|
||||
Text = Loc.GetString("Enabled")
|
||||
};
|
||||
this.AddChild(_boundEnabled);
|
||||
AddChild(_boundEnabled);
|
||||
|
||||
_bound.Value = ModifiedValue ?? 0;
|
||||
_lastValue = _value ?? 0;
|
||||
@@ -289,7 +289,9 @@ public sealed partial class ThresholdControl : BoxContainer
|
||||
OnValidBoundChanged!.Invoke();
|
||||
}
|
||||
|
||||
private bool ValidateThreshold(float value) => (_value != null) && (value >= 0);
|
||||
|
||||
private bool ValidateThreshold(float value)
|
||||
{
|
||||
return _value != null && value >= 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user