forked from KSP-ModularManagement/ModuleManager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomConfigsManager.cs
More file actions
56 lines (49 loc) · 1.72 KB
/
Copy pathCustomConfigsManager.cs
File metadata and controls
56 lines (49 loc) · 1.72 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
This file is part of Module Manager /L
© 2018-2024 LisiasT
© 2013-2018 Sarbian; Blowfish
© 2013 ialdabaoth
Module Manager /L is licensed as follows:
* GPL 3.0 : https://www.gnu.org/licenses/gpl-3.0.txt
Module Manager /L is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
You should have received a copy of the GNU General Public License 3.0
along with Module Manager /L. If not, see <https://www.gnu.org/licenses/>.
*/
using System;
using UnityEngine;
using static ModuleManager.FilePathRepository;
namespace ModuleManager
{
[KSPAddon(KSPAddon.Startup.SpaceCentre, false)]
public class CustomConfigsManager : MonoBehaviour
{
internal static bool start_techtree_loaded = false;
internal void Start()
{
#if false
Log("Blah");
Log(HighLogic.CurrentGame.Parameters.Career.TechTreeUrl);
Log(TECHTREE_CONFIG.Path);
Log(TECHTREE_CONFIG.IsLoadable.ToString());
#endif
if (start_techtree_loaded)
{
if (HighLogic.CurrentGame.Parameters.Career.TechTreeUrl != TECHTREE_CONFIG.KspPath)
Log("Tech tree was changed by third party to [{0}].", HighLogic.CurrentGame.Parameters.Career.TechTreeUrl);
}
else if (TECHTREE_CONFIG.IsLoadable)
{
Log("Setting modded tech tree as the active one");
HighLogic.CurrentGame.Parameters.Career.TechTreeUrl = TECHTREE_CONFIG.KspPath;
start_techtree_loaded = true;
}
}
private static readonly KSPe.Util.Log.Logger log = KSPe.Util.Log.Logger.CreateThreadUnsafeForType<CustomConfigsManager>(); // No need to use thread safe logging. Yet.
private static void Log(String s, params object[] @params)
{
log.info(s, @params);
}
}
}