Skip to content

Commit

Permalink
Merge pull request #113 from post-kerbin-mining-corporation/dev
Browse files Browse the repository at this point in the history
Minor hotfix
  • Loading branch information
ChrisAdderley authored Aug 14, 2024
2 parents 0e13bc2 + 48aa303 commit ca49e52
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 22 deletions.
Binary file modified GameData/SystemHeat/Plugin/SystemHeat.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion GameData/SystemHeat/Versioning/SystemHeat.version
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"MAJOR":0,
"MINOR":7,
"PATCH":0,
"PATCH":1,
"BUILD":0
},
"KSP_VERSION":
Expand Down
15 changes: 13 additions & 2 deletions SystemHeat/SystemHeat/Modules/BoiloffFuel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,19 @@ public void Boiloff(double seconds, double scale)
if (fuelPresent)
{
double toBoil = resource.amount * (1.0 - Math.Pow(1.0 - boiloffRateSeconds, seconds)) * scale;

double boilResult = part.RequestResource(resource.info.id, toBoil, ResourceFlowMode.NO_FLOW);
double boilResult;
/// If you're reading this, stop now
if (!resource.flowState)
{
/// This handles if the flow has been disabled in the UI. we gotta ignore it, in the best way possible
resource.flowState = true;
boilResult = part.RequestResource(resource.info.id, toBoil, ResourceFlowMode.NO_FLOW);
resource.flowState = false;
}
else
{
boilResult = part.RequestResource(resource.info.id, toBoil, ResourceFlowMode.NO_FLOW);
}

/// Generate outputs
if (outputs.Count > 0)
Expand Down
39 changes: 21 additions & 18 deletions SystemHeat/SystemHeat/UI/ToolbarUI/ToolbarIconTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,29 @@ public class ToolbarIconTag
public ToolbarIconTag() { }
public void Position(ApplicationLauncherButton button)
{
alertToolbarBackgroundRect.SetParent(button.toggleButton.transform, false);
alertToolbarBackgroundRect.anchorMin = Vector2.zero;
alertToolbarBackgroundRect.anchorMax = Vector3.one;
alertToolbarBackgroundRect.pivot = Vector2.zero;
alertToolbarBackgroundRect.offsetMin = new Vector2(22, 20);
alertToolbarBackgroundRect.offsetMax = new Vector2(0, 0);
if (button != null)
{
alertToolbarBackgroundRect.SetParent(button.toggleButton.transform, false);
alertToolbarBackgroundRect.anchorMin = Vector2.zero;
alertToolbarBackgroundRect.anchorMax = Vector3.one;
alertToolbarBackgroundRect.pivot = Vector2.zero;
alertToolbarBackgroundRect.offsetMin = new Vector2(22, 20);
alertToolbarBackgroundRect.offsetMax = new Vector2(0, 0);

alertToolbarGlowRect.SetParent(alertToolbarBackgroundRect.transform, false);
alertToolbarGlowRect.anchorMin = Vector2.zero;
alertToolbarGlowRect.anchorMax = Vector3.one;
alertToolbarGlowRect.pivot = Vector2.one * 0.5f;
alertToolbarGlowRect.offsetMin = new Vector2(-5, -5);
alertToolbarGlowRect.offsetMax = new Vector2(5, 5);
alertToolbarGlowRect.SetParent(alertToolbarBackgroundRect.transform, false);
alertToolbarGlowRect.anchorMin = Vector2.zero;
alertToolbarGlowRect.anchorMax = Vector3.one;
alertToolbarGlowRect.pivot = Vector2.one * 0.5f;
alertToolbarGlowRect.offsetMin = new Vector2(-5, -5);
alertToolbarGlowRect.offsetMax = new Vector2(5, 5);

alertToolbarRect.SetParent(alertToolbarBackgroundRect.transform, false);
alertToolbarRect.anchorMin = Vector2.zero;
alertToolbarRect.anchorMax = Vector3.one;
alertToolbarRect.pivot = Vector2.zero;
alertToolbarRect.offsetMin = new Vector2(0, 0);
alertToolbarRect.offsetMax = new Vector2(0, 0);
alertToolbarRect.SetParent(alertToolbarBackgroundRect.transform, false);
alertToolbarRect.anchorMin = Vector2.zero;
alertToolbarRect.anchorMax = Vector3.one;
alertToolbarRect.pivot = Vector2.zero;
alertToolbarRect.offsetMin = new Vector2(0, 0);
alertToolbarRect.offsetMax = new Vector2(0, 0);
}
}
public void Initialize()
{
Expand Down
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v0.7.1
------
- Fix a null reference exception when loading a vessel with no SystemHeat parts
- Fixed an issue where a player could disable a tank in the UI, thus disabling boiloff

v0.7.0
------
- Updated ModuleManager to 4.2.3
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
================
SystemHeat 0.7.0
SystemHeat 0.7.1
================

A mod for Kerbal Space Program, intended to provide a better experience for heat management, particularly geared towards resource extraction, high energy engines, and nuclear reactors.
Expand Down

0 comments on commit ca49e52

Please sign in to comment.