From fd0c188577cf58e34e8ed706e59903a989ee2d11 Mon Sep 17 00:00:00 2001 From: Ne_Eo Date: Mon, 16 Dec 2024 03:21:04 +0100 Subject: [PATCH] Added some flags for Transition/Pause/Gameover --- source/funkin/backend/MusicBeatTransition.hx | 2 +- source/funkin/backend/system/Flags.hx | 7 +++++++ source/funkin/backend/system/MainState.hx | 2 +- source/funkin/game/GameOverSubstate.hx | 2 +- source/funkin/game/PlayState.hx | 4 ++-- source/funkin/menus/PauseSubState.hx | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/source/funkin/backend/MusicBeatTransition.hx b/source/funkin/backend/MusicBeatTransition.hx index bd3a23c0..0cb44df0 100644 --- a/source/funkin/backend/MusicBeatTransition.hx +++ b/source/funkin/backend/MusicBeatTransition.hx @@ -8,7 +8,7 @@ import funkin.backend.scripting.events.TransitionCreationEvent; import funkin.backend.utils.FunkinParentDisabler; class MusicBeatTransition extends MusicBeatSubstate { - public static var script:String = ""; + public static var script:String = Flags.DEFAULT_TRANSITION_SCRIPT; public var transitionScript:Script; var nextFrameSkip:Bool = false; diff --git a/source/funkin/backend/system/Flags.hx b/source/funkin/backend/system/Flags.hx index f7c00e52..1f3d3f84 100644 --- a/source/funkin/backend/system/Flags.hx +++ b/source/funkin/backend/system/Flags.hx @@ -135,6 +135,13 @@ class Flags { public static var DISABLE_EDITORS:Bool = false; public static var DISABLE_BETA_WARNING_SCREEN:Bool = false; public static var DISABLE_TRANSITIONS:Bool = false; + + @:also(funkin.backend.MusicBeatTransition.script) + public static var DEFAULT_TRANSITION_SCRIPT:String = ""; + @:also(funkin.menus.PauseSubState.script) + public static var DEFAULT_PAUSE_SCRIPT:String = ""; + @:also(funkin.game.GameOverSubstate.script) + public static var DEFAULT_GAMEOVER_SCRIPT:String = ""; // -- End of Codename's Default Flags -- /** diff --git a/source/funkin/backend/system/MainState.hx b/source/funkin/backend/system/MainState.hx index cebf218a..0aa26a09 100644 --- a/source/funkin/backend/system/MainState.hx +++ b/source/funkin/backend/system/MainState.hx @@ -58,7 +58,7 @@ class MainState extends FlxState { Flags.load(); ModsFolder.onModSwitch.dispatch(ModsFolder.currentModFolder); // Loads global.hx - MusicBeatTransition.script = ""; + MusicBeatTransition.script = Flags.DEFAULT_TRANSITION_SCRIPT; Main.refreshAssets(); DiscordUtil.init(); EventsData.reloadEvents(); diff --git a/source/funkin/game/GameOverSubstate.hx b/source/funkin/game/GameOverSubstate.hx index a871422f..2d7af30d 100644 --- a/source/funkin/game/GameOverSubstate.hx +++ b/source/funkin/game/GameOverSubstate.hx @@ -24,7 +24,7 @@ class GameOverSubstate extends MusicBeatSubstate var camFollow:FlxObject; - public static var script:String = ""; + public static var script:String = Flags.DEFAULT_GAMEOVER_SCRIPT; public var gameoverScript:Script; public var game:PlayState = PlayState.instance; // shortcut diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 0f0f8c73..4344acec 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -586,8 +586,8 @@ class PlayState extends MusicBeatState instance = this; if (FlxG.sound.music != null) FlxG.sound.music.stop(); - PauseSubState.script = ""; - GameOverSubstate.script = ""; + PauseSubState.script = Flags.DEFAULT_PAUSE_SCRIPT; + GameOverSubstate.script = Flags.DEFAULT_GAMEOVER_SCRIPT; (scripts = new ScriptPack("PlayState")).setParent(this); camGame = camera; diff --git a/source/funkin/menus/PauseSubState.hx b/source/funkin/menus/PauseSubState.hx index b543742a..096ea443 100644 --- a/source/funkin/menus/PauseSubState.hx +++ b/source/funkin/menus/PauseSubState.hx @@ -18,7 +18,7 @@ import funkin.options.TreeMenu; class PauseSubState extends MusicBeatSubstate { - public static var script:String = ""; + public static var script:String = Flags.DEFAULT_PAUSE_SCRIPT; var grpMenuShit:FlxTypedGroup;