mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
Cache version result in patch
This commit is contained in:
parent
a4fd3aa42c
commit
26263cb848
@ -26,6 +26,8 @@ namespace Aki.Debugging.Patches
|
||||
|
||||
public class DebugLogoPatch2 : ModulePatch
|
||||
{
|
||||
private static string sptVersion;
|
||||
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
return AccessTools.Method(typeof(ClientWatermark), nameof(ClientWatermark.method_0));
|
||||
@ -33,11 +35,14 @@ namespace Aki.Debugging.Patches
|
||||
|
||||
[PatchPostfix]
|
||||
private static void patchPostfix(ref TextMeshProUGUI ____label, Profile ___profile_0)
|
||||
{
|
||||
if (sptVersion is null)
|
||||
{
|
||||
var json = RequestHandler.GetJson("/singleplayer/settings/version");
|
||||
var result = Json.Deserialize<VersionResponse>(json).Version;
|
||||
sptVersion = Json.Deserialize<VersionResponse>(json).Version;
|
||||
}
|
||||
|
||||
____label.text = $"SPT BLEEDINGEDGE \n {result} \n {___profile_0.Nickname} \n {GClass1296.Now.ToString("HH:mm:ss")}";
|
||||
____label.text = $"SPT BLEEDINGEDGE \n {sptVersion} \n {___profile_0.Nickname} \n {GClass1296.Now.ToString("HH:mm:ss")}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user