[+] toggle the display of self-made charts

This commit is contained in:
Clansty
2024-09-05 02:31:07 +08:00
parent ca425cf949
commit e8307cdcd9
11 changed files with 198 additions and 20 deletions

View File

@@ -0,0 +1,37 @@
using DB;
using HarmonyLib;
using Manager;
using MelonLoader;
using Process;
namespace AquaMai.Helpers;
public class MessageHelper
{
private static IGenericManager _genericManager = null;
[HarmonyPostfix]
[HarmonyPatch(typeof(ProcessManager), "SetMessageManager")]
private static void OnSetMessageManager(IGenericManager genericManager)
{
_genericManager = genericManager;
}
public static void ShowMessage(string message, WindowSizeID size = WindowSizeID.Middle)
{
if (_genericManager is null)
{
MelonLogger.Error($"[MessageHelper] Unable to show message: `{message}` GenericManager is null");
return;
}
_genericManager.Enqueue(0, WindowMessageID.CollectionAttentionEmptyFavorite, new WindowParam()
{
hideTitle = true,
replaceText = true,
text = message,
changeSize = true,
sizeID = size
});
}
}