Skip to content

Commit 64f5700

Browse files
committed
Merge dev into master
2 parents 31565cd + cf1a3f9 commit 64f5700

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+4152
-1622
lines changed
25 KB
Binary file not shown.

GameData/TimeControl/TimeControl.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"VERSION": {
77
"MAJOR": 2,
88
"MINOR": 8,
9-
"PATCH": 1,
9+
"PATCH": 2,
1010
"BUILD": 0
1111
},
1212
"KSP_VERSION": {

TimeControl/AssemblyVersion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
using System.Reflection;
88

9-
[assembly: AssemblyVersion("2.8.1.0")]
9+
[assembly: AssemblyVersion("2.8.2.0")]

TimeControl/Enums/TimeControllerUserAction.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

TimeControl/ExtensionMethods.cs

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,21 @@ internal static ManeuverNode FirstUpcomingManuverNode(this Vessel v, double from
5151
return nodes.First();
5252
}
5353

54-
internal static bool TryAssignFromConfigFloat(this ConfigNode cn, string property, ref float v)
54+
internal static bool TryAssignFromConfigInt(this ConfigNode cn, string property, out int v)
55+
{
56+
if (cn.HasValue( property ) && int.TryParse( cn.GetValue( property ), out int cv ))
57+
{
58+
v = cv;
59+
return true;
60+
}
61+
else
62+
{
63+
v = default( int );
64+
return false;
65+
}
66+
}
67+
68+
internal static bool TryAssignFromConfigFloat(this ConfigNode cn, string property, out float v)
5569
{
5670
if (cn.HasValue( property ) && float.TryParse( cn.GetValue( property ), out float cv ))
5771
{
@@ -60,11 +74,12 @@ internal static bool TryAssignFromConfigFloat(this ConfigNode cn, string propert
6074
}
6175
else
6276
{
77+
v = default( float );
6378
return false;
6479
}
6580
}
6681

67-
internal static bool TryAssignFromConfigBool(this ConfigNode cn, string property, ref bool v)
82+
internal static bool TryAssignFromConfigBool(this ConfigNode cn, string property, out bool v)
6883
{
6984
if (cn.HasValue( property ) && bool.TryParse( cn.GetValue( property ), out bool cv ))
7085
{
@@ -73,6 +88,31 @@ internal static bool TryAssignFromConfigBool(this ConfigNode cn, string property
7388
}
7489
else
7590
{
91+
v = default( bool );
92+
return false;
93+
}
94+
}
95+
96+
internal static bool TryAssignFromConfigEnum<T>(this ConfigNode cn, string property, out T e)
97+
{
98+
if (cn.HasValue( property ))
99+
{
100+
Type eT = typeof( T );
101+
string ll = cn.GetValue( property );
102+
if (Enum.IsDefined( eT, ll ))
103+
{
104+
e = (T)Enum.Parse( eT, ll );
105+
return true;
106+
}
107+
else
108+
{
109+
e = default( T );
110+
return false;
111+
}
112+
}
113+
else
114+
{
115+
e = default( T );
76116
return false;
77117
}
78118
}

TimeControl/FPSKeeperController.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ internal class FPSKeeperController : MonoBehaviour
4646
#region MonoBehavior
4747
private void Awake()
4848
{
49-
const string logBlockName = nameof( SlowMoController ) + "." + nameof( Awake );
49+
const string logBlockName = nameof( FPSKeeperController ) + "." + nameof( Awake );
5050
using (EntryExitLogger.EntryExitLog( logBlockName, EntryExitLoggerOptions.All ))
5151
{
5252
DontDestroyOnLoad( this );
@@ -56,10 +56,10 @@ private void Awake()
5656

5757
private void Start()
5858
{
59-
const string logBlockName = nameof( SlowMoController ) + "." + nameof( Start );
59+
const string logBlockName = nameof( FPSKeeperController ) + "." + nameof( Start );
6060
using (EntryExitLogger.EntryExitLog( logBlockName, EntryExitLoggerOptions.All ))
6161
{
62-
StartCoroutine( CRInit() );
62+
StartCoroutine( Configure() );
6363
}
6464
}
6565

@@ -72,9 +72,9 @@ private void OnDestroy()
7272
#endregion
7373

7474
#region Initialization
75-
private IEnumerator CRInit()
75+
private IEnumerator Configure()
7676
{
77-
const string logBlockName = nameof( SlowMoController ) + "." + nameof( CRInit );
77+
const string logBlockName = nameof( FPSKeeperController ) + "." + nameof( Configure );
7878
using (EntryExitLogger.EntryExitLog( logBlockName, EntryExitLoggerOptions.All ))
7979
{
8080
this.SetDefaults();
@@ -92,7 +92,7 @@ private IEnumerator CRInit()
9292

9393
private void SetDefaults()
9494
{
95-
const string logBlockName = nameof( SlowMoController ) + "." + nameof( SetDefaults );
95+
const string logBlockName = nameof( FPSKeeperController ) + "." + nameof( SetDefaults );
9696
using (EntryExitLogger.EntryExitLog( logBlockName, EntryExitLoggerOptions.All ))
9797
{
9898
/*
@@ -108,7 +108,7 @@ private void SetDefaults()
108108

109109
private void SubscribeToGameEvents()
110110
{
111-
const string logBlockName = nameof( SlowMoController ) + "." + nameof( SubscribeToGameEvents );
111+
const string logBlockName = nameof( FPSKeeperController ) + "." + nameof( SubscribeToGameEvents );
112112
using (EntryExitLogger.EntryExitLog( logBlockName, EntryExitLoggerOptions.All ))
113113
{
114114
/*

0 commit comments

Comments
 (0)