Skip to content

Commit

Permalink
feat: Make the font config a configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Repflez committed Jan 27, 2022
1 parent 6d6374e commit a215cce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 2 additions & 6 deletions FontChanger.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TaikoModStuff
{
Expand All @@ -13,7 +8,8 @@ internal class FontChanger
[HarmonyPostfix]
static void GetFontType_Patched(ref int __result)
{
__result = 0; // Force the font to the JP one.
if (Plugin.configForceFontChange.Value)
__result = 0; // Force the font to the JP one.
}
}
}
8 changes: 8 additions & 0 deletions Plugin.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;

namespace TaikoModStuff
{
[BepInPlugin("com.github.Repflez.TaikoModStuff", PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
public class Plugin : BaseUnityPlugin
{
public static ConfigEntry<bool> configForceFontChange;

private void Awake()
{
// Add configurations
configForceFontChange = Config.Bind("General.Toggles",
"ForceFontChange",
false,
"Force the game font to the JP font");

var instance = new Harmony(PluginInfo.PLUGIN_NAME);
instance.PatchAll(typeof(FontChanger));
Expand Down

0 comments on commit a215cce

Please sign in to comment.