From 91cd0d9071e0ca9582ed83da994ced8752aa6d5f Mon Sep 17 00:00:00 2001 From: CharlesCatYT Date: Thu, 7 Sep 2023 18:07:13 -0400 Subject: [PATCH] Revert "Squashed commit of the following:" This reverts commit 09f6e9243ed54d9198f0bc0227002aaf45dbc8fa. --- source/funkin/editors/charter/Charter.hx | 86 ++----------------- source/funkin/editors/charter/CharterNote.hx | 18 +--- .../funkin/editors/charter/NoteTypeScreen.hx | 84 ------------------ 3 files changed, 8 insertions(+), 180 deletions(-) delete mode 100644 source/funkin/editors/charter/NoteTypeScreen.hx diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 72cefd78e..af0ee060e 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -104,8 +104,6 @@ class Charter extends UIState { 96, 192 ]; - public var noteTypeDropdown:UIDropDown; - public function new(song:String, diff:String, reload:Bool = true) { super(); __song = song; @@ -245,24 +243,12 @@ class Charter extends UIState { }, null, { - label: "Switch to default note type", - keybind: [ZERO], - onSelect: _note_defaultnote - }, - { - label: "Switch to previous note type", - keybind: [ONE], - onSelect: _note_prevnote + label: "(0) Default Note", + keybind: [ZERO] }, { - label: "Switch to next note type", - keybind: [TWO], - onSelect: _note_nextnote - }, - { - label: "Edit note types", - keybind: [], - onSelect: _edit_notetype + label: "(1) Hurt Note", + keybind: [ONE] } ] }, @@ -449,14 +435,6 @@ class Charter extends UIState { addEventSpr.alpha = 0; addEventSpr.cameras = [charterCamera]; - var noteTypes:Array = ['default']; - noteTypeDropdown = new UIDropDown(10,105,200,32,noteTypes); - noteTypeDropdown.onChange = function(n) { - for(note in selection) - note.updatePos(note.step,note.id,note.susLength,n); - } - uiGroup.add(noteTypeDropdown); - // adds grid and notes so that they're ALWAYS behind the UI add(gridBackdrop); add(sectionSeparator); @@ -527,7 +505,6 @@ class Charter extends UIState { for(e in eventsGroup.members) e.refreshEventIcons(); - _reload_notetypes(); refreshBPMSensitive(); } @@ -568,9 +545,6 @@ class Charter extends UIState { else selection = [cast n]; } - - noteTypeDropdown.setOption(cast n.type); - if (FlxG.mouse.justReleasedRight) { if (!selection.contains(cast n)) selection = [cast n]; @@ -680,9 +654,8 @@ class Charter extends UIState { if (id >= 0 && id < 4 * gridBackdrop.strumlinesAmount && mousePos.y >= 0) { var gridmult = 40 / (quantization / 16); var note = new CharterNote(); - note.updatePos(FlxG.keys.pressed.SHIFT ? (mousePos.y / 40) : snap(mousePos.y,gridmult)/40, id, 0, noteTypeDropdown.index); + note.updatePos(FlxG.keys.pressed.SHIFT ? (mousePos.y / 40) : snap(mousePos.y,gridmult)/40, id, 0, 0); notesGroup.add(note); - trace(note.type); selection = [note]; sortNotes(); addToUndo(CCreateSelection([note])); @@ -1075,8 +1048,7 @@ class Charter extends UIState { } function _file_saveas(_) { - buildChart(); // note types are not saved i think - openSubState(new SaveSubstate(Json.stringify(Chart.filterChartForSaving(PlayState.SONG, false), null, "\t"), { + openSubState(new SaveSubstate(Json.stringify(Chart.filterChartForSaving(PlayState.SONG, false)), { defaultSaveFile: '${__diff.toLowerCase()}.json' })); } @@ -1307,50 +1279,6 @@ class Charter extends UIState { #end - function _edit_notetype(t):Void - { - var state = new NoteTypeScreen(PlayState.SONG); - state.closeCallback = function() { _reload_notetypes(); }; - state.closeRemoveNoteCallback = function(n) { - _reload_notetypes(); - noteTypeDropdown.setOption(0); - notesGroup.forEach(function(note) { - if(note.type == n) - note.updatePos(note.step, note.id, note.susLength, 0); - if(note.type >= n) - note.updatePos(note.step, note.id, note.susLength, note.type-1); - }); - }; - FlxG.state.openSubState(state); - } - - inline function _note_defaultnote(_) - noteTypeDropdown.setOption(0); - - - inline function _note_prevnote(_) { - if(noteTypeDropdown.index == 0) - noteTypeDropdown.setOption(noteTypeDropdown.options.length - 1); - else - noteTypeDropdown.setOption(noteTypeDropdown.index - 1); - } - - inline function _note_nextnote(_) { - if(noteTypeDropdown.index == noteTypeDropdown.options.length - 1) - noteTypeDropdown.setOption(0); - else - noteTypeDropdown.setOption(noteTypeDropdown.index + 1); - } - - - public function _reload_notetypes() - { - var noteTypes:Array = ['default']; - for(noteType in PlayState.SONG.noteTypes) - noteTypes.push(noteType); - noteTypeDropdown.options = noteTypes; - } - function changeNoteSustain(change:Float) { if (selection.length <= 0 || change == 0) return; @@ -1359,7 +1287,7 @@ class Charter extends UIState { if (s is CharterNote) { var n:CharterNote = cast(s, CharterNote); var old:Float = n.susLength; - n.updatePos(n.step, n.id, Math.max(n.susLength + change, 0), n.type; + n.updatePos(n.step, n.id, Math.max(n.susLength + change, 0)); { before: old, diff --git a/source/funkin/editors/charter/CharterNote.hx b/source/funkin/editors/charter/CharterNote.hx index 098f4b34a..9a3359f40 100644 --- a/source/funkin/editors/charter/CharterNote.hx +++ b/source/funkin/editors/charter/CharterNote.hx @@ -18,9 +18,6 @@ class CharterNote extends UISprite implements ICharterSelectable { ]; public var sustainSpr:FlxSprite; - public var selected:Bool = false; - public var numberLabel:UIText; - var __doAnim:Bool = false; public var selected:Bool = false; @@ -43,11 +40,6 @@ class CharterNote extends UISprite implements ICharterSelectable { sustainSpr = new FlxSprite(10, 40); sustainSpr.makeGraphic(1, 1, -1); members.push(sustainSpr); - - numberLabel = new UIText(30,20,200,'',24,FlxColor.WHITE); - numberLabel.borderStyle = OUTLINE; - numberLabel.borderSize = 1; - numberLabel.borderColor = FlxColor.BLACK; } public override function updateButtonHandler() { @@ -88,9 +80,6 @@ class CharterNote extends UISprite implements ICharterSelectable { default: 0; // how is that even possible }; - // 0 is default ! - numberLabel.text = type == 0 ? '' : Std.string(this.type); - sustainSpr.color = colors[animation.curAnim.curFrame]; if (!__doAnim) { @@ -125,15 +114,12 @@ class CharterNote extends UISprite implements ICharterSelectable { } var __passed:Bool = false; - public override function update(elapsed:Float) - { + public override function update(elapsed:Float) { super.update(elapsed); if(sustainSpr.exists) sustainSpr.follow(this, 15, 20); - numberLabel.follow(this, 19, 15); - if (__passed != (__passed = step < Conductor.curStepFloat)) { alpha = __passed ? 0.6 : 1; if (__passed && FlxG.sound.music.playing && Charter.instance.hitsoundsEnabled(id)) @@ -172,7 +158,5 @@ class CharterNote extends UISprite implements ICharterSelectable { public override function draw() { drawMembers(); drawSuper(); - if(type != 0) - numberLabel.draw(); } } \ No newline at end of file diff --git a/source/funkin/editors/charter/NoteTypeScreen.hx b/source/funkin/editors/charter/NoteTypeScreen.hx deleted file mode 100644 index a26cb6dc8..000000000 --- a/source/funkin/editors/charter/NoteTypeScreen.hx +++ /dev/null @@ -1,84 +0,0 @@ -package funkin.editors.charter; - -import funkin.backend.chart.ChartData; -import flixel.math.FlxPoint; -import funkin.backend.chart.ChartData.ChartMetaData; - -using StringTools; - -class NoteTypeScreen extends UISubstateWindow { - public var data:ChartData; - public var addButton:UIButton; - public var closeButton:UIButton; - public var removeButton:UIButton; - - public var scrollSpeedStepper:UINumericStepper; - public var stageBox:UITextBox; - - public var noteTypeDropdown:UIDropDown; - - public var noteTypeNameBox:UITextBox; - - public var closeRemoveNoteCallback:Int->Void; - - public function new(data:ChartData) { - super(); - this.data = data; - } - - public override function create() { - FlxG.sound.music.pause(); - Charter.instance.vocals.pause(); - - function addLabelOn(ui:UISprite, text:String) - add(new UIText(ui.x, ui.y - 24, 0, text)); - - winTitle = 'Edit note types'; - winWidth = 420; winHeight = 69*4; // guys look, the funny numbers! - - super.create(); - - noteTypeDropdown = new UIDropDown(windowSpr.x + 20, windowSpr.y + 60,200,32,PlayState.SONG.noteTypes); - addLabelOn(noteTypeDropdown, "Note"); - add(noteTypeDropdown); - - addButton = new UIButton(windowSpr.x + 200 + 40, windowSpr.y + 60 + 32 + 16, "Add new note type", function() { - noteTypeDropdown.visible = false; - noteTypeDropdown.active = false; - removeButton.visible = false; - removeButton.active = false; - - addButton.field.text = 'Create note type'; - addButton.callback = function() {onSave(); close();} - - noteTypeNameBox = new UITextBox(windowSpr.x + 20, windowSpr.y + 60, ''); - add(noteTypeNameBox); - - }, 125); - add(addButton); - - removeButton = new UIButton(windowSpr.x + 200 + 40, windowSpr.y + 60, "Remove note type", function() { - onRemove(); - close(); - }, 125); - add(removeButton); - - closeButton = new UIButton(windowSpr.x + windowSpr.bWidth - 20 - 125, windowSpr.y + windowSpr.bHeight - 16 - 32, "Cancel", function() { - close(); - }, 125); - add(closeButton); - closeButton.x -= closeButton.bWidth; - } - - public function onSave() - { - PlayState.SONG.noteTypes.push(noteTypeNameBox.label.text); - } - - public function onRemove() - { - closeRemoveNoteCallback(noteTypeDropdown.index + 1); - PlayState.SONG.noteTypes.remove(noteTypeDropdown.label.text); - } - -} \ No newline at end of file