diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index b29dc61f7..811b86d3e 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -1,13 +1,12 @@ package funkin.play; -import funkin.charting.ChartingState; -import flixel.addons.effects.FlxTrail; -import flixel.addons.transition.FlxTransitionableState; import flixel.FlxCamera; import flixel.FlxObject; import flixel.FlxSprite; import flixel.FlxState; import flixel.FlxSubState; +import flixel.addons.effects.FlxTrail; +import flixel.addons.transition.FlxTransitionableState; import flixel.group.FlxGroup; import flixel.math.FlxMath; import flixel.math.FlxPoint; @@ -19,17 +18,18 @@ import flixel.ui.FlxBar; import flixel.util.FlxColor; import flixel.util.FlxSort; import flixel.util.FlxTimer; +import funkin.Note; +import funkin.Section.SwagSection; +import funkin.SongLoad.SwagSong; +import funkin.charting.ChartingState; +import funkin.play.stage.Stage; +import funkin.play.stage.StageData; +import funkin.shaderslmfao.ColorSwap; +import funkin.ui.PopUpStuff; +import funkin.ui.PreferencesMenu; import haxe.Json; import lime.ui.Haptic; import lime.utils.Assets; -import funkin.Note; -import funkin.play.stage.Stage; -import funkin.play.stage.StageData; -import funkin.Section.SwagSection; -import funkin.shaderslmfao.ColorSwap; -import funkin.SongLoad.SwagSong; -import funkin.ui.PopUpStuff; -import funkin.ui.PreferencesMenu; using StringTools; @@ -1574,6 +1574,8 @@ class PlayState extends MusicBeatState FlxG.sound.music.pause(); vocals.pause(); + curStage.resetStage(); + FlxG.sound.music.time = 0; regenNoteData(); // loads the note data from start health = 1; diff --git a/source/funkin/play/stage/Stage.hx b/source/funkin/play/stage/Stage.hx index 6a5b2b0ad..502e8ed76 100644 --- a/source/funkin/play/stage/Stage.hx +++ b/source/funkin/play/stage/Stage.hx @@ -1,8 +1,8 @@ package funkin.play.stage; -import flixel.math.FlxPoint; import flixel.FlxSprite; import flixel.group.FlxSpriteGroup; +import flixel.math.FlxPoint; import flixel.util.FlxSort; import funkin.modding.IHook; import funkin.play.character.Character.CharacterType; @@ -200,6 +200,15 @@ class Stage extends FlxSpriteGroup implements IHook trace('Stage sorted by z-index'); } + /** + * Resets the stage and it's props (needs to be overridden with your own logic!) + */ + public function resetStage() + { + // Override me in your script to reset stage shit however you please! + // also note: maybe add some default behaviour to reset stage stuff? + } + /** * A function that should get called every frame. */