From 45b9d725f20ea7cc81773310b24e54f047ddc51e Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 9 Mar 2022 10:29:03 -0500 Subject: [PATCH] tankman cloud reset? --- source/funkin/play/PlayState.hx | 24 +++++++++++++----------- source/funkin/play/stage/Stage.hx | 11 ++++++++++- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index f776cdfd9..7578e39f9 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; @@ -1577,6 +1577,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. */