diff --git a/Assets/Plugins/KerbalEngineer.Unity.dll b/Assets/Plugins/KerbalEngineer.Unity.dll index 9d1e4dc5..ef6be17d 100644 Binary files a/Assets/Plugins/KerbalEngineer.Unity.dll and b/Assets/Plugins/KerbalEngineer.Unity.dll differ diff --git a/Documents/CHANGES.txt b/Documents/CHANGES.txt index ca3d33b6..5cc42204 100644 --- a/Documents/CHANGES.txt +++ b/Documents/CHANGES.txt @@ -1,3 +1,7 @@ +1.1.8.2, 2020-12-31, KSP 1.11.0 #3045 + - Fix burn time calcs for engines using Intake Air + - All 'time" readouts now show a maximum of 2 units. (i.e. years/days or minutes/seconds) + 1.1.8.1, 2020-12-29, KSP 1.11.0 #3045 - Update to 1.11 - Remove kerbal crew mass hacks now that calculation is correct in stock. diff --git a/KerbalEngineer/EngineerGlobals.cs b/KerbalEngineer/EngineerGlobals.cs index a5397fd5..d4695892 100644 --- a/KerbalEngineer/EngineerGlobals.cs +++ b/KerbalEngineer/EngineerGlobals.cs @@ -21,7 +21,7 @@ public static class EngineerGlobals /// /// Current version of the Kerbal Engineer assembly. /// - public const string ASSEMBLY_VERSION = "1.1.8.1"; + public const string ASSEMBLY_VERSION = "1.1.8.2"; private static string assemblyFile; private static string assemblyName; diff --git a/KerbalEngineer/Helpers/TimeFormatter.cs b/KerbalEngineer/Helpers/TimeFormatter.cs index ee08eb01..9b13787a 100755 --- a/KerbalEngineer/Helpers/TimeFormatter.cs +++ b/KerbalEngineer/Helpers/TimeFormatter.cs @@ -23,44 +23,53 @@ public static class TimeFormatter { public static string ConvertToString(double seconds, string format = "F1") { - int years = 0; - int days = 0; - int hours = 0; - int minutes = 0; - bool negative = seconds < 0; seconds = Math.Abs(seconds); - if (seconds > 0.0) + if (!negative) { + + int years = 0; + int days = 0; + int hours = 0; + int minutes = 0; + years = (int)(seconds / KSPUtil.dateTimeFormatter.Year); seconds -= years * KSPUtil.dateTimeFormatter.Year; days = (int)(seconds / KSPUtil.dateTimeFormatter.Day); seconds -= days * KSPUtil.dateTimeFormatter.Day; - hours = (int)(seconds / 3600.0); + hours =(int)(seconds / 3600.0); seconds -= hours * 3600.0; minutes = (int)(seconds / 60.0); seconds -= minutes * 60.0; - } - if (years > 0) - { - return (negative ? "-" : "") + string.Format("{0}y {1}d {2}h {3}m {4}s", years, days, hours, minutes, seconds.ToString(format)); - } - if (days > 0) - { - return (negative ? "-" : "") + string.Format("{0}d {1}h {2}m {3}s", days, hours, minutes, seconds.ToString(format)); + if (years > 0) + { + return string.Format("{0}y {1}d", years, days); + } + if (days > 0) + { + return string.Format("{0}d {1}h", days, hours); + } + if (hours > 0) + { + return string.Format("{0}h {1}m", hours, minutes); + } + if (minutes > 0) + { + return string.Format("{0}m {1}s", minutes, seconds.ToString("F0")); + } + return string.Format("{0}s", seconds.ToString(format)); } - if (hours > 0) + else { - return (negative ? "-" : "") + string.Format("{0}h {1}m {2}s", hours, minutes, seconds.ToString(format)); + return "-" + string.Format("{0}s", seconds.ToString(format)); } - return (negative ? "-" : "") + (minutes > 0 ? string.Format("{0}m {1}s", minutes, seconds.ToString(format)) : string.Format("{0}s", seconds.ToString(format))); } } } \ No newline at end of file diff --git a/KerbalEngineer/VesselSimulator/EngineSim.cs b/KerbalEngineer/VesselSimulator/EngineSim.cs index 2cf06633..7208c7df 100644 --- a/KerbalEngineer/VesselSimulator/EngineSim.cs +++ b/KerbalEngineer/VesselSimulator/EngineSim.cs @@ -198,6 +198,10 @@ public static EngineSim New(PartSim theEngine, for (int i = 0; i < propellants.Count; ++i) { Propellant propellant = propellants[i]; + if (propellant.name == "ElectricCharge" || propellant.name == "IntakeAir") + { + continue; + } flowMass += propellant.ratio * ResourceContainer.GetResourceDensity(propellant.id); } diff --git a/Output/KerbalEngineer/KerbalEngineer.Unity.dll b/Output/KerbalEngineer/KerbalEngineer.Unity.dll index 9d1e4dc5..ef6be17d 100644 Binary files a/Output/KerbalEngineer/KerbalEngineer.Unity.dll and b/Output/KerbalEngineer/KerbalEngineer.Unity.dll differ diff --git a/Output/KerbalEngineer/KerbalEngineer.dll b/Output/KerbalEngineer/KerbalEngineer.dll index b3d199bc..56d56041 100644 Binary files a/Output/KerbalEngineer/KerbalEngineer.dll and b/Output/KerbalEngineer/KerbalEngineer.dll differ diff --git a/Output/KerbalEngineer/KerbalEngineer.version b/Output/KerbalEngineer/KerbalEngineer.version index de0074e2..986713b4 100644 --- a/Output/KerbalEngineer/KerbalEngineer.version +++ b/Output/KerbalEngineer/KerbalEngineer.version @@ -6,7 +6,7 @@ { "MAJOR":1, "MINOR":1, - "PATCH":7, + "PATCH":8, "BUILD":2 }, "KSP_VERSION":