forked from iZastic/vrising-introskip
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntroSkipPlugin.cs
More file actions
34 lines (30 loc) · 964 Bytes
/
IntroSkipPlugin.cs
File metadata and controls
34 lines (30 loc) · 964 Bytes
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
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using ProjectM.UI;
namespace IntroSkip
{
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
public class IntroSkipPlugin : BasePlugin
{
private static ManualLogSource Logger;
private Harmony harmony;
public override void Load()
{
Logger = Log;
harmony = Harmony.CreateAndPatchAll(typeof(IntroSkipPlugin));
// Plugin startup logic
Log.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");
}
[HarmonyPrefix]
[HarmonyPatch(typeof(StartGameLoadMenuView), nameof(StartGameLoadMenuView.Update))]
private static void UpdatePrefix(StartGameLoadMenuView __instance)
{
if (__instance.VideoPlayer.isPlaying)
{
__instance.VideoPlayer.Stop();
}
}
}
}