31 lines
1.1 KiB
C#
Raw Normal View History

2022-05-08 01:48:04 +03:00
using BepInEx;
using BepInEx.Configuration;
using Newtonsoft.Json;
using System.IO;
namespace SamSWAT.HeliCrash
{
[BepInPlugin("com.SamSWAT.HeliCrash", "SamSWAT.HeliCrash", "1.2.0")]
2022-05-08 01:48:04 +03:00
public class Plugin : BaseUnityPlugin
{
2022-06-26 18:50:55 +03:00
public static HeliCrashLocations HeliCrashLocations;
2022-05-08 01:48:04 +03:00
internal static string Directory;
internal static ConfigEntry<int> HeliCrashChance;
private void Awake()
{
Directory = Path.Combine(BepInEx.Paths.PluginPath, "SamSWAT.HeliCrash/").Replace("\\", "/");
new HeliCrashPatch().Enable();
var json = new StreamReader(Directory + "HeliCrashLocations.json").ReadToEnd();
2022-06-26 18:50:55 +03:00
HeliCrashLocations = JsonConvert.DeserializeObject<HeliCrashLocations>(json);
2022-05-08 01:48:04 +03:00
HeliCrashChance = Config.Bind(
"Main Settings",
"Helicopter crash site chance",
10,
new ConfigDescription("Chance of helicopter crash site appearance in percentages",
new AcceptableValueRange<int>(0, 100)));
}
}
}