Initial commit
This commit is contained in:
commit
22b901bf62
5 changed files with 492 additions and 0 deletions
50
Plugin.cs
Normal file
50
Plugin.cs
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
using BepInEx;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace PermaDay
|
||||
{
|
||||
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
|
||||
public class Plugin : BaseUnityPlugin
|
||||
{
|
||||
private void Awake()
|
||||
{
|
||||
Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded! Applying patch...");
|
||||
Harmony harmony = new Harmony(PluginInfo.PLUGIN_GUID);
|
||||
harmony.PatchAll();
|
||||
}
|
||||
}
|
||||
public static class PermaDayPatch
|
||||
{
|
||||
[HarmonyPatch(typeof(DayCycleManager), "UpdateLighting")]
|
||||
public static class DayCycleManager_UpdateLighting_Patch
|
||||
{
|
||||
static float dptmp;
|
||||
public static void Prefix(DayCycleManager __instance)
|
||||
{
|
||||
dptmp = __instance.m_DayPercentage;
|
||||
__instance.m_DayPercentage = 0;
|
||||
__instance.m_DisablingLensFlarePercentage = -1;
|
||||
}
|
||||
public static void Postfix(DayCycleManager __instance)
|
||||
{
|
||||
__instance.m_DayPercentage = dptmp;
|
||||
}
|
||||
}
|
||||
[HarmonyPatch(typeof(DayCycleManager), "DayCycle")]
|
||||
public static class DayCycleManager_DayCycle_Patch
|
||||
{
|
||||
public static void Prefix(DayCycleManager __instance)
|
||||
{
|
||||
__instance.m_DisablingLensFlarePercentage = -1;
|
||||
}
|
||||
}
|
||||
[HarmonyPatch(typeof(DayCycleManager), "StartNextDay")]
|
||||
public static class DayCycleManager_StartNextDay_Patch
|
||||
{
|
||||
public static void Prefix(DayCycleManager __instance)
|
||||
{
|
||||
__instance.m_DisablingLensFlarePercentage = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue