Skip to content

Commit

Permalink
Catch when RF changes engine or tank config
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanKell committed Sep 18, 2023
1 parent 86d19f8 commit bb24731
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Source/Harmony/RealFuels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,30 @@ internal static void Postfix_DrawSelectButton(RealFuels.ModuleEngineConfigsBase
{
RFECMPatcher.techNode = null;
}

[HarmonyPostfix]
[HarmonyPatch("SetConfiguration", new Type[] { typeof(ConfigNode), typeof(bool) })]
internal static void Postfix_SetConfiguration()
{
if (HighLogic.LoadedSceneIsEditor && KerbalConstructionTime.KerbalConstructionTime.Instance != null)
{
KerbalConstructionTime.KerbalConstructionTime.Instance.IsEditorRecalcuationRequired = true;
}
}
}

[HarmonyPatch(typeof(RealFuels.Tanks.ModuleFuelTanks))]
internal class RFMFTPatcher
{
[HarmonyPostfix]
[HarmonyPatch("RaiseTankDefinitionChanged")]
internal static void Postfix_RaiseTankDefinitionChanged()
{
if (HighLogic.LoadedSceneIsEditor && KerbalConstructionTime.KerbalConstructionTime.Instance != null)
{
KerbalConstructionTime.KerbalConstructionTime.Instance.IsEditorRecalcuationRequired = true;
}
}
}

[HarmonyPatch(typeof(RealFuels.EntryCostManager))]
Expand Down

0 comments on commit bb24731

Please sign in to comment.