diff --git a/assets/data/config/options.xml b/assets/data/config/options.xml index 91da8a41..c849e1f8 100644 --- a/assets/data/config/options.xml +++ b/assets/data/config/options.xml @@ -1,19 +1,14 @@ - + - - + + - + - - - - - \ No newline at end of file diff --git a/assets/images/editors/bgs/charter.png b/assets/images/editors/bgs/charter.png new file mode 100644 index 00000000..c3ce716d Binary files /dev/null and b/assets/images/editors/bgs/charter.png differ diff --git a/assets/images/menus/menuEditors.png b/assets/images/menus/menuEditors.png new file mode 100644 index 00000000..a34c46e2 Binary files /dev/null and b/assets/images/menus/menuEditors.png differ diff --git a/buildnumber.txt b/buildnumber.txt index c1022d0c..4f776482 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -2482 \ No newline at end of file +2489 \ No newline at end of file diff --git a/source/funkin/editors/EditorPicker.hx b/source/funkin/editors/EditorPicker.hx index bcb62595..5944ea61 100644 --- a/source/funkin/editors/EditorPicker.hx +++ b/source/funkin/editors/EditorPicker.hx @@ -12,7 +12,7 @@ class EditorPicker extends MusicBeatSubstate { { name: "Chart Editor", iconID: 0, - state: null + state: funkin.editors.charter.CharterSelection }, { name: "Character Editor", diff --git a/source/funkin/editors/EditorTreeMenu.hx b/source/funkin/editors/EditorTreeMenu.hx new file mode 100644 index 00000000..7c5d44a8 --- /dev/null +++ b/source/funkin/editors/EditorTreeMenu.hx @@ -0,0 +1,24 @@ +package funkin.editors; + +import flixel.addons.display.FlxBackdrop; +import funkin.options.*; + +class EditorTreeMenu extends TreeMenu { + public var bg:FlxBackdrop; + public var bgType:String = "default"; + + public override function create() { + super.create(); + + bg = new FlxBackdrop(); + bg.loadGraphic(Paths.image('editors/bgs/${bgType}')); + bg.antialiasing = true; + add(bg); + } + + public override function update(elapsed:Float) { + super.update(elapsed); + bg.x += elapsed * 125; + bg.y += elapsed * 125; + } +} \ No newline at end of file diff --git a/source/funkin/editors/charter/CharterSelection.hx b/source/funkin/editors/charter/CharterSelection.hx index 398d040e..081fb877 100644 --- a/source/funkin/editors/charter/CharterSelection.hx +++ b/source/funkin/editors/charter/CharterSelection.hx @@ -1,23 +1,55 @@ package funkin.editors.charter; +import flixel.util.FlxColor; import funkin.menus.FreeplayState.FreeplaySonglist; +import funkin.editors.EditorTreeMenu; +import funkin.options.*; +import funkin.options.type.*; -class CharterSelection extends MusicBeatState { - public var songNames:FlxTypedSpriteGroup; - public var freeplaySonglist:FreeplaySonglist; - +class CharterSelection extends EditorTreeMenu { + public var freeplayList:FreeplaySonglist; public override function create() { + bgType = "charter"; + super.create(); - songNames = new FlxTypedSpriteGroup(); + freeplayList = FreeplaySonglist.get(); - freeplaySonglist = FreeplaySonglist.get(); + main = new OptionsScreen("Chart Editor", "Select a song to modify the charts from.", [ + for(s in freeplayList.songs) new IconOption(s.name, "Press ACCEPT to choose a difficulty to edit.", s.icon, function() { + optionsTree.add(new OptionsScreen(s.name, "Select a difficulty to continue, or press 1 to add a new one.", [ + for(d in s.difficulties) new TextOption(d, "Press ACCEPT to edit the chart for the selected difficulty", function() { + trace(s.name); + trace(d); + }) + ])); + }) + ]); + } - for(k=>s in freeplaySonglist.songs) { - var alphabet = new Alphabet(0, k * 60, s.displayName, true); - songNames.add(alphabet); + public override function update(elapsed:Float) { + super.update(elapsed); + + bg.colorTransform.redOffset = lerp(bg.colorTransform.redOffset, 0, 0.0625); + bg.colorTransform.greenOffset = lerp(bg.colorTransform.greenOffset, 0, 0.0625); + bg.colorTransform.blueOffset = lerp(bg.colorTransform.blueOffset, 0, 0.0625); + bg.colorTransform.redMultiplier = lerp(bg.colorTransform.redMultiplier, 1, 0.0625); + bg.colorTransform.greenMultiplier = lerp(bg.colorTransform.greenMultiplier, 1, 0.0625); + bg.colorTransform.blueMultiplier = lerp(bg.colorTransform.blueMultiplier, 1, 0.0625); + } + + public override function onMenuChange() { + super.onMenuChange(); + if (optionsTree.members.length > 1) { // selected a song + // small flashbang + var color:FlxColor = freeplayList.songs[main.curSelected].parsedColor.getDefault(0xFFFFFFFF); + + bg.colorTransform.redOffset = 0.25 * color.red; + bg.colorTransform.greenOffset = 0.25 * color.green; + bg.colorTransform.blueOffset = 0.25 * color.blue; + bg.colorTransform.redMultiplier = FlxMath.lerp(1, color.redFloat, 0.25); + bg.colorTransform.greenMultiplier = FlxMath.lerp(1, color.greenFloat, 0.25); + bg.colorTransform.blueMultiplier = FlxMath.lerp(1, color.blueFloat, 0.25); } - - add(songNames); } } \ No newline at end of file diff --git a/source/funkin/editors/charter/CharterSelectionScreen.hx b/source/funkin/editors/charter/CharterSelectionScreen.hx new file mode 100644 index 00000000..e69de29b diff --git a/source/funkin/options/type/IconOption.hx b/source/funkin/options/type/IconOption.hx new file mode 100644 index 00000000..e882c309 --- /dev/null +++ b/source/funkin/options/type/IconOption.hx @@ -0,0 +1,15 @@ +package funkin.options.type; + +import funkin.game.HealthIcon; + +class IconOption extends TextOption { + public var iconSpr:HealthIcon; + + public function new(name:String, desc:String, icon:String, callback:Void->Void) { + super(name, desc, callback); + + iconSpr = new HealthIcon(icon, false); + iconSpr.setPosition(90 - iconSpr.width, (__text.height - iconSpr.height) / 2); + add(iconSpr); + } +} \ No newline at end of file