mirror of
https://gitea.tendokyu.moe/beerpsi/Rizu.git
synced 2024-11-30 18:24:31 +01:00
38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using System.Reflection;
|
|
using Game;
|
|
using HarmonyLib;
|
|
using Manager;
|
|
using Rizu.Core;
|
|
|
|
namespace Rizu.BepInEx;
|
|
|
|
[HarmonyPatch(typeof(GameScoreList))]
|
|
public class PatchGameScoreList
|
|
{
|
|
// New field introduced in SDEZ 1.40 (maimai DX BUDDiES)
|
|
private static readonly FieldInfo UtageKanjiTextField = typeof(SessionInfo)
|
|
.GetField("utageKanjiText", BindingFlags.Instance | BindingFlags.Public);
|
|
|
|
// ReSharper disable once InconsistentNaming
|
|
[HarmonyPatch(nameof(GameScoreList.SetPlayAfterRate))]
|
|
[HarmonyPostfix]
|
|
private static void SetPlayAfterRatePostfix(GameScoreList __instance, int musicRate, int danRate, UdemaeID dan, int classValue)
|
|
{
|
|
if (!__instance.IsEnable)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (__instance.SessionInfo.isAdvDemo || __instance.SessionInfo.isTutorial)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (UtageKanjiTextField != null && !string.IsNullOrEmpty((string)UtageKanjiTextField.GetValue(__instance.SessionInfo)))
|
|
{
|
|
return;
|
|
}
|
|
|
|
RizuPlugin.Instance.StartCoroutine(Exporter.Instance.ExportScore(__instance));
|
|
}
|
|
} |