Skip to content

Commit 9673ce5

Browse files
committed
FIxing the mess that merging upstream into a heavily refactored code causes. :P
1 parent a3626ab commit 9673ce5

6 files changed

Lines changed: 10 additions & 54 deletions

File tree

ModuleManager/CustomConfigsManager.cs

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

Source/ModuleManager/CustomConfigsManager.cs

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,35 @@
22
using System.IO;
33
using UnityEngine;
44

5+
using static ModuleManager.FilePathRepository;
6+
57
namespace ModuleManager
68
{
79
[KSPAddon(KSPAddon.Startup.SpaceCentre, false)]
810
public class CustomConfigsManager : MonoBehaviour
911
{
10-
static bool start_techtree_loaded = false;
11-
static bool start_physics_loaded = false;
1212
internal void Start()
1313
{
14-
#if false
15-
Log("Blah");
16-
Log(HighLogic.CurrentGame.Parameters.Career.TechTreeUrl);
17-
Log(MMPatchLoader.TECHTREE_CONFIG.Path);
18-
Log(MMPatchLoader.TECHTREE_CONFIG.IsLoadable.ToString());
19-
#endif
20-
if (!start_techtree_loaded && MMPatchLoader.TECHTREE_CONFIG.IsLoadable)
14+
if (HighLogic.CurrentGame.Parameters.Career.TechTreeUrl != techTreeFile && File.Exists(techTreePath))
2115
{
2216
Log("Setting modded tech tree as the active one");
23-
HighLogic.CurrentGame.Parameters.Career.TechTreeUrl = MMPatchLoader.TECHTREE_CONFIG.KspPath;
24-
start_techtree_loaded = true;
17+
HighLogic.CurrentGame.Parameters.Career.TechTreeUrl = techTreeFile;
2518
}
2619

27-
if (!start_physics_loaded && MMPatchLoader.PHYSICS_CONFIG.IsLoadable)
20+
if (PhysicsGlobals.PhysicsDatabaseFilename != physicsFile && File.Exists(physicsPath))
2821
{
2922
Log("Setting modded physics as the active one");
30-
PhysicsGlobals.PhysicsDatabaseFilename = MMPatchLoader.PHYSICS_CONFIG.Path;
23+
24+
PhysicsGlobals.PhysicsDatabaseFilename = physicsFile;
25+
3126
if (!PhysicsGlobals.Instance.LoadDatabase())
3227
Log("Something went wrong while setting the active physics config.");
33-
start_physics_loaded = true;
3428
}
3529
}
3630

37-
private static readonly KSPe.Util.Log.Logger log = KSPe.Util.Log.Logger.CreateForType<CustomConfigsManager>();
38-
private static void Log(String s)
31+
public static void Log(String s)
3932
{
40-
log.info(s);
33+
print("[CustomConfigsManager] " + s);
4134
}
4235

4336
}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)