-
Notifications
You must be signed in to change notification settings - Fork 2
/
Main.cs
40 lines (32 loc) · 1009 Bytes
/
Main.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
36
37
38
39
40
using System;
using System.Reflection;
using Harmony12;
using UnityModManagerNet;
using PortiaHelper.Core;
namespace PortiaHelper
{
static class Main
{
public static HarmonyInstance harmonyInstance;
public static UnityModManager.ModEntry.ModLogger Logger;
public static bool Load(UnityModManager.ModEntry modEntry) {
Logger = modEntry.Logger;
Central.Instance.HomePath = modEntry.Path;
try {
if (!PatchController.Instance.CanApplyPatches()) {
Logger.Log($"========== PORTIA HELPER - CONFLICTS FOUND ==========");
Logger.Log("In order to use Portia Helper, disable these mods (and restart the game):");
foreach (var cm in PatchController.Instance.ConflictedMods()) {
Logger.Log($"-> {cm}");
}
return false;
}
harmonyInstance = HarmonyInstance.Create(modEntry.Info.Id);
harmonyInstance.PatchAll(Assembly.GetExecutingAssembly());
} catch (Exception ex) {
modEntry.Logger.LogException(ex);
}
return true;
}
}
}