-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModSettingsUIPlugin.cs
55 lines (47 loc) · 1.62 KB
/
ModSettingsUIPlugin.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System;
using System.Reflection;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;
using ModSettingsUI.Util;
namespace ModSettingsUI
{
[BepInPlugin(pluginGUID, pluginName, pluginVersion)]
public class ModSettingsUIPlugin : BaseUnityPlugin
{
const string pluginGUID = "nonamepaul.plugins.modsettingsui";
const string pluginName = "Mod Settings UI";
const string pluginVersion = "1.0.0";
internal readonly Assembly assembly;
public static ManualLogSource logger;
public static Harmony harmony;
public static Sprite rightRedTriangle;
public static Sprite downGreenTriangle;
public ModSettingsUIPlugin()
{
assembly = Assembly.GetExecutingAssembly();
}
void Awake()
{
logger = Logger;
harmony = new Harmony(pluginGUID);
GameObject img2Sprite = new GameObject("IMG2Sprite", typeof(IMG2Sprite));
rightRedTriangle = IMG2Sprite.instance.LoadNewSprite(Paths.BepInExRootPath + "\\plugins\\ModSettingsUI\\Assets\\right.png");
downGreenTriangle = IMG2Sprite.instance.LoadNewSprite(Paths.BepInExRootPath + "\\plugins\\ModSettingsUI\\Assets\\down.png");
try
{
harmony.PatchAll(assembly);
} catch(Exception e)
{
Debug.Log(e.Message);
}
}
public void OnDestroy()
{
logger.LogInfo("Destroying...");
ModSettingsUI.Destroy();
harmony.UnpatchAll(pluginGUID);
}
}
}