-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIncreaseShipCap.cs
38 lines (29 loc) · 1.16 KB
/
IncreaseShipCap.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
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
namespace IncreaseShipCap
{
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
public class IncreaseShipCapPlugin : BaseUnityPlugin
{
static Harmony _harmony;
public static ConfigEntry<int> configMaxItemCount;
private void Awake()
{
configMaxItemCount = Config.Bind<int>("General",
"MaxItemCount",
200,
"Number of max items on the ship.");
_harmony = new Harmony(PluginInfo.PLUGIN_GUID);
_harmony.PatchAll(typeof(Patches));
Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");
Logger.LogInfo($"Ship Item Cap set to {configMaxItemCount.Value}");
}
}
public class Patches {
[HarmonyPatch(typeof(StartOfRound), "Awake")]
static void Postfix(ref int ___maxShipItemCapacity) {
___maxShipItemCapacity = IncreaseShipCapPlugin.configMaxItemCount.Value;
}
}
}