From b92e0ec4b7539354ea883373856f6d971824d82f Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Wed, 28 Dec 2022 17:35:11 +0100 Subject: [PATCH] variable duplication fix --- source/funkin/menus/FreeplayState.hx | 1 - source/funkin/menus/PauseSubState.hx | 7 +------ source/funkin/menus/StoryMenuState.hx | 2 -- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/source/funkin/menus/FreeplayState.hx b/source/funkin/menus/FreeplayState.hx index c35c32fa..d254dee0 100644 --- a/source/funkin/menus/FreeplayState.hx +++ b/source/funkin/menus/FreeplayState.hx @@ -66,7 +66,6 @@ class FreeplayState extends MusicBeatState // Updating Discord Rich Presence DiscordClient.changePresence("In the Menus", null); #end - StoryMenuState.playStoryMode = false; // LOAD CHARACTERS diff --git a/source/funkin/menus/PauseSubState.hx b/source/funkin/menus/PauseSubState.hx index 0dc11d1f..12b1da42 100644 --- a/source/funkin/menus/PauseSubState.hx +++ b/source/funkin/menus/PauseSubState.hx @@ -148,12 +148,7 @@ class PauseSubState extends MusicBeatSubstate case "Options": FlxG.switchState(new OptionsMenu(true)); case "Exit to menu": - if(StoryMenuState.playStoryMode){ - FlxG.switchState(new StoryMenuState()); - } - else{ - FlxG.switchState(new FreeplayState()); - } + FlxG.switchState(PlayState.isStoryMode ? new StoryMenuState() : new FreeplayState()); FlxG.sound.playMusic(Paths.music('freakyMenu')); } diff --git a/source/funkin/menus/StoryMenuState.hx b/source/funkin/menus/StoryMenuState.hx index 7b708bf4..49c8dcfd 100644 --- a/source/funkin/menus/StoryMenuState.hx +++ b/source/funkin/menus/StoryMenuState.hx @@ -43,12 +43,10 @@ class StoryMenuState extends MusicBeatState { public var characterSprites:FlxTypedGroup; public var charFrames:Map = []; - public static var playStoryMode:Bool; public override function create() { super.create(); loadXMLs(); - StoryMenuState.playStoryMode = true; persistentUpdate = persistentDraw = true; // WEEK INFO