Skip to content

Commit

Permalink
UIState Reloading Fix (#469)
Browse files Browse the repository at this point in the history
* Reloading UIStates does not softlock anymore

* fix

* Removed all prev changes and use a better method

* Switch to tabs
  • Loading branch information
FuroYT authored Nov 30, 2024
1 parent eada310 commit 83cf69b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion source/funkin/backend/MusicBeatState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ class MusicBeatState extends FlxState implements IBeatReceiver

public var scriptsAllowed:Bool = true;

public static var lastScriptName:String = null;
public static var lastStateName:String = null;

public var scriptName:String = null;

public static var skipTransOut:Bool = false;
Expand All @@ -108,7 +111,12 @@ class MusicBeatState extends FlxState implements IBeatReceiver
public function new(scriptsAllowed:Bool = true, ?scriptName:String) {
super();
this.scriptsAllowed = #if SOFTCODED_STATES scriptsAllowed #else false #end;
this.scriptName = scriptName;

if(lastStateName != (lastStateName = Type.getClassName(Type.getClass(this)))) {
lastScriptName = null;
}
this.scriptName = scriptName != null ? scriptName : lastScriptName;
lastScriptName = this.scriptName;
}

function loadScript() {
Expand Down

0 comments on commit 83cf69b

Please sign in to comment.