diff --git a/assets/images/editors/charter/add-strumline.png b/assets/images/editors/charter/add-strumline.png index d205c17e..d890a9a1 100644 Binary files a/assets/images/editors/charter/add-strumline.png and b/assets/images/editors/charter/add-strumline.png differ diff --git a/assets/images/editors/charter/lock-strumline.png b/assets/images/editors/charter/lock-strumline.png new file mode 100644 index 00000000..0583bec2 Binary files /dev/null and b/assets/images/editors/charter/lock-strumline.png differ diff --git a/assets/images/editors/new.png b/assets/images/editors/new.png index d205c17e..945c49e0 100644 Binary files a/assets/images/editors/new.png and b/assets/images/editors/new.png differ diff --git a/assets/images/editors/ui/context-icons.png b/assets/images/editors/ui/context-icons.png index 73b8ff97..7bf46448 100644 Binary files a/assets/images/editors/ui/context-icons.png and b/assets/images/editors/ui/context-icons.png differ diff --git a/assets/images/editors/warnings/error.png b/assets/images/editors/warnings/error.png new file mode 100644 index 00000000..9c65f94b Binary files /dev/null and b/assets/images/editors/warnings/error.png differ diff --git a/assets/images/editors/warnings/warning.png b/assets/images/editors/warnings/warning.png index 6c864eaf..0d4f1999 100644 Binary files a/assets/images/editors/warnings/warning.png and b/assets/images/editors/warnings/warning.png differ diff --git a/source/funkin/editors/character/CharacterSelection.hx b/source/funkin/editors/character/CharacterSelection.hx index ae5e6635..9d1a60ed 100644 --- a/source/funkin/editors/character/CharacterSelection.hx +++ b/source/funkin/editors/character/CharacterSelection.hx @@ -27,13 +27,8 @@ class CharacterSelection extends EditorTreeMenu ]; list.insert(0, new NewOption("New Character", "New Character", function() { - openSubState(new UIWarningSubstate("New Character", "This feature isnt implemented yet", [ - { - label: "OK", - onClick: function(t) { - - } - } + openSubState(new UIWarningSubstate("New Character: Feature Not Implemented!", "This feature isnt implemented yet. Please wait for more cne updates to have this functional.\n\n\n- Codename Devs", [ + {label: "Ok", color: 0xFFFF0000, onClick: function(t) {}} ])); })); diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index a5207063..49ec899c 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -53,8 +53,8 @@ class Charter extends UIState { public var gridBackdropDummy:CharterBackdropDummy; public var strumlineInfoBG:FlxSprite; - public var strumlineAddButton:CharterStrumlineExtraButton; - public var strumlineLockButton:CharterStrumlineExtraButton; + public var strumlineAddButton:CharterStrumlineButton; + public var strumlineLockButton:CharterStrumlineButton; public var hitsound:FlxSound; public var metronome:FlxSound; @@ -378,10 +378,10 @@ class Charter extends UIState { strumlineInfoBG.y = 23; strumlineInfoBG.scrollFactor.set(); - strumlineAddButton = new CharterStrumlineExtraButton("editors/charter/add-strumline", "Create New"); + strumlineAddButton = new CharterStrumlineButton("editors/charter/add-strumline", "Create New"); strumlineAddButton.onClick = createStrumWithUI; - strumlineLockButton = new CharterStrumlineExtraButton("editors/charter/add-strumline", "Lock/Unlock"); + strumlineLockButton = new CharterStrumlineButton("editors/charter/lock-strumline", "Lock/Unlock"); strumlineLockButton.onClick = function () { if (strumLines != null) strumLines.draggable = !strumLines.draggable; }; diff --git a/source/funkin/editors/charter/CharterSelection.hx b/source/funkin/editors/charter/CharterSelection.hx index e7d2277f..d850b4aa 100644 --- a/source/funkin/editors/charter/CharterSelection.hx +++ b/source/funkin/editors/charter/CharterSelection.hx @@ -32,13 +32,8 @@ class CharterSelection extends EditorTreeMenu { }) ]; list.push(new NewOption("New Difficulty", "New Difficulty", function() { - openSubState(new UIWarningSubstate("New Difficulty", "This feature isnt implemented yet", [ - { - label: "OK", - onClick: function(t) { - - } - } + openSubState(new UIWarningSubstate("New Difficulty: Feature Not Implemented!", "This feature isnt implemented yet. Please wait for more cne updates to have this functional.\n\n\n- Codename Devs", [ + {label: "Ok", color: 0xFFFF0000, onClick: function(t) {}} ])); })); optionsTree.add(new OptionsScreen(s.name, "Select a difficulty to continue.", list)); @@ -91,6 +86,15 @@ class CharterSelection extends EditorTreeMenu { } public function saveSong(creation:SongCreationData) { + var songAlreadlyExsits:Bool = [for (s in freeplayList.songs) s.name.toLowerCase()].contains(creation.meta.name.toLowerCase().replace("-", " ")); + + if (songAlreadlyExsits) { + openSubState(new UIWarningSubstate("Creating Song: Error!", "The song you are trying to create alreadly exists, if you would like to override it delete the song first!", [ + {label: "Ok", color: 0xFFFF0000, onClick: function(t) {}} + ])); + return; + } + // Paths var songsDir:String = '${Paths.getAssetsRoot()}/songs/'; var songFolder:String = '$songsDir${creation.meta.name.replace("-", " ")}'; @@ -115,13 +119,8 @@ class CharterSelection extends EditorTreeMenu { }) ]; list.push(new NewOption("New Difficulty", "New Difficulty", function() { - openSubState(new UIWarningSubstate("New Difficulty", "This feature isnt implemented yet", [ - { - label: "OK", - onClick: function(t) { - - } - } + openSubState(new UIWarningSubstate("New Difficulty: Feature Not Implemented!", "This feature isnt implemented yet. Please wait for more cne updates to have this functional.\n\n\n- Codename Devs", [ + {label: "Ok", color: 0xFFFF0000, onClick: function(t) {}} ])); })); optionsTree.add(new OptionsScreen(creation.meta.name, "Select a difficulty to continue.", list)); diff --git a/source/funkin/editors/charter/CharterStrumline.hx b/source/funkin/editors/charter/CharterStrumline.hx index 0319bf7b..78fb0275 100644 --- a/source/funkin/editors/charter/CharterStrumline.hx +++ b/source/funkin/editors/charter/CharterStrumline.hx @@ -13,7 +13,7 @@ class CharterStrumline extends UISprite { public var draggingSprite:UISprite; public var healthIcon:HealthIcon; - public var button:CharterStrumlineButton; + public var button:CharterStrumlineOptions; public var draggable:Bool = false; public var dragging:Bool = false; @@ -47,7 +47,7 @@ class CharterStrumline extends UISprite { draggingSprite.cursor = BUTTON; members.push(draggingSprite); - button = new CharterStrumlineButton(this); + button = new CharterStrumlineOptions(this); members.push(button); } @@ -95,7 +95,7 @@ class CharterStrumline extends UISprite { } } -class CharterStrumlineButton extends UITopMenuButton { +class CharterStrumlineOptions extends UITopMenuButton { var strLine:CharterStrumline; public function new(parent:CharterStrumline) { super(0, 95, null, "Options ↓", []); @@ -132,13 +132,17 @@ class CharterStrumlineButton extends UITopMenuButton { label: "Edit", onSelect: function (_) { Charter.instance.editStrumline(strLine.strumLine); - } + }, + color: 0xFFFFFF00, + icon: 2 }, { label: "Delete", onSelect: function (_) { Charter.instance.deleteStrumlineFromData(strLine.strumLine); - } + }, + color: 0xFFFF0000, + icon: 3 } ]; super.openContextMenu(); diff --git a/source/funkin/editors/charter/CharterStrumlineExtraButton.hx b/source/funkin/editors/charter/CharterStrumlineButton.hx similarity index 91% rename from source/funkin/editors/charter/CharterStrumlineExtraButton.hx rename to source/funkin/editors/charter/CharterStrumlineButton.hx index 471aebe5..2cd156cf 100644 --- a/source/funkin/editors/charter/CharterStrumlineExtraButton.hx +++ b/source/funkin/editors/charter/CharterStrumlineButton.hx @@ -2,7 +2,7 @@ package funkin.editors.charter; import flixel.math.FlxPoint; -class CharterStrumlineExtraButton extends UISprite { +class CharterStrumlineButton extends UISprite { public var button:UISprite; public var text:UIText; @@ -30,7 +30,7 @@ class CharterStrumlineExtraButton extends UISprite { var buttonScale:FlxPoint = FlxPoint.get(0,0); public override function update(elapsed:Float) { - button.follow(this, ((40 * 4) - button.width) / 2, 18); + button.follow(this, ((40 * 4) - button.width) / 2, 24); text.follow(this, 0, 84); super.update(elapsed); diff --git a/source/funkin/editors/ui/UIContextMenu.hx b/source/funkin/editors/ui/UIContextMenu.hx index bf4d08fc..8a60a0ff 100644 --- a/source/funkin/editors/ui/UIContextMenu.hx +++ b/source/funkin/editors/ui/UIContextMenu.hx @@ -115,6 +115,7 @@ typedef UIContextMenuOption = { var ?keybind:Array; var ?keybinds:Array>; var ?keybindText:String; + var ?color:Int; var ?icon:Int; var ?onSelect:UIContextMenuOption->Void; var ?childs:Array; @@ -132,6 +133,7 @@ class UIContextMenuOptionSpr extends UISliceSprite { label = new UIText(20, 2, 0, option.label); this.option = option; this.parent = parent; + this.color = option.color; if (option.icon != null && option.icon > 0) { icon = new FlxSprite(0, 0).loadGraphic(Paths.image('editors/ui/context-icons'), true, 20, 20); diff --git a/source/funkin/editors/ui/UIWarningSubstate.hx b/source/funkin/editors/ui/UIWarningSubstate.hx index a67db6f9..cd1a70de 100644 --- a/source/funkin/editors/ui/UIWarningSubstate.hx +++ b/source/funkin/editors/ui/UIWarningSubstate.hx @@ -72,7 +72,7 @@ class UIWarningSubstate extends MusicBeatSubstate { var xPos = (FlxG.width - (30 + (170 * buttons.length))) / 2; for(k=>b in buttons) { - var button = new UIButton(xPos + 20 + (170 * k), spr.y + spr.bHeight - (42 + 16), b.label, function() { + var button = new UIButton(xPos + 20 + (170 * k), spr.y + spr.bHeight - (36 + 16), b.label, function() { b.onClick(this); close(); }, 160, 30); diff --git a/source/funkin/options/type/NewOption.hx b/source/funkin/options/type/NewOption.hx index bd7d1a14..e5c0f9eb 100644 --- a/source/funkin/options/type/NewOption.hx +++ b/source/funkin/options/type/NewOption.hx @@ -13,6 +13,7 @@ class NewOption extends TextOption { iconSpr = new FlxSprite().loadGraphic(Paths.image("editors/new")); iconSpr.setPosition(90 - iconSpr.width, (__text.height - iconSpr.height) / 2); + iconSpr.offset.set(20, -15); add(iconSpr); } } \ No newline at end of file