Merge branch 'feature/scripted-stages' of github.com:ninjamuffin99/Funkin-secret into feature/scripted-stages

This commit is contained in:
Eric Myllyoja 2022-03-09 10:36:39 -05:00
commit 19cda4ed15
2 changed files with 23 additions and 12 deletions

View file

@ -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;

View file

@ -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.
*/