@@ -14,7 +14,7 @@ import flixel.FlxState;
1414import flash .media .Sound ;
1515
1616import backend .Song ;
17- import stages .StageData ;
17+ import backend .StageData ;
1818import objects .Character ;
1919
2020import sys .thread .Thread ;
@@ -68,9 +68,6 @@ class LoadingState extends MusicBeatState
6868 var curPercent : Float = 0 ;
6969 var stateChangeDelay : Float = 0 ;
7070
71- public static var skipText : FlxText ;
72- public static var allowSkip : Bool = false ;
73-
7471 #if PSYCH_WATERMARKS
7572 var logo : FlxSprite ;
7673 var pessy : FlxSprite ;
@@ -92,15 +89,7 @@ class LoadingState extends MusicBeatState
9289 #end
9390 override function create ()
9491 {
95- @:privateAccess
96- if (PlayState ._lastLoadedModDirectory != Mods .currentModDirectory )
97- {
98- trace (' CHANGED MOD DIRECTORY, RELOADING STUFF' );
99- Paths .freeGraphicsFromMemory ();
100- }
101-
10292 persistentUpdate = true ;
103- allowSkip = false ;
10493 barGroup = new FlxSpriteGroup ();
10594 add (barGroup );
10695
@@ -119,12 +108,9 @@ class LoadingState extends MusicBeatState
119108 #if HSCRIPT_ALLOWED
120109 if (Mods .currentModDirectory != null && Mods .currentModDirectory .trim ().length > 0 )
121110 {
122- // mods/My-Mod/data/LoadingScreen.hx
123- // TODO: Figure out why the actual this thing isnt working
124- var scriptPath : String = ' mods/ ${Mods .currentModDirectory }/data/LoadingScreen' ;
111+ var scriptPath : String = ' mods/ ${Mods .currentModDirectory }/data/LoadingScreen.hx' ; // mods/My-Mod/data/LoadingScreen.hx
125112 if (FileSystem .exists (scriptPath ))
126113 {
127- trace (scriptPath );
128114 try
129115 {
130116 hscript = new HScript (null , scriptPath );
@@ -191,12 +177,6 @@ class LoadingState extends MusicBeatState
191177 funkay .updateHitbox ();
192178 addBehindBar (funkay );
193179 #end
194-
195- skipText = new FlxText (0 , barBack .y - 30 , " Press ESC to skip loading if it's stuck." );
196- skipText .size = 20 ;
197- skipText .alpha = 0 ;
198- skipText .screenCenter (X );
199- addBehindBar (skipText );
200180 super .create ();
201181
202182 if (stateChangeDelay <= 0 && checkLoaded ())
@@ -217,13 +197,6 @@ class LoadingState extends MusicBeatState
217197 super .update (elapsed );
218198 if (dontUpdate ) return ;
219199
220- if (allowSkip && controls. ACCEPT )
221- {
222- transitioning = true ;
223- onLoad ();
224- return ;
225- }
226-
227200 if (! transitioning )
228201 {
229202 if (! finishedLoading && checkLoaded ())
@@ -391,11 +364,6 @@ class LoadingState extends MusicBeatState
391364
392365 Paths .setCurrentLevel (directory );
393366 trace (' Setting asset folder to ' + directory );
394-
395- new FlxTimer ().start (5 , function (time : FlxTimer ){
396- FlxTween .tween (skipText , {alpha : 1 }, {ease : FlxEase .sineInOut });
397- allowSkip = true ;
398- });
399367 }
400368
401369 static var isIntrusive : Bool = false ;
@@ -405,8 +373,6 @@ class LoadingState extends MusicBeatState
405373 intrusive = false ;
406374 #end
407375
408- trace (target );
409-
410376 LoadingState .isIntrusive = intrusive ;
411377 _startPool ();
412378 loadNextDirectory ();
@@ -444,7 +410,13 @@ class LoadingState extends MusicBeatState
444410 static var dontPreloadDefaultVoices : Bool = false ;
445411 static function _startPool ()
446412 {
447- threadPool = new FixedThreadPool (#if MULTITHREADED_LOADING #if cpp getCPUThreadsCount () #else 8 #end #else 1 #end);
413+ #if MULTITHREADED_LOADING
414+ // Due to the Main thread and Discord thread, we decrease it by 2.
415+ var threadCount : Int = Std .int (Math .max (1 , getCPUThreadsCount () - #if DISCORD_ALLOWED 2 #else 1 #end));
416+ #else
417+ var threadCount : Int = 1 ;
418+ #end
419+ threadPool = new FixedThreadPool (threadCount );
448420 }
449421
450422 public static function prepareToSong ()
@@ -870,4 +842,4 @@ class LoadingState extends MusicBeatState
870842 return - 1 ;
871843 }
872844 #end
873- }
845+ }
0 commit comments