mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
Replace hard coded method name in BetaLogoPatch (!138)
No more having to update the method name Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com> Reviewed-on: SPT/Modules#138 Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com> Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
This commit is contained in:
parent
6179c6b308
commit
5b5d498102
@ -6,6 +6,7 @@ using System.Reflection;
|
||||
using SPT.SinglePlayer.Utils.MainMenu;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SPT.SinglePlayer.Patches.MainMenu
|
||||
{
|
||||
@ -13,7 +14,17 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
||||
{
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
return AccessTools.Method(typeof(TarkovApplication), nameof(TarkovApplication.method_30));
|
||||
return AccessTools.FirstMethod(typeof(TarkovApplication), IsTargetMethod);
|
||||
}
|
||||
|
||||
private bool IsTargetMethod(MethodInfo method)
|
||||
{
|
||||
ParameterInfo[] parameters = method.GetParameters();
|
||||
|
||||
return method.ReturnType == typeof(Task)
|
||||
&& parameters.Length == 4
|
||||
&& parameters[0].ParameterType == typeof(Profile)
|
||||
&& parameters[1].ParameterType == typeof(ProfileStatusClass);
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
|
Loading…
x
Reference in New Issue
Block a user