Rizu/Rizu.MonoMod/patch_UserDetail.cs

29 lines
694 B
C#
Raw Normal View History

2024-05-21 20:29:18 +00:00
// ReSharper disable CheckNamespace
// ReSharper disable InconsistentNaming
using MAI2.Util;
using Rizu.Core;
using Rizu.MonoMod;
2024-05-21 20:29:18 +00:00
namespace Manager.UserDatas;
public class patch_UserDetail : UserDetail
{
private extern void orig_set_CourseRank(uint value);
public void set_CourseRank(uint value)
{
var prevValue = CourseRank;
2024-05-21 20:29:18 +00:00
orig_set_CourseRank(value);
// Don't send an import if it's the same rank
if (value == prevValue || value == 0)
2024-05-21 20:29:18 +00:00
{
return;
}
SingletonMonoBehaviour<RizuMonoBehaviour>.instance.StartCoroutine(Exporter.Instance.ExportDan(this));
2024-05-21 20:29:18 +00:00
}
}