-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibConstruct.cs
More file actions
42 lines (33 loc) · 1.28 KB
/
LibConstruct.cs
File metadata and controls
42 lines (33 loc) · 1.28 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
using BepInEx.Configuration;
using HarmonyLib;
using LaunchPadBooster;
using UnityEngine;
namespace LibConstruct;
class LibConstructMod : MonoBehaviour
{
public const string ModID = "LibConstruct";
public static Mod MOD;
public static ConfigEntry<bool> RepairBoardLoadOrder;
public void OnLoaded(ConfigFile config, ModData mod)
{
var about = mod.GetAboutData();
MOD = new(ModID, about.Version);
// add these types in case implementers try to save lists of them
MOD.AddSaveDataType<PlacementBoardHostSaveData>();
MOD.AddSaveDataType<PlacementBoardSaveData>();
MOD.AddSaveDataType<PlacementBoardStructureSaveData>();
MOD.Networking.RegisterLegacyMessage<CreateBoardStructureMessage>();
MOD.Networking.RegisterLegacyMessage<RelocateBoardStructureMessage>();
MOD.Networking.Required = true;
var harmony = new Harmony(ModID);
harmony.PatchAll();
WorldManager.OnGameDataLoaded += () => CanConstructPatch.RunPatch(harmony);
RepairBoardLoadOrder = config.Bind(
new ConfigDefinition("Debug", "RepairBoardLoadOrder"),
false,
new ConfigDescription(
"If you have a save thats not loading due to errors coming from LibConstruct, try enabling this setting. Warning: this will slow down loading significantly"
)
);
}
}