Skip to content

Commit

Permalink
fixed pipe naming bug. Added ambient temp.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauge committed Jan 11, 2025
1 parent 5b467dd commit 61754d4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<Definition>
<Id>
<TypeId>CubeBlock</TypeId>
<SubtypeId>Gauge_LG_CoolantPipe_Straight_Sink</SubtypeId>
<SubtypeId>Gauge_LG_CoolantPipe_Straight_SingleSink</SubtypeId>
</Id>
<DisplayName>{LOC:DisplayName_Gauge_LG_CoolantPipe_Straight}</DisplayName>
<DisplayName>{LOC:DisplayName_Gauge_LG_CoolantPipe_Straight_SingleSink}</DisplayName>
<Description>{LOC:Description_Gauge_CoolantPipe}</Description>
<Icon>Textures\GUI\Icons\Gauge\LG_CoolantPipeStraight_OneSink.dds</Icon>
<CubeSize>Large</CubeSize>
Expand Down
10 changes: 7 additions & 3 deletions ThermalDynamics/Data/Scripts/Thermodynamics/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public class Session : MySessionComponentBase

private static StringBuilder ToolText = new StringBuilder($"");
private static StringBuilder GridText = new StringBuilder($"");
private static Color GridTempColor = Color.Blue;

public Session()
{
Expand Down Expand Up @@ -207,16 +206,21 @@ private void DrawGridHud()
{
GridText.Clear();
IMyCubeBlock controlledBlock = MyAPIGateway.Session?.Player?.Controller?.ControlledEntity as IMyCubeBlock;

if (controlledBlock == null) return;

MyCubeGrid grid = controlledBlock.CubeGrid as MyCubeGrid;
if (grid == null) return;
ThermalGrid tg = grid.GameLogic.GetAs<ThermalGrid>();
if (tg == null) return;

hudStatusGrid.InitialColor = ColorExtensions.HSVtoColor(Tools.GetTemperatureColor(tg.HottestBlock.Temperature));
GridText.Append($"Ambient: {Tools.KelvinToCelsiusString(tg.FrameAmbientTemprature)}\n");

if (tg.HottestBlock != null)
{
if (hudStatusGrid != null)
{
hudStatusGrid.InitialColor = ColorExtensions.HSVtoColor(Tools.GetTemperatureColor(tg.HottestBlock.Temperature));
}
GridText.Append($"Peak Temp: {Tools.KelvinToCelsiusString(tg.HottestBlock.Temperature)}\n");
}

Expand Down
14 changes: 7 additions & 7 deletions ThermalDynamics/Data/Scripts/Thermodynamics/ThermalGridLoop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ public partial class ThermalGrid : MyGameLogicComponent
{
{ "Gauge_LG_CoolantPipe_Straight", new Vector3I[0] },
{ "Gauge_LG_CoolantPipe_Straight_DoubleSink", new Vector3I[] { Vector3I.Left, Vector3I.Right } },
{ "Gauge_LG_CoolantPipe_Straight_Sink", new Vector3I[] { Vector3I.Right } },
{ "Gauge_LG_CoolantPipe_Straight_SingleSink", new Vector3I[] { Vector3I.Right } },
{ "Gauge_LG_CoolantPipe_Corner", new Vector3I[0] },
{ "Gauge_LG_CoolantPipe_Corner_DoubleSink", new Vector3I[] { Vector3I.Backward, Vector3I.Right } },
{ "Gauge_LG_CoolantPipe_Corner_SingleSink", new Vector3I[] { Vector3I.Up } },
{ "Gauge_LG_CoolantPump", new Vector3I[0] },

{ "Gauge_SG_CoolantPipe_Straight", new Vector3I[0] },
{ "Gauge_SG_CoolantPipe_Straight_DoubleSink", new Vector3I[] { Vector3I.Left, Vector3I.Right } },
{ "Gauge_SG_CoolantPipe_Straight_Sink", new Vector3I[] { Vector3I.Right } },
{ "Gauge_SG_CoolantPipe_Straight_SingleSink", new Vector3I[] { Vector3I.Right } },
{ "Gauge_SG_CoolantPipe_Corner", new Vector3I[0] },
{ "Gauge_SG_CoolantPipe_Corner_DoubleSink", new Vector3I[] { Vector3I.Backward, Vector3I.Right } },
{ "Gauge_SG_CoolantPipe_Corner_SingleSink", new Vector3I[] { Vector3I.Up } },
Expand All @@ -32,19 +32,19 @@ public partial class ThermalGrid : MyGameLogicComponent
{
{ "Gauge_LG_CoolantPipe_Straight", new Vector3I[] { Vector3I.Forward, Vector3I.Backward } },
{ "Gauge_LG_CoolantPipe_Straight_DoubleSink", new Vector3I[] { Vector3I.Forward, Vector3I.Backward } },
{ "Gauge_LG_CoolantPipe_Straight_Sink", new Vector3I[] { Vector3I.Forward, Vector3I.Backward } },
{ "Gauge_LG_CoolantPipe_Straight_SingleSink", new Vector3I[] { Vector3I.Forward, Vector3I.Backward } },
{ "Gauge_LG_CoolantPipe_Corner", new Vector3I[] { Vector3I.Forward, Vector3I.Left } },
{ "Gauge_LG_CoolantPipe_Corner_DoubleSink", new Vector3I[] { Vector3I.Forward, Vector3I.Left } },
{ "Gauge_LG_CoolantPipe_Corner_SingleSink", new Vector3I[] { Vector3I.Forward, Vector3I.Left } },
{ "Gauge_LG_CoolantPump", new Vector3I[] { Vector3I.Forward, Vector3I.Backward } },
{ "Gauge_LG_CoolantPump", new Vector3I[] { Vector3I.Forward, Vector3I.Backward } },

{ "Gauge_SG_CoolantPipe_Straight", new Vector3I[] { Vector3I.Forward, Vector3I.Backward } },
{ "Gauge_SG_CoolantPipe_Straight_DoubleSink", new Vector3I[] { Vector3I.Forward, Vector3I.Backward } },
{ "Gauge_SG_CoolantPipe_Straight_Sink", new Vector3I[] { Vector3I.Forward, Vector3I.Backward } },
{ "Gauge_SG_CoolantPipe_Straight_SingleSink", new Vector3I[] { Vector3I.Forward, Vector3I.Backward } },
{ "Gauge_SG_CoolantPipe_Corner", new Vector3I[] { Vector3I.Forward, Vector3I.Left } },
{ "Gauge_SG_CoolantPipe_Corner_DoubleSink", new Vector3I[] { Vector3I.Forward, Vector3I.Left } },
{ "Gauge_SG_CoolantPipe_Corner_SingleSink", new Vector3I[] { Vector3I.Forward, Vector3I.Left } },
{ "Gauge_SG_CoolantPump", new Vector3I[] { Vector3I.Forward, Vector3I.Backward } },
{ "Gauge_SG_CoolantPump", new Vector3I[] { Vector3I.Forward, Vector3I.Backward } },
};


Expand Down Expand Up @@ -145,7 +145,7 @@ private bool CoolantCrawl(Vector3I last, IMySlimBlock b, ref List<ThermalCell> l

Vector3I next = b.Min + dir;

//MyLog.Default.Info($"{b.BlockDefinition.Id.SubtypeId.ToString()} | last: {last} --- next: {next} --- min: {b.Min + dir} --- max: {b.Max + dir}");
MyLog.Default.Info($"{b.BlockDefinition.Id.SubtypeId} [{next == last}] ({loop.Count}) | last: {last} --- next: {next} --- min: {b.Min + dir} --- max: {b.Max + dir}");

if (next == last) continue;

Expand Down

0 comments on commit 61754d4

Please sign in to comment.