bye onDestroy

from lunar suggestion since it was confusing as fuckkk😭
This commit is contained in:
⍚~Nex
2024-02-03 03:37:48 +01:00
parent 693ab305bb
commit cc23e4c24f
11 changed files with 10 additions and 20 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -240,7 +240,7 @@ class MusicBeatState extends FlxState implements IBeatReceiver
public override function destroy() {
super.destroy();
graphicCache.destroy();
call("onDestroy");
call("destroy");
stateScripts = FlxDestroyUtil.destroy(stateScripts);
}
+1 -1
View File
@@ -228,7 +228,7 @@ class MusicBeatSubstate extends FlxSubState implements IBeatReceiver
public override function destroy() {
super.destroy();
call("onDestroy");
call("destroy");
stateScripts = FlxDestroyUtil.destroy(stateScripts);
}
@@ -87,7 +87,7 @@ class GlobalScript {
if (scripts != null) scripts.call(name, args);
}
public static function onModSwitch(newMod:String) {
call("onDestroy");
call("destroy");
scripts = FlxDestroyUtil.destroy(scripts);
scripts = new ScriptPack("GlobalScript");
for (i in funkin.backend.assets.ModsFolder.getLoadedMods()) {
@@ -171,8 +171,4 @@ class HScript extends Script {
public override function setPublicMap(map:Map<String, Dynamic>) {
this.interp.publicVariables = map;
}
public override function onDestroy() {
super.onDestroy();
}
}
@@ -82,7 +82,7 @@ class MultiThreadedScript implements IFlxDestroyable implements IHScriptCustomBe
public function destroy() {
if (script != null) {
script.call("onDestroy");
script.call("destroy");
script.destroy();
}
@@ -305,11 +305,4 @@ class Script extends FlxBasic implements IFlxDestroyable {
public function onCreate(path:String) {}
public function onLoad() {}
public function onDestroy() {};
public override function destroy() {
super.destroy();
onDestroy();
}
}
@@ -95,7 +95,8 @@ class ScriptPack extends Script {
for(e in scripts) e.setParent(parent);
}
public override function onDestroy() {
public override function destroy() {
super.destroy();
for(e in scripts) e.destroy();
}
+1 -1
View File
@@ -183,7 +183,7 @@ class GameOverSubstate extends MusicBeatSubstate
override function destroy()
{
gameoverScript.call("onDestroy");
gameoverScript.call("destroy");
gameoverScript.destroy();
super.destroy();
+1 -1
View File
@@ -164,7 +164,7 @@ class PauseSubState extends MusicBeatSubstate
{
if(FlxG.cameras.list.contains(camera))
FlxG.cameras.remove(camera, true);
pauseScript.call("onDestroy");
pauseScript.call("destroy");
pauseScript.destroy();
if (pauseMusic != null)