Make atmos alert computer colors private variables (#32992)
This commit is contained in:
@@ -43,6 +43,18 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
|
|||||||
|
|
||||||
private const float SilencingDuration = 2.5f;
|
private const float SilencingDuration = 2.5f;
|
||||||
|
|
||||||
|
// Colors
|
||||||
|
private Color _wallColor = new Color(64, 64, 64);
|
||||||
|
private Color _tileColor = new Color(28, 28, 28);
|
||||||
|
private Color _monitorBlipColor = Color.Cyan;
|
||||||
|
private Color _untrackedEntColor = Color.DimGray;
|
||||||
|
private Color _regionBaseColor = new Color(154, 154, 154);
|
||||||
|
private Color _inactiveColor = StyleNano.DisabledFore;
|
||||||
|
private Color _statusTextColor = StyleNano.GoodGreenFore;
|
||||||
|
private Color _goodColor = Color.LimeGreen;
|
||||||
|
private Color _warningColor = new Color(255, 182, 72);
|
||||||
|
private Color _dangerColor = new Color(255, 67, 67);
|
||||||
|
|
||||||
public AtmosAlertsComputerWindow(AtmosAlertsComputerBoundUserInterface userInterface, EntityUid? owner)
|
public AtmosAlertsComputerWindow(AtmosAlertsComputerBoundUserInterface userInterface, EntityUid? owner)
|
||||||
{
|
{
|
||||||
RobustXamlLoader.Load(this);
|
RobustXamlLoader.Load(this);
|
||||||
@@ -55,8 +67,8 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
|
|||||||
NavMap.Owner = _owner;
|
NavMap.Owner = _owner;
|
||||||
|
|
||||||
// Set nav map colors
|
// Set nav map colors
|
||||||
NavMap.WallColor = new Color(64, 64, 64);
|
NavMap.WallColor = _wallColor;
|
||||||
NavMap.TileColor = Color.DimGray * NavMap.WallColor;
|
NavMap.TileColor = _tileColor;
|
||||||
|
|
||||||
// Set nav map grid uid
|
// Set nav map grid uid
|
||||||
var stationName = Loc.GetString("atmos-alerts-window-unknown-location");
|
var stationName = Loc.GetString("atmos-alerts-window-unknown-location");
|
||||||
@@ -214,7 +226,7 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
|
|||||||
if (consoleCoords != null && consoleUid != null)
|
if (consoleCoords != null && consoleUid != null)
|
||||||
{
|
{
|
||||||
var texture = _spriteSystem.Frame0(new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")));
|
var texture = _spriteSystem.Frame0(new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")));
|
||||||
var blip = new NavMapBlip(consoleCoords.Value, texture, Color.Cyan, true, false);
|
var blip = new NavMapBlip(consoleCoords.Value, texture, _monitorBlipColor, true, false);
|
||||||
NavMap.TrackedEntities[consoleUid.Value] = blip;
|
NavMap.TrackedEntities[consoleUid.Value] = blip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,7 +275,7 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
|
|||||||
VerticalAlignment = VAlignment.Center,
|
VerticalAlignment = VAlignment.Center,
|
||||||
};
|
};
|
||||||
|
|
||||||
label.SetMarkup(Loc.GetString("atmos-alerts-window-no-active-alerts", ("color", StyleNano.GoodGreenFore.ToHexNoAlpha())));
|
label.SetMarkup(Loc.GetString("atmos-alerts-window-no-active-alerts", ("color", _statusTextColor.ToHexNoAlpha())));
|
||||||
|
|
||||||
AlertsTable.AddChild(label);
|
AlertsTable.AddChild(label);
|
||||||
}
|
}
|
||||||
@@ -323,7 +335,7 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
|
|||||||
var coords = _entManager.GetCoordinates(metaData.NetCoordinates);
|
var coords = _entManager.GetCoordinates(metaData.NetCoordinates);
|
||||||
|
|
||||||
if (_trackedEntity != null && _trackedEntity != metaData.NetEntity)
|
if (_trackedEntity != null && _trackedEntity != metaData.NetEntity)
|
||||||
color *= Color.DimGray;
|
color *= _untrackedEntColor;
|
||||||
|
|
||||||
var selectable = true;
|
var selectable = true;
|
||||||
var blip = new NavMapBlip(coords, _spriteSystem.Frame0(texture), color, _trackedEntity == metaData.NetEntity, selectable);
|
var blip = new NavMapBlip(coords, _spriteSystem.Frame0(texture), color, _trackedEntity == metaData.NetEntity, selectable);
|
||||||
@@ -341,10 +353,10 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Color the region based on alarm state and entity tracking
|
// Color the region based on alarm state and entity tracking
|
||||||
color = blip.Value.Item2 * new Color(154, 154, 154);
|
color = blip.Value.Item2 * _regionBaseColor;
|
||||||
|
|
||||||
if (_trackedEntity != null && _trackedEntity != regionOwner)
|
if (_trackedEntity != null && _trackedEntity != regionOwner)
|
||||||
color *= Color.DimGray;
|
color *= _untrackedEntColor;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -585,13 +597,13 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
|
|||||||
switch (alarmState)
|
switch (alarmState)
|
||||||
{
|
{
|
||||||
case AtmosAlarmType.Invalid:
|
case AtmosAlarmType.Invalid:
|
||||||
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")), StyleNano.DisabledFore); break;
|
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")), _inactiveColor); break;
|
||||||
case AtmosAlarmType.Normal:
|
case AtmosAlarmType.Normal:
|
||||||
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")), Color.LimeGreen); break;
|
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")), _goodColor); break;
|
||||||
case AtmosAlarmType.Warning:
|
case AtmosAlarmType.Warning:
|
||||||
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_triangle.png")), new Color(255, 182, 72)); break;
|
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_triangle.png")), _warningColor); break;
|
||||||
case AtmosAlarmType.Danger:
|
case AtmosAlarmType.Danger:
|
||||||
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_square.png")), new Color(255, 67, 67)); break;
|
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_square.png")), _dangerColor); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
|
|||||||
Reference in New Issue
Block a user