From 8ae4bd2acd01ce694330fb22d20d82b12dac182f Mon Sep 17 00:00:00 2001 From: Genhis Date: Sat, 11 May 2019 12:59:34 +0200 Subject: [PATCH] Fixed #2: AutostageLimit property wasn't saved properly --- CHANGELOG.md | 8 +++++++- EditableVariables.cs | 3 +++ Properties/AssemblyInfo.cs | 6 +++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1e74cd..bb98cb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +## [0.4.1] - 2019-05-11 +### Fixed +- `AutostageLimit` property of StageController not being saved properly +([#2](https://github.com/Genhis/KRPC.MechJeb/issues/2)) + ## [0.4.0] - 2019-03-31 ### Added - Auto-hotstaging support in StageController @@ -84,7 +89,8 @@ proximity or reverting a flight to launch - **StagingController** - **TargetController** to get information about the current target -[Unreleased]: https://github.com/Genhis/KRPC.MechJeb/compare/v0.4.0...HEAD +[Unreleased]: https://github.com/Genhis/KRPC.MechJeb/compare/v0.4.1...HEAD +[0.4.1]: https://github.com/Genhis/KRPC.MechJeb/compare/v0.4.0...v0.4.1 [0.4.0]: https://github.com/Genhis/KRPC.MechJeb/compare/v0.3.0...v0.4.0 [0.3.0]: https://github.com/Genhis/KRPC.MechJeb/compare/v0.2.0...v0.3.0 [0.2.0]: https://github.com/Genhis/KRPC.MechJeb/compare/v0.1.0...v0.2.0 diff --git a/EditableVariables.cs b/EditableVariables.cs index f74fb34..e6624e4 100644 --- a/EditableVariables.cs +++ b/EditableVariables.cs @@ -5,6 +5,7 @@ namespace KRPC.MechJeb { public static class EditableVariables { private static PropertyInfo editableDoubleVal; private static FieldInfo editableIntVal; + private static FieldInfo editableIntText; internal static bool InitTypes(Type t) { switch(t.FullName) { @@ -19,6 +20,7 @@ internal static bool InitTypes(Type t) { return true; case "MuMech.EditableInt": editableIntVal = t.GetField("val"); + editableIntText = t.GetField("_text"); return true; default: return false; @@ -31,6 +33,7 @@ public static void SetDouble(object instance, double value) { public static void SetInt(object instance, int value) { editableIntVal.SetValue(instance, value); + editableIntText.SetValue(instance, value.ToString()); } public static double GetDouble(object instance) { diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 0481805..87e9368 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -9,7 +9,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("KRPC.MechJeb")] -[assembly: AssemblyCopyright("© 2018 Genhis")] +[assembly: AssemblyCopyright("© 2018-2019 Genhis")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.4.0")] -[assembly: AssemblyFileVersion("0.4.0")] +[assembly: AssemblyVersion("0.4.1")] +[assembly: AssemblyFileVersion("0.4.1")]