forked from sarbian/ModuleManager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomConfigsManager.cs
More file actions
37 lines (30 loc) · 1.09 KB
/
Copy pathCustomConfigsManager.cs
File metadata and controls
37 lines (30 loc) · 1.09 KB
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
36
37
using System;
using System.IO;
using UnityEngine;
using static ModuleManager.FilePathRepository;
namespace ModuleManager
{
[KSPAddon(KSPAddon.Startup.SpaceCentre, false)]
public class CustomConfigsManager : MonoBehaviour
{
internal void Start()
{
if (HighLogic.CurrentGame.Parameters.Career.TechTreeUrl != techTreeFile && File.Exists(techTreePath))
{
Log("Setting modded tech tree as the active one");
HighLogic.CurrentGame.Parameters.Career.TechTreeUrl = techTreeFile;
}
if (PhysicsGlobals.PhysicsDatabaseFilename != physicsFile && File.Exists(physicsPath))
{
Log("Setting modded physics as the active one");
PhysicsGlobals.PhysicsDatabaseFilename = physicsFile;
if (!PhysicsGlobals.Instance.LoadDatabase())
Log("Something went wrong while setting the active physics config.");
}
}
public static void Log(String s)
{
print("[CustomConfigsManager] " + s);
}
}
}