From bc4c944d4d3cfa45a93c02ab127ddfbd14fd3db2 Mon Sep 17 00:00:00 2001 From: MoonDroid <81515012+moondroidcoder@users.noreply.github.com> Date: Fri, 27 Jun 2025 07:28:53 +0700 Subject: [PATCH] Call GC after results if there is no stickers. --- source/funkin/play/ResultState.hx | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index f2f5bbb9f..314c2a3ed 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -48,6 +48,7 @@ import funkin.mobile.util.AdMobUtil; import funkin.mobile.util.InAppReviewUtil; #end #end +import funkin.util.DeviceUtil; /** * The state for the results screen after a song or week is finished. @@ -594,11 +595,12 @@ class ResultState extends MusicBeatSubState // ratingsPopin.animation.play("idle"); // ratingsPopin.visible = true; - ratingsPopin.animation.onFinish.add(anim -> { - // scorePopin.animation.play("score"); + ratingsPopin.animation.onFinish.add(anim -> + { + // scorePopin.animation.play("score"); - // scorePopin.visible = true; - }); + // scorePopin.visible = true; + }); } refresh(); @@ -1049,6 +1051,16 @@ class ResultState extends MusicBeatSubState } else { + FlxG.signals.preStateSwitch.addOnce(function() { + #if ios + trace(DeviceUtil.iPhoneNumber); + if (DeviceUtil.iPhoneNumber > 12) funkin.FunkinMemory.purgeCache(true); + else + funkin.FunkinMemory.purgeCache(); + #else + funkin.FunkinMemory.purgeCache(true); + #end + }); FlxG.switchState(() -> targetState); } } @@ -1069,6 +1081,16 @@ class ResultState extends MusicBeatSubState } else { + FlxG.signals.preStateSwitch.addOnce(function() { + #if ios + trace(DeviceUtil.iPhoneNumber); + if (DeviceUtil.iPhoneNumber > 12) funkin.FunkinMemory.purgeCache(true); + else + funkin.FunkinMemory.purgeCache(); + #else + funkin.FunkinMemory.purgeCache(true); + #end + }); FlxG.switchState(() -> targetState); } }