From 6d6374eda31a0cfe601181a7a04756e718037aff Mon Sep 17 00:00:00 2001 From: Repflez <659133+Repflez@users.noreply.github.com> Date: Thu, 27 Jan 2022 10:36:07 -0700 Subject: [PATCH] feat: Add the actual code of the mod --- .gitignore | 5 ++++- FontChanger.cs | 19 +++++++++++++++++++ Plugin.cs | 7 ++++++- TaikoModStuff.csproj | 7 +++++++ lib/.gitkeep | 0 5 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 FontChanger.cs create mode 100644 lib/.gitkeep diff --git a/.gitignore b/.gitignore index 9491a2f..5db09c4 100644 --- a/.gitignore +++ b/.gitignore @@ -360,4 +360,7 @@ MigrationBackup/ .ionide/ # Fody - auto-generated XML schema -FodyWeavers.xsd \ No newline at end of file +FodyWeavers.xsd + +# Ignore game data +lib/Assembly-CSharp.dll \ No newline at end of file diff --git a/FontChanger.cs b/FontChanger.cs new file mode 100644 index 0000000..00bf052 --- /dev/null +++ b/FontChanger.cs @@ -0,0 +1,19 @@ +using HarmonyLib; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TaikoModStuff +{ + internal class FontChanger + { + [HarmonyPatch(typeof(WordDataManager), "GetFontType")] + [HarmonyPostfix] + static void GetFontType_Patched(ref int __result) + { + __result = 0; // Force the font to the JP one. + } + } +} diff --git a/Plugin.cs b/Plugin.cs index f077122..29dfcc6 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -1,12 +1,17 @@ using BepInEx; +using HarmonyLib; namespace TaikoModStuff { - [BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)] + [BepInPlugin("com.github.Repflez.TaikoModStuff", PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)] public class Plugin : BaseUnityPlugin { private void Awake() { + + var instance = new Harmony(PluginInfo.PLUGIN_NAME); + instance.PatchAll(typeof(FontChanger)); + // Plugin startup logic Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!"); } diff --git a/TaikoModStuff.csproj b/TaikoModStuff.csproj index 7a5ec40..6b8dee5 100644 --- a/TaikoModStuff.csproj +++ b/TaikoModStuff.csproj @@ -19,4 +19,11 @@ + + + + lib\Assembly-CSharp.dll + False + + diff --git a/lib/.gitkeep b/lib/.gitkeep new file mode 100644 index 0000000..e69de29