-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathPlugin.cs
107 lines (87 loc) · 4.45 KB
/
Plugin.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
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
using BepInEx;
#if !BEPIN_5
using BepInEx.Unity.IL2CPP;
#endif
using BepInEx.Configuration;
using HarmonyLib;
namespace TaikoModStuff
{
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
#if !BEPIN_5
public class Plugin : BasePlugin
#else
public class Plugin : BaseUnityPlugin
#endif
{
public static ConfigEntry<bool> configForceFontChange;
public static ConfigEntry<int> configCustomWindowedWidth;
public static ConfigEntry<int> configCustomWindowedHeight;
public static ConfigEntry<int> configCustomFramerate;
public static ConfigEntry<bool> configToggleVSync;
public static ConfigEntry<bool> configEnableRecording;
public static ConfigEntry<bool> configOfflineSaveLoad;
public static ConfigEntry<bool> configQuickRestart;
public static ConfigEntry<bool> configQuickQuitSong;
#if !BEPIN_5
public override void Load()
#else
private void Awake()
#endif
{
// Add configurations
configForceFontChange = Config.Bind("General.Toggles",
"ForceFontChange",
false,
"Force the game font to the JP font");
configCustomWindowedWidth = Config.Bind("General.Resolution",
"CustomWidth",
1920,
"Custom width to use. Set to 0 to disable setting the custom resolution");
configCustomWindowedHeight = Config.Bind("General.Resolution",
"CustomHeight",
1080,
"Custom height to use");
configCustomFramerate = Config.Bind("General.Framerate",
"CustomFramerate",
60,
"Custom framerate.");
configToggleVSync = Config.Bind("General.Graphics",
"EnableVSync",
true,
"Enable VSync.");
configEnableRecording = Config.Bind("General.Toggles",
"EnableGameBarRecording",
true,
"Enables Game Recording from the Xbox Game Bar where it was previously disabled.");
configOfflineSaveLoad = Config.Bind("General.Toggles",
"OfflineSaveLoad",
false,
"Loads local save files even when offline. Bypasses the log-in checks. Requires the FreeLocalSaves Plugin.\nEnabling this without FreeLocalSaves can and will wipe your save file.");
configQuickRestart = Config.Bind("General.Toggles",
"QuickRestart",
false,
"Hit \"Backspace\" on your keyboard to quickly restart a song.");
configQuickQuitSong = Config.Bind("General.Toggles",
"QuickQuitSong",
false,
"Hit \"Escape\" on your keyboard to quickly quit a song and return to Song Select.");
var instance = new Harmony(MyPluginInfo.PLUGIN_NAME);
instance.PatchAll(typeof(FontChanger));
instance.PatchAll(typeof(CustomResolution));
instance.PatchAll(typeof(ForceFramerate));
instance.PatchAll(typeof(RecordingEnable));
if (Plugin.configOfflineSaveLoad.Value)
instance.PatchAll(typeof(OfflineSaveLoad));
if (Plugin.configQuickRestart.Value)
instance.PatchAll(typeof(QuickRestart));
if (Plugin.configQuickQuitSong.Value)
instance.PatchAll(typeof(QuickQuitSong));
// Plugin startup logic
#if !BEPIN_5
Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!");
#else
Logger.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!");
#endif
}
}
}