-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
63 lines (56 loc) · 2.05 KB
/
Plugin.cs
File metadata and controls
63 lines (56 loc) · 2.05 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
using BepInEx;
using BepInEx.Configuration;
using WeatherRegistry;
using HarmonyLib;
namespace Dusted
{
[BepInPlugin(modGUID, modName, modVersion)]
[BepInDependency(WeatherRegistry.Plugin.GUID, BepInDependency.DependencyFlags.HardDependency)]
public class DustedBase : BaseUnityPlugin
{
private const string modGUID = "ZetaArcade.Dusted";
private const string modName = "Dusted";
private const string modVersion = "1.0.2";
private readonly Harmony harmony = new Harmony(modGUID);
private void Awake()
{
EventManager.SetupFinished.AddListener(OnSetupFinished);
ConfigManager.Init(Config);
// Plugin startup logic
Logger.LogInfo($"Plugin is loaded!");
harmony.PatchAll(typeof(DustedBase));
}
private void OnSetupFinished()
{
// Setup logic
Logger.LogInfo($"Injecting weathers!");
foreach (SelectableLevel level in ConfigManager.DustCloudsLevels.Value)
{
RandomWeatherWithVariables randomWeather =
new()
{
weatherType = LevelWeatherType.DustClouds,
weatherVariable = 0,
weatherVariable2 = 0
};
Logger.LogInfo($"Injecting into " + level);
WeatherController.AddRandomWeather(level, randomWeather);
}
}
}
public class ConfigManager
{
public static ConfigFile config;
public static LevelListConfigHandler DustCloudsLevels = new("");
public static void Init(ConfigFile configFile)
{
config = configFile;
DustCloudsLevels.ConfigFile = config;
DustCloudsLevels.SetConfigEntry(
"DustClouds",
"Dust Clouds Levels",
new ConfigDescription("Levels to inject DustClouds weather into, in a semi-colon seperated list. E.g. Experimentation;Assurance;Gloom;", null)
);
}
}
}