From a6eadbb1bb657db79dcaba49788651e100865b86 Mon Sep 17 00:00:00 2001 From: rushiiMachine <33725716+rushiiMachine@users.noreply.github.com> Date: Wed, 27 Mar 2024 21:29:26 -0700 Subject: [PATCH] comments --- .../Patches/LivePerformance/PatchTrackOnScoreHit.cs | 3 ++- Osu.Patcher.Hook/Patches/LivePerformance/PerformanceDisplay.cs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Osu.Patcher.Hook/Patches/LivePerformance/PatchTrackOnScoreHit.cs b/Osu.Patcher.Hook/Patches/LivePerformance/PatchTrackOnScoreHit.cs index 6f0ffb2..09f3d1e 100644 --- a/Osu.Patcher.Hook/Patches/LivePerformance/PatchTrackOnScoreHit.cs +++ b/Osu.Patcher.Hook/Patches/LivePerformance/PatchTrackOnScoreHit.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics.CodeAnalysis; using System.Reflection; +using System.Threading.Tasks; using HarmonyLib; using JetBrains.Annotations; using Osu.Performance; @@ -52,7 +53,7 @@ private static void After( var CurrentScore = Ruleset.CurrentScore.Get(__instance); var MaxCombo = Score.MaxCombo.Get(CurrentScore); - PerformanceCalculator.Calculator?.AddJudgement(judgement, (uint)MaxCombo); + Task.Run(() => PerformanceCalculator.Calculator?.AddJudgement(judgement, (uint)MaxCombo)); } [UsedImplicitly] diff --git a/Osu.Patcher.Hook/Patches/LivePerformance/PerformanceDisplay.cs b/Osu.Patcher.Hook/Patches/LivePerformance/PerformanceDisplay.cs index a580c06..3372f03 100644 --- a/Osu.Patcher.Hook/Patches/LivePerformance/PerformanceDisplay.cs +++ b/Osu.Patcher.Hook/Patches/LivePerformance/PerformanceDisplay.cs @@ -27,6 +27,7 @@ public static void UpdatePerformanceCounter(double pp) if (!PerformanceCounter.TryGetTarget(out var sprite) || sprite == null) return; + // Technically this should be run with "GameBase.Scheduler.AddOnce(() => ...)" but it works anyways, so... pText.SetText.Invoke(sprite, [$"{pp:00.0}pp"]); } catch (Exception e)