Skip to content
This repository has been archived by the owner on Feb 3, 2024. It is now read-only.

Commit

Permalink
✨ Replace Edit Undo BRK and Press Start 2P
Browse files Browse the repository at this point in the history
  • Loading branch information
Chasmical committed Aug 19, 2022
1 parent 4b9899a commit 627bb5c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions BetterFonts/BetterFontsPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public class BetterFontsPlugin : BepInEx.BaseUnityPlugin
{
private static Font? MunroExtended;
private static Font? FusionPixel;
private static Font? EditUndoBRK;
private static Font? PressStart2P;
public void Awake()
{
Harmony harmony = new Harmony(Info.Metadata.GUID);
Expand Down Expand Up @@ -38,6 +40,8 @@ public IEnumerator Start()
yield return req;
MunroExtended = req.assetBundle.LoadAsset<Font>("MunroExtended");
FusionPixel = req.assetBundle.LoadAsset<Font>("FusionPixel");
EditUndoBRK = req.assetBundle.LoadAsset<Font>("EditUndoBRK");
PressStart2P = req.assetBundle.LoadAsset<Font>("PressStart2P-Regular");
}
public static void GameController_Update(GameController __instance)
{
Expand All @@ -55,8 +59,20 @@ public static void GameController_Update(GameController __instance)
public static bool GameController_SetFont(GameController __instance, Text myText)
{
string language = __instance.sessionDataBig.gameLanguage;
Font? font = language is @"schinese" or @"koreana" ? FusionPixel : MunroExtended;
if (font is not null) myText.font = font;
if (language is @"schinese" or @"koreana")
{
myText.font = FusionPixel;
}
else
{
myText.font = myText.font.name switch
{
"Munro" or "munro2" or "munro-expanded" or "MunroNarrow" or "MunroExtended" or "FusionPixel" => MunroExtended,
@"editundo" or "EditUndoBRK" => EditUndoBRK,
@"joystix monospace" or "PressStart2P-Regular" => PressStart2P,
_ => MunroExtended,
};
}
return false;
}
public static void MenuButtonHelper_SetupText3(MenuButtonHelper __instance)
Expand Down
Binary file modified BetterFonts/Resources/betterfonts.assets
Binary file not shown.

0 comments on commit 627bb5c

Please sign in to comment.