Skip to content

Commit 036167d

Browse files
committed
#141, partial: firx NREs for fission reactors without heat modules
1 parent 960eb7a commit 036167d

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

‎SystemHeat/SystemHeat/UI/ReactorUI/ReactorWidget.cs‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,13 @@ public void ToggleCharge()
200200
protected void Update()
201201
{
202202
float nominalTemp = 0f;
203+
float coreTemp = 0f;
204+
205+
if (heatModule != null)
206+
{
207+
coreTemp = heatModule.LoopTemperature;
208+
}
209+
203210
if (module.moduleName == "FusionReactor" || module.moduleName == "ModuleFusionEngine")
204211
{
205212
nominalTemp = float.Parse(module.Fields.GetValue("SystemOutletTemperature").ToString());
@@ -241,16 +248,17 @@ protected void Update()
241248
}
242249
}
243250
chargeBar.color = fillColor;
244-
245251
}
252+
246253
if (module.moduleName == "ModuleSystemHeatFissionReactor" || module.moduleName == "ModuleSystemHeatFissionEngine")
247254
{
248255
nominalTemp = float.Parse(module.Fields.GetValue("NominalTemperature").ToString());
256+
coreTemp = module.Fields.GetValue<float>("InternalCoreTemperature");
249257
heatText.text = Localizer.Format("#LOC_SystemHeat_ReactorPanel_Field_HeatGenerated",
250258
Utils.ToSI(float.Parse(module.Fields.GetValue("CurrentHeatGeneration").ToString()), "F0"));
251259
powerText.text = Localizer.Format("#LOC_SystemHeat_ReactorPanel_Field_PowerGenerated", float.Parse(module.Fields.GetValue("CurrentElectricalGeneration").ToString()).ToString("F0"));
252260
lifetimeText.text = Localizer.Format("#LOC_SystemHeat_ReactorPanel_Field_CoreLife", module.Fields.GetValue("FuelStatus"));
253-
temperatureText.text = Localizer.Format("#LOC_SystemHeat_ReactorPanel_Field_CoreTemperature", nominalTemp, heatModule.LoopTemperature.ToString("F0"));
261+
temperatureText.text = Localizer.Format("#LOC_SystemHeat_ReactorPanel_Field_CoreTemperature", nominalTemp, coreTemp.ToString("F0"));
254262

255263
bool.TryParse(module.Fields.GetValue("Enabled").ToString(), out bool isOn);
256264
if (isOn != onToggle.isOn)
@@ -259,7 +267,7 @@ protected void Update()
259267
}
260268

261269
}
262-
if (heatModule.LoopTemperature > nominalTemp)
270+
if (coreTemp > nominalTemp)
263271
{
264272
if (warningIcon.enabled != true)
265273
{

0 commit comments

Comments
 (0)