/
CustomConfigsManager.cs
35 lines (29 loc) · 1.13 KB
/
CustomConfigsManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.IO;
using UnityEngine;
namespace ModuleManager
{
[KSPAddon(KSPAddon.Startup.SpaceCentre, false)]
public class CustomConfigsManager : MonoBehaviour
{
internal void Start()
{
if (HighLogic.CurrentGame.Parameters.Career.TechTreeUrl != MMPatchLoader.techTreeFile && File.Exists(MMPatchLoader.techTreePath))
{
log("Setting modded tech tree as the active one");
HighLogic.CurrentGame.Parameters.Career.TechTreeUrl = MMPatchLoader.techTreeFile;
}
if (PhysicsGlobals.PhysicsDatabaseFilename != MMPatchLoader.physicsFile && File.Exists(MMPatchLoader.physicsPath))
{
log("Setting modded physics as the active one");
PhysicsGlobals.PhysicsDatabaseFilename = MMPatchLoader.physicsFile;
if (!PhysicsGlobals.Instance.LoadDatabase())
log("Something went wrong while setting the active physics config.");
}
}
public static void log(String s)
{
print("[CustomConfigsManager] " + s);
}
}
}