-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModMain.cs
More file actions
76 lines (64 loc) · 1.79 KB
/
ModMain.cs
File metadata and controls
76 lines (64 loc) · 1.79 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace EmptyMod
{
public class ModMain : IMod, IModSettings
{
public ModMain()
{
Name = "Empty Mod";
Description = "This is a skeleton of a mod for Parkitect 1.2 or higher.";
Identifier = "com.krisharris.nullmod"; //Reverse DNS is best for identifiers, but anything unique works.
Config = new Config(this);
Config.Load();
}
public string Name { get; }
public string Description { get; }
public string Identifier { get; }
public EmptyMod.Config Config { get; }
// Helpers
public string ModDir
{
get
{
return ModManager.Instance.getModEntries().First(x => x.mod == this).path;
}
}
public string ConfigPath
{
get
{
return FilePaths.getFolderPath(Identifier + ".config");
}
}
// IMod handler
public void onEnabled()
{
Config.Load();
Config.Save();
//TODO: Add code to load and setup your new mod
Debug.Log("[EmptyMod]: Enabled!");
}
public void onDisabled()
{
//TODO: Add code to disable your mod.
Debug.Log("[EmptyMod]: Disabled!");
}
//IModSettings handler
public void onSettingsOpened()
{
Debug.Log("[EmptyMod]: Settings Opened");
}
public void onSettingsClosed()
{
Config.Save();
Debug.Log("[EmptyMod]: Settings Closed");
}
public void onDrawSettingsUI()
{
Config.onDrawUI();
}
}
}