Fontifier
Lets you change the font for other mods.
截圖 共 4 張
模組介紹 作者原文
Fontifier
What is this?
This mod lets you change the font of other mods' text. It also allows people to use this in their own mods (see 'For Devs').
Instructions
- Install MelonLoader
- Run RUMBLE without mods
- Drop Mods from.zip into RUMBLE's installation folder
- Drop UserData from.zip into RUMBLE's installation folder
- Drop UserLibs from.zip into RUMBLE's installation folder
- Install dependencies
- RumbleModdingAPI
- RumbleModUI
- RumbleModUIPlus
- Play RUMBLE!
Supported mods
| HealthDisplayWithFont | TournamentScoringMod | MatchInfo |
|--|--|--|
| | | |
Choose a font
- Move any.ttf or.otf fonts into UserData\Fontifier\fonts
- Press F10 to open Mod UI
- Go to Fontifier in the dropdown
- In the second dropdown, select 'Fonts List'
- Find the name of the font you want
- In the second dropdown, select any mod
- Type in the name of the font you want (case-insensitive) and hit enter
- If it looks good, hit save
"I can't type in ModUI"
If you have UnityExplorer, hit F7 first. If not, ask the discord.
"It's not saving"
Make sure to press enter and then hit save. If you are, ask the discord.
For Devs
For Devs
If you create a TextMeshPro (or similar) in your mod and want to use Fontifier with it, here's how to do it.
First, choose if you want Fontifier to be a required dependency or optional dependency.
Required
- You will need the following usings:
using Il2CppTMPro;
using MelonLoader;
using static Fontifier.Fontifier;
// The following is needed if ImplicitUsings are disabled
using System;
- And these dll refrences:
- net6
- MelonLoader.dll
- Il2CppAssemblies
- Unity.TextMeshPro.dll
- Mods
- Fontifier.dll
- And this code if your code will modify the returned font: (safest)
Whenever you call a method, it will create a new instance of the font unless you specify cache.
Caching will make it so that when you call those methods and get a font, if you call it again, it won't make a new one unless your mod has not called this method for that specific font yet. Each mod has its own cache.
If you want this, wherever it says [CACHE], replace it with true. Otherwise, replace it with false. Caching is recommended.
(Place this in your MelonMod class)
region Fontifier
private static Func GetFont;
///
public override void OnInitializeMelon()
{
GetFont = RegisterModWithReferenceCopy(this.Info.Name, new EventHandler(FontChanged));
}
private static void FontChanged(object sender, EventArgs args)
{
// Change your TextMeshPro.font to the new font.
TextMeshProInstance.font = FontFromNameCopy(this.Info.Name, ((dynamic)args).Value, [CACHE]);
}
endregion
ALSO: When you create the TextMeshPro, make sure to TextMeshProInstance.font = GetFont([CACHE]);
- And this code if your code will only use the font to set the font for text and will not modify it:
The returned font, if modified, will modify EVERY MOD'S FONTS. Only use this if needed. The font could be modified in unexpected ways. In most cases, the above is best option because of its safety. This is mostly here for legacy support.
(Place this in your MelonMod class)
region Fontifier
private static Func GetFont;
///
public override void OnInitializeMelon()
{
GetFont = RegisterModWithReference(this.Info.Name, new EventHandler(FontChanged));
}
private static void FontChanged(object sender, EventArgs args)
{
// Change your TextMeshPro.font to the new font.
TextMeshProInstance.font = FontFromName(((dynamic)args).Value);
}
endregion
ALSO: When you create the TextMeshPro, make sure to TextMeshProInstance.font = GetFont();
Optional
- You will need the following usings:
using Il2CppTMPro;
using MelonLoader;
using System.Reflection;
// The following is needed if ImplicitUsings is disabled
using System;
- And these dll refrences:
- net6
- MelonLoader.dll
- Il2CppAssemblies
- Unity.TextMeshPro.dll
- And this code if your code will modify the returned font: (safest)
Whenever you call a method,
安裝與使用 安裝:按包內說明操作
- 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
- 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
- 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
- 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。
不同模組的安裝位置差異較大,包內說明是最可靠的依據。
下面這些內容需要先安裝,否則該模組不會生效: