From ca0853615b8a4af3a21a395c306314f67678dca1 Mon Sep 17 00:00:00 2001 From: Ralty <78720179+Raltyro@users.noreply.github.com> Date: Wed, 1 Apr 2026 07:31:50 +0700 Subject: [PATCH] Fix for long loading screen for a specific mod --- source/funkin/backend/assets/AssetsLibraryList.hx | 13 +++++++++++-- source/funkin/backend/system/Main.hx | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/source/funkin/backend/assets/AssetsLibraryList.hx b/source/funkin/backend/assets/AssetsLibraryList.hx index 0108a047..4d1e7f81 100644 --- a/source/funkin/backend/assets/AssetsLibraryList.hx +++ b/source/funkin/backend/assets/AssetsLibraryList.hx @@ -8,7 +8,6 @@ import lime.utils.AssetLibrary; import haxe.ds.Map; class AssetsLibraryList extends AssetLibrary { - public var libraries:Array = []; public var cleanLibraries(get, never):Array; function get_cleanLibraries():Array { @@ -32,6 +31,7 @@ class AssetsLibraryList extends AssetLibrary { #end private var cachePaths:Map = []; + private var cacheNonExistentPaths:Map = []; public function removeLibrary(lib:AssetLibrary) { if (lib != null) { @@ -58,18 +58,27 @@ class AssetsLibraryList extends AssetLibrary { return true; // There's a mod that heavily relies on addons and that can causes lags just to get a path. - if (cachePaths.exists(id)) { + final sec = Date.now().getSeconds(); + if (cacheNonExistentPaths.exists(id) && sec - 10 < cacheNonExistentPaths.get(id)) { + return false; + } + else if (cachePaths.exists(id)) { if (cachePaths.get(id).exists(id, type)) return true; else cachePaths.remove(id); } + for(k=>l in libraries) { if (shouldSkipLib(l, source)) continue; if (l.exists(id, type)) { + //trace("EXISTS", id, type, source); cachePaths.set(id, l); return true; } } + + //trace("DOESNT EXISTS", id, type, source); + cacheNonExistentPaths.set(id, sec); return false; } public override inline function exists(id:String, type:String):Bool diff --git a/source/funkin/backend/system/Main.hx b/source/funkin/backend/system/Main.hx index 1b07376c..ed033baf 100644 --- a/source/funkin/backend/system/Main.hx +++ b/source/funkin/backend/system/Main.hx @@ -125,8 +125,8 @@ class Main extends Sprite funkin.options.PlayerSettings.init(); Options.load(); + game.focusLostFramerate = 30; FlxG.fixedTimestep = false; - FlxG.scaleMode = scaleMode = new FunkinRatioScaleMode(); Conductor.init();