@@ -9,28 +9,37 @@ namespace ModuleManager
9
9
[ KSPAddon ( KSPAddon . Startup . SpaceCentre , false ) ]
10
10
public class CustomConfigsManager : MonoBehaviour
11
11
{
12
+ internal static bool start_techtree_loaded = false ;
13
+ internal static bool start_physics_loaded = false ;
12
14
internal void Start ( )
13
15
{
14
- if ( HighLogic . CurrentGame . Parameters . Career . TechTreeUrl != TECHTREE_CONFIG . Path && TECHTREE_CONFIG . IsLoadable )
16
+ #if false
17
+ Log ( "Blah" ) ;
18
+ Log ( HighLogic . CurrentGame . Parameters . Career . TechTreeUrl ) ;
19
+ Log ( TECHTREE_CONFIG . Path ) ;
20
+ Log ( TECHTREE_CONFIG . IsLoadable . ToString ( ) ) ;
21
+ #endif
22
+ if ( ! start_techtree_loaded && TECHTREE_CONFIG . IsLoadable )
15
23
{
16
24
Log ( "Setting modded tech tree as the active one" ) ;
17
- HighLogic . CurrentGame . Parameters . Career . TechTreeUrl = TECHTREE_CONFIG . Path ;
25
+ HighLogic . CurrentGame . Parameters . Career . TechTreeUrl = TECHTREE_CONFIG . KspPath ;
26
+ start_techtree_loaded = true ;
18
27
}
19
28
20
- if ( PhysicsGlobals . PhysicsDatabaseFilename != PHYSICS_CONFIG . Path && PHYSICS_CONFIG . IsLoadable )
29
+ if ( ! start_physics_loaded && PHYSICS_CONFIG . IsLoadable )
21
30
{
22
31
Log ( "Setting modded physics as the active one" ) ;
23
-
24
32
PhysicsGlobals . PhysicsDatabaseFilename = PHYSICS_CONFIG . Path ;
25
-
26
33
if ( ! PhysicsGlobals . Instance . LoadDatabase ( ) )
27
34
Log ( "Something went wrong while setting the active physics config." ) ;
35
+ start_physics_loaded = true ;
28
36
}
29
37
}
30
38
31
- public static void Log ( String s )
39
+ private static readonly KSPe . Util . Log . Logger log = KSPe . Util . Log . Logger . CreateForType < CustomConfigsManager > ( ) ;
40
+ private static void Log ( String s )
32
41
{
33
- print ( "[CustomConfigsManager] " + s ) ;
42
+ log . info ( s ) ;
34
43
}
35
44
36
45
}
0 commit comments