Skip to content

Commit

Permalink
1.1.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbudda committed Jan 6, 2021
1 parent 68afb56 commit 79872ee
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 18 deletions.
Binary file modified Assets/Plugins/KerbalEngineer.Unity.dll
Binary file not shown.
3 changes: 3 additions & 0 deletions Documents/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.1.8.3, 2021-1-5, KSP 1.11.0 #3045
- Restore time precision for vessel orbital period, target orbital period, and node post-burn period readouts.

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)
Expand Down
2 changes: 1 addition & 1 deletion KerbalEngineer/EngineerGlobals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static class EngineerGlobals
/// <summary>
/// Current version of the Kerbal Engineer assembly.
/// </summary>
public const string ASSEMBLY_VERSION = "1.1.8.2";
public const string ASSEMBLY_VERSION = "1.1.8.3";

private static string assemblyFile;
private static string assemblyName;
Expand Down
54 changes: 38 additions & 16 deletions KerbalEngineer/Helpers/TimeFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,46 @@ public static string ConvertToString(double seconds, string format = "F1")

minutes = (int)(seconds / 60.0);
seconds -= minutes * 60.0;

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 (format == "F3")
{ //Full time
if (years > 0)
{
return string.Format("{0}y {1}d {2}h {3}m {4}s", years, days, hours, minutes, seconds.ToString(format));
}
if (days > 0)
{
return string.Format("{1}d {2}h {3}m {4}s", years, days, hours, minutes, seconds.ToString(format));
}
if (hours > 0)
{
return string.Format("{2}h {3}m {4}s", years, days, hours, minutes, seconds.ToString(format));
}
if (minutes > 0)
{
return string.Format("{3}m {4}s", years, days, hours, minutes, seconds.ToString(format));
}
return string.Format("{4}s", years, days, hours, minutes, seconds.ToString(format));
}
if (minutes > 0)
{
return string.Format("{0}m {1}s", minutes, seconds.ToString("F0"));
else
{ //Short Time
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));
}
return string.Format("{0}s", seconds.ToString(format));
}
else
{
Expand Down
Binary file modified Output/KerbalEngineer/KerbalEngineer.Unity.dll
Binary file not shown.
Binary file modified Output/KerbalEngineer/KerbalEngineer.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion Output/KerbalEngineer/KerbalEngineer.version
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"MAJOR":1,
"MINOR":1,
"PATCH":8,
"BUILD":2
"BUILD":3
},
"KSP_VERSION":
{
Expand Down

0 comments on commit 79872ee

Please sign in to comment.