Rename coolant to water
This commit is contained in:
@@ -23,7 +23,7 @@ public partial class CellInspector : PanelContainer
|
||||
m_Text.AutowrapMode = TextServer.AutowrapMode.WordSmart;
|
||||
}
|
||||
|
||||
public void SetCellInfo(GridPosition? position, ECellTerrain terrain, EPropType prop, EConsumerServiceState serviceState, float fuelHazard, float coolantHazard, float electricityHazard, float heatHazard)
|
||||
public void SetCellInfo(GridPosition? position, ECellTerrain terrain, EPropType prop, EConsumerServiceState serviceState, float fuelHazard, float waterHazard, float electricityHazard, float heatHazard)
|
||||
{
|
||||
var pos = position ?? new(-1, -1);
|
||||
var sb = new StringBuilder();
|
||||
@@ -32,15 +32,15 @@ public partial class CellInspector : PanelContainer
|
||||
sb.AppendLine($"Prop: {prop}");
|
||||
if (prop != EPropType.None)
|
||||
sb.AppendLine($"Service: {serviceState}");
|
||||
sb.AppendLine($"Hazards: {FormatHazards(fuelHazard, coolantHazard, electricityHazard, heatHazard)}");
|
||||
sb.AppendLine($"Hazards: {FormatHazards(fuelHazard, waterHazard, electricityHazard, heatHazard)}");
|
||||
m_Text.Text = sb.ToString();
|
||||
}
|
||||
|
||||
private static string FormatHazards(float fuel, float coolant, float electricity, float heat)
|
||||
private static string FormatHazards(float fuel, float water, float electricity, float heat)
|
||||
{
|
||||
var parts = new List<string>();
|
||||
if (fuel > 0) parts.Add($"fuel {fuel:F1}");
|
||||
if (coolant > 0) parts.Add($"coolant {coolant:F1}");
|
||||
if (water > 0) parts.Add($"water {water:F1}");
|
||||
if (electricity > 0) parts.Add($"electricity {electricity:F1}");
|
||||
if (heat > 0) parts.Add($"heat {heat:F1}");
|
||||
return parts.Count > 0 ? string.Join(", ", parts) : "none";
|
||||
|
||||
@@ -20,7 +20,7 @@ internal static class FrontendAssets
|
||||
return ResourceLoader.Exists(path) ? ResourceLoader.Load<Texture2D>(path) : null;
|
||||
}
|
||||
|
||||
public const string CoolantIcon = "res://Assets/Ui/coolant_icon.png";
|
||||
public const string WaterIcon = "res://Assets/Ui/water_icon.png";
|
||||
public const string ElectricIcon = "res://Assets/Ui/electric_icon.png";
|
||||
public const string FuelIcon = "res://Assets/Ui/fuel_icon.png";
|
||||
public const string HeatShieldIcon = "res://Assets/Ui/heat_shield_icon.png";
|
||||
|
||||
@@ -147,7 +147,7 @@ public partial class GridViewport : Control
|
||||
|
||||
private IEnumerable<ECarrierType> OrderedUndergroundLayers()
|
||||
{
|
||||
var carriers = new[] { ECarrierType.Fuel, ECarrierType.Coolant, ECarrierType.Electricity }.Where(IsLayerVisible).ToArray();
|
||||
var carriers = new[] { ECarrierType.Fuel, ECarrierType.Water, ECarrierType.Electricity }.Where(IsLayerVisible).ToArray();
|
||||
return ActiveUndergroundLayer is { } activeCarrier && carriers.Contains(activeCarrier)
|
||||
? carriers.Where(carrier => carrier != activeCarrier).Append(activeCarrier)
|
||||
: carriers;
|
||||
@@ -200,7 +200,7 @@ public partial class GridViewport : Control
|
||||
var surface = m_LevelState.GetSurface(position);
|
||||
var rect = layout.CellRect(position);
|
||||
FillHazard(rect, surface.Fuel, c_FuelColor, 0.08f, opacity, Balancing.Current.FuelCaution, Balancing.Current.FuelCritical);
|
||||
FillHazard(rect, surface.Coolant, c_CoolantColor, 0.18f, opacity, Balancing.Current.CoolantCaution, Balancing.Current.CoolantCritical);
|
||||
FillHazard(rect, surface.Water, c_WaterColor, 0.18f, opacity, Balancing.Current.WaterCaution, Balancing.Current.WaterCritical);
|
||||
FillHazard(rect, surface.Electricity, c_ElectricityColor, 0.28f, opacity, Balancing.Current.ElectricityCaution, Balancing.Current.ElectricityCritical);
|
||||
FillHazard(rect, surface.Heat, c_HeatColor, 0.34f, opacity, Balancing.Current.HeatCaution, Balancing.Current.HeatCritical);
|
||||
}
|
||||
@@ -427,7 +427,7 @@ public partial class GridViewport : Control
|
||||
{
|
||||
return carrier switch {
|
||||
ECarrierType.Fuel => ShowFuelLayer,
|
||||
ECarrierType.Coolant => ShowCoolantLayer,
|
||||
ECarrierType.Water => ShowWaterLayer,
|
||||
ECarrierType.Electricity => ShowElectricityLayer,
|
||||
_ => false
|
||||
};
|
||||
@@ -501,7 +501,7 @@ public partial class GridViewport : Control
|
||||
{
|
||||
return carrier switch {
|
||||
ECarrierType.Fuel => c_FuelColor,
|
||||
ECarrierType.Coolant => c_CoolantColor,
|
||||
ECarrierType.Water => c_WaterColor,
|
||||
ECarrierType.Electricity => c_ElectricityColor,
|
||||
_ => Colors.White
|
||||
};
|
||||
@@ -537,7 +537,7 @@ public partial class GridViewport : Control
|
||||
{
|
||||
return carrier switch {
|
||||
ECarrierType.Fuel => "F",
|
||||
ECarrierType.Coolant => "C",
|
||||
ECarrierType.Water => "C",
|
||||
ECarrierType.Electricity => "E",
|
||||
_ => "?"
|
||||
};
|
||||
@@ -547,7 +547,7 @@ public partial class GridViewport : Control
|
||||
{
|
||||
return remedy switch {
|
||||
ERemedyType.FuelNeutralizer => "F REM",
|
||||
ERemedyType.CoolantNeutralizer => "C REM",
|
||||
ERemedyType.WaterNeutralizer => "C REM",
|
||||
ERemedyType.ElectricityNeutralizer => "E REM",
|
||||
ERemedyType.HeatShield => "H SHD",
|
||||
_ => "REM"
|
||||
@@ -588,7 +588,7 @@ public partial class GridViewport : Control
|
||||
public Vector2I HoveredCell { get; private set; } = c_InvalidCell;
|
||||
public Vector2I RobotPosition { get; private set; } = c_InvalidCell;
|
||||
public bool ShowFuelLayer { get; set; } = true;
|
||||
public bool ShowCoolantLayer { get; set; } = true;
|
||||
public bool ShowWaterLayer { get; set; } = true;
|
||||
public bool ShowElectricityLayer { get; set; } = true;
|
||||
public ECarrierType? ActiveUndergroundLayer { get; set; }
|
||||
|
||||
@@ -611,7 +611,7 @@ public partial class GridViewport : Control
|
||||
private const int c_AllCorners = c_TopLeftCorner | c_TopRightCorner | c_BottomLeftCorner | c_BottomRightCorner;
|
||||
private static readonly Vector2I c_InvalidCell = new(-1, -1);
|
||||
private static readonly Color c_BackgroundColor = new(0.06f, 0.07f, 0.08f);
|
||||
private static readonly Color c_CoolantColor = new(0.20f, 0.78f, 0.92f);
|
||||
private static readonly Color c_WaterColor = new(0.20f, 0.78f, 0.92f);
|
||||
private static readonly Color c_DisabledColor = new(0.32f, 0.34f, 0.35f);
|
||||
private static readonly Color c_ElectricityColor = new(0.96f, 0.78f, 0.20f);
|
||||
private static readonly Color c_FuelColor = new(0.86f, 0.20f, 0.18f);
|
||||
|
||||
@@ -7,19 +7,19 @@ public partial class InventoryStrip : HBoxContainer
|
||||
public override void _Ready()
|
||||
{
|
||||
AddChild(CreateItem("Fuel Neutralizer", 2, FrontendAssets.FuelIcon, out var fuelLabel));
|
||||
AddChild(CreateItem("Coolant Neutralizer", 2, FrontendAssets.CoolantIcon, out var coolantLabel));
|
||||
AddChild(CreateItem("Water Neutralizer", 2, FrontendAssets.WaterIcon, out var waterLabel));
|
||||
AddChild(CreateItem("Electric Neutralizer", 1, FrontendAssets.ElectricIcon, out var electricLabel));
|
||||
AddChild(CreateItem("Heat Shield", 1, FrontendAssets.HeatShieldIcon, out var heatLabel));
|
||||
m_FuelLabel = fuelLabel;
|
||||
m_CoolantLabel = coolantLabel;
|
||||
m_WaterLabel = waterLabel;
|
||||
m_ElectricLabel = electricLabel;
|
||||
m_HeatLabel = heatLabel;
|
||||
}
|
||||
|
||||
public void SetInventory(int fuelNeutralizers, int coolantNeutralizers, int electricNeutralizers, int heatShields)
|
||||
public void SetInventory(int fuelNeutralizers, int waterNeutralizers, int electricNeutralizers, int heatShields)
|
||||
{
|
||||
m_FuelLabel.Text = $"{fuelNeutralizers}";
|
||||
m_CoolantLabel.Text = $"{coolantNeutralizers}";
|
||||
m_WaterLabel.Text = $"{waterNeutralizers}";
|
||||
m_ElectricLabel.Text = $"{electricNeutralizers}";
|
||||
m_HeatLabel.Text = $"{heatShields}";
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public partial class InventoryStrip : HBoxContainer
|
||||
return item;
|
||||
}
|
||||
|
||||
private Label m_CoolantLabel = null!;
|
||||
private Label m_WaterLabel = null!;
|
||||
private Label m_ElectricLabel = null!;
|
||||
|
||||
private Label m_FuelLabel = null!;
|
||||
|
||||
@@ -113,7 +113,7 @@ public sealed class GameSession
|
||||
public ECellTerrain[] Terrain => LevelState.Terrain;
|
||||
public SurfaceState[] Surface => LevelState.Surface;
|
||||
public UndergroundCell[] UndergroundFuel => LevelState.Fuel;
|
||||
public UndergroundCell[] UndergroundCoolant => LevelState.Coolant;
|
||||
public UndergroundCell[] UndergroundWater => LevelState.Water;
|
||||
public UndergroundCell[] UndergroundElectricity => LevelState.Electricity;
|
||||
public delegate void StateChangedHandler(GameSession sender);
|
||||
|
||||
|
||||
@@ -82,10 +82,10 @@ public partial class LevelScreen : ScreenBase
|
||||
m_GridViewport.ShowFuelLayer = pressed;
|
||||
m_GridViewport.QueueRedraw();
|
||||
}));
|
||||
controls.AddChild(CreateLayerToggle("Coolant", true, pressed => {
|
||||
controls.AddChild(CreateLayerToggle("Water", true, pressed => {
|
||||
if (m_GridViewport is null) return;
|
||||
|
||||
m_GridViewport.ShowCoolantLayer = pressed;
|
||||
m_GridViewport.ShowWaterLayer = pressed;
|
||||
m_GridViewport.QueueRedraw();
|
||||
}));
|
||||
controls.AddChild(CreateLayerToggle("Electricity", true, pressed => {
|
||||
@@ -98,14 +98,14 @@ public partial class LevelScreen : ScreenBase
|
||||
var activeLayer = new OptionButton();
|
||||
activeLayer.AddItem("Surface", 0);
|
||||
activeLayer.AddItem("Fuel", 1);
|
||||
activeLayer.AddItem("Coolant", 2);
|
||||
activeLayer.AddItem("Water", 2);
|
||||
activeLayer.AddItem("Electricity", 3);
|
||||
activeLayer.ItemSelected += index => {
|
||||
if (m_GridViewport is null) return;
|
||||
|
||||
m_GridViewport.ActiveUndergroundLayer = index switch {
|
||||
1 => ECarrierType.Fuel,
|
||||
2 => ECarrierType.Coolant,
|
||||
2 => ECarrierType.Water,
|
||||
3 => ECarrierType.Electricity,
|
||||
_ => null
|
||||
};
|
||||
@@ -187,7 +187,7 @@ public partial class LevelScreen : ScreenBase
|
||||
|
||||
m_InventoryStrip.SetInventory(
|
||||
m_Session.LevelState.Robot.FuelNeutralizers,
|
||||
m_Session.LevelState.Robot.CoolantNeutralizers,
|
||||
m_Session.LevelState.Robot.WaterNeutralizers,
|
||||
m_Session.LevelState.Robot.ElectricityNeutralizers,
|
||||
m_Session.LevelState.Robot.HeatShields);
|
||||
}
|
||||
@@ -213,7 +213,7 @@ public partial class LevelScreen : ScreenBase
|
||||
prop.Type,
|
||||
prop.ServiceState,
|
||||
surface.Fuel,
|
||||
surface.Coolant,
|
||||
surface.Water,
|
||||
surface.Electricity,
|
||||
surface.Heat);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user