diff --git a/source/funkin/data/stage/StageData.hx b/source/funkin/data/stage/StageData.hx index eda8e31481..a67762ac9a 100644 --- a/source/funkin/data/stage/StageData.hx +++ b/source/funkin/data/stage/StageData.hx @@ -20,6 +20,10 @@ class StageData @:optional public var cameraZoom:Null; + @:default("shared") + @:optional + public var directory:Null; + public function new() { this.version = StageRegistry.STAGE_DATA_VERSION; @@ -182,6 +186,32 @@ typedef StageDataProp = @:default("sparrow") @:optional var animType:String; + + /** + * The angle of the prop, as a float. + * @default 1.0 + */ + @:optional + @:default(0.0) + var angle:Float; + + /** + * The blend mode of the prop, as a string. + * Just like in photoshop. + * @default Nothing. + */ + @:default("") + @:optional + var blend:String; + + /** + * The color of the prop overlay, as a hex string. + * White overlays, or the ones with the value #FFFFFF, do not appear. + * @default `#FFFFFF` + */ + @:default("#FFFFFF") + @:optional + var color:String; }; typedef StageDataCharacter = diff --git a/source/funkin/play/stage/Stage.hx b/source/funkin/play/stage/Stage.hx index c42e41cadb..c4d8585a00 100644 --- a/source/funkin/play/stage/Stage.hx +++ b/source/funkin/play/stage/Stage.hx @@ -256,6 +256,10 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements propSprite.scrollFactor.x = dataProp.scroll[0]; propSprite.scrollFactor.y = dataProp.scroll[1]; + propSprite.angle = dataProp.angle; + propSprite.color = FlxColor.fromString(dataProp.color); + propSprite.blend = BlendMode.fromString(dataProp.blend); + propSprite.zIndex = dataProp.zIndex; switch (dataProp.animType) diff --git a/source/funkin/ui/transition/LoadingState.hx b/source/funkin/ui/transition/LoadingState.hx index 5b82cc7416..69e4bd7f0e 100644 --- a/source/funkin/ui/transition/LoadingState.hx +++ b/source/funkin/ui/transition/LoadingState.hx @@ -87,7 +87,7 @@ class LoadingState extends MusicBeatSubState } checkLibrary('shared'); - checkLibrary(PlayStatePlaylist.campaignId); + checkLibrary(stageDirectory); checkLibrary('tutorial'); var fadeTime:Float = 0.5; @@ -205,6 +205,8 @@ class LoadingState extends MusicBeatSubState return Paths.inst(PlayState.instance.currentSong.id); } + static var stageDirectory:String = "shared"; + /** * Starts the transition to a new `PlayState` to start a new song. * First switches to the `LoadingState` if assets need to be loaded. @@ -214,7 +216,13 @@ class LoadingState extends MusicBeatSubState */ public static function loadPlayState(params:PlayStateParams, shouldStopMusic = false, asSubState = false, ?onConstruct:PlayState->Void):Void { - Paths.setCurrentLevel(PlayStatePlaylist.campaignId); + var daChart = params.targetSong.getDifficulty(params.targetDifficulty ?? Constants.DEFAULT_DIFFICULTY, + params.targetVariation ?? Constants.DEFAULT_VARIATION); + + var daStage = funkin.data.stage.StageRegistry.instance.fetchEntry(daChart.stage); + stageDirectory = daStage.directory ?? "shared"; + Paths.setCurrentLevel(stageDirectory); + var playStateCtor:() -> PlayState = function() { return new PlayState(params); };