diff --git a/mods/test/data/stages/test.json b/mods/test/data/stages/test.json index a38e8b4..de57707 100644 --- a/mods/test/data/stages/test.json +++ b/mods/test/data/stages/test.json @@ -24,7 +24,8 @@ "animated": false, "animation": "", "voidShader": false, - "showsWhenLowQuality": true + "showsWhenLowQuality": true, + "shade": "" }, { "spriteName": "stageHills", @@ -41,7 +42,8 @@ "animated": false, "animation": "", "voidShader": false, - "showsWhenLowQuality": false + "showsWhenLowQuality": false, + "shade": "" }, { "spriteName": "grassbg", @@ -58,7 +60,8 @@ "animated": false, "animation": "", "voidShader": false, - "showsWhenLowQuality": false + "showsWhenLowQuality": false, + "shade": "" }, { "spriteName": "gate", @@ -75,7 +78,8 @@ "animated": false, "animation": "", "voidShader": false, - "showsWhenLowQuality": false + "showsWhenLowQuality": false, + "shade": "" }, { "spriteName": "stageFront", @@ -92,7 +96,8 @@ "animated": false, "animation": "", "voidShader": false, - "showsWhenLowQuality": true + "showsWhenLowQuality": true, + "shade": "" } ] } \ No newline at end of file diff --git a/source/PlayState.hx b/source/PlayState.hx index 61bc14c..53d698a 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -127,6 +127,7 @@ typedef BackgroundJson = var animation:String; var voidShader:Bool; var showsWhenLowQuality:Bool; + var shade:String; } typedef Settings = { @@ -2461,7 +2462,7 @@ class PlayState extends MusicBeatState } for (i in jsonStage.backgrounds) { - createCustomBackground(i.spriteName, i.posX, i.posY, i.image, i.size, i.scrollX, i.scrollY, i.antialiasing, bgName, i.voidShader, i.updateHitBox, i.alpha, i.flying, i.animated, i.animation, i.showsWhenLowQuality); + createCustomBackground(i.spriteName, i.posX, i.posY, i.image, i.size, i.scrollX, i.scrollY, i.antialiasing, bgName, i.voidShader, i.updateHitBox, i.alpha, i.flying, i.animated, i.animation, i.showsWhenLowQuality, i.shade); } } else { @@ -2493,7 +2494,7 @@ class PlayState extends MusicBeatState return sprites; } - private function createCustomBackground(spriteName:String = 'test', posX:Float = 1, posY:Float = 1, imageName:String = 'none', size:Float = 1, scrollX:Float = 1, scrollY:Float = 1, antialiasings:Bool = true, bgName:String, isVoid:Bool = false, updateHitBox:Bool = true, alphaa:Float = 1, flying:Bool = false, animated:Bool = false, animation:String = 'idle', lQ:Bool = false):Void + private function createCustomBackground(spriteName:String = 'test', posX:Float = 1, posY:Float = 1, imageName:String = 'none', size:Float = 1, scrollX:Float = 1, scrollY:Float = 1, antialiasings:Bool = true, bgName:String, isVoid:Bool = false, updateHitBox:Bool = true, alphaa:Float = 1, flying:Bool = false, animated:Bool = false, animation:String = 'idle', lQ:Bool = false, shade:String = ''):Void { if (FlxG.save.data.lowQ && !lQ) { return; @@ -2508,6 +2509,11 @@ class PlayState extends MusicBeatState customBG.alpha = alphaa; sprites.add(customBG); add(customBG); + if (shade == 'dark') { + customBG.color = nightColor; + } else if (shade == 'sunset') { + customBG.color = sunsetColor; + } if (isVoid) { voidShader(customBG); } @@ -2524,6 +2530,11 @@ class PlayState extends MusicBeatState customBG.alpha = alphaa; sprites.add(customBG); add(customBG); + if (shade == 'dark') { + customBG.color = nightColor; + } else if (shade == 'sunset') { + customBG.color = sunsetColor; + } if (isVoid) { voidShader(customBG); } @@ -2537,6 +2548,11 @@ class PlayState extends MusicBeatState customBG.alpha = alphaa; sprites.add(customBG); add(customBG); + if (shade == 'dark') { + customBG.color = nightColor; + } else if (shade == 'sunset') { + customBG.color = sunsetColor; + } if (isVoid) { voidShader(customBG); }