From fca7a8a31cc5789a1b7b82142c5bf5d335c16838 Mon Sep 17 00:00:00 2001 From: Frakist <90983918+Frakist@users.noreply.github.com> Date: Sun, 29 Oct 2023 15:21:03 +0300 Subject: [PATCH] oops #2 --- source/funkin/editors/charter/Charter.hx | 10 +++++----- source/funkin/editors/charter/CharterNote.hx | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 09531f6c..bcd46a93 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -404,9 +404,6 @@ class Charter extends UIState { noteTypeWindow = new UIButtonList(1, 200, 300, 500, "Note Types", FlxPoint.get(296, 30), FlxPoint.get(2, 2)); noteTypeWindow.buttons.add(new CharterNoteTypeButton("Default Note", noteTypeWindow, this, null)); noteTypeWindow.cameras = [uiCamera]; - noteTypeWindow.addButton.callback = function() { - noteTypeWindow.buttons.add(new CharterNoteTypeButton("New NoteType", noteTypeWindow, this, Paths.getFolderContent("data/notes"))); - } playBackSlider = new UISlider(FlxG.width - 160 - 26 - 20, (23/2) - (12/2), 160, 1, [{start: 0.25, end: 1, size: 0.5}, {start: 1, end: 2, size: 0.5}], true); playBackSlider.onChange = function (v) { @@ -482,8 +479,11 @@ class Charter extends UIState { if (!chart.noteTypes.contains(haxe.io.Path.withoutExtension(i)) && haxe.io.Path.withoutExtension(i) != "default") chart.noteTypes.push(haxe.io.Path.withoutExtension(i)); for (i in chart.noteTypes) - noteTypeWindow.buttons.add(new CharterNoteTypeButton(haxe.io.Path.withoutExtension(i), noteTypeWindow, this, Paths.getFolderContent("data/notes"))); + noteTypeWindow.buttons.add(new CharterNoteTypeButton(haxe.io.Path.withoutExtension(i), noteTypeWindow, this, chart.noteTypes)); for(i in noteTypeWindow.buttons.members) i.alpha = i.theType == "Default Note" ? 1 : 0.25; + noteTypeWindow.addButton.callback = function() { + noteTypeWindow.buttons.add(new CharterNoteTypeButton("New NoteType", noteTypeWindow, this, chart.noteTypes)); + } Conductor.setupSong(PlayState.SONG); @@ -1351,7 +1351,7 @@ class Charter extends UIState { var time = Conductor.getTimeForStep(note.step); if (!PlayState.SONG.noteTypes.contains(note.type) && note.type != "Default Note") PlayState.SONG.noteTypes.push(note.type); return { - type: (PlayState.SONG.noteTypes.contains(note.type) ? PlayState.SONG.noteTypes.indexOf(note.type) + 1 : -1), + type: (PlayState.SONG.noteTypes.contains(note.type) ? PlayState.SONG.noteTypes.indexOf(note.type) + 1 : 0), time: time, sLen: Conductor.getTimeForStep(note.step + note.susLength) - time, id: note.id diff --git a/source/funkin/editors/charter/CharterNote.hx b/source/funkin/editors/charter/CharterNote.hx index 9e7c8315..abc50a2c 100644 --- a/source/funkin/editors/charter/CharterNote.hx +++ b/source/funkin/editors/charter/CharterNote.hx @@ -40,7 +40,7 @@ class CharterNote extends UISprite implements ICharterSelectable { sustainSpr.makeGraphic(1, 1, -1); members.push(sustainSpr); - noteTypeText = new flixel.text.FlxText(0, 0, 40, (type == null || type == "Default Note" ? "" : '${PlayState.SONG.noteTypes.indexOf(type)}'), 30); + noteTypeText = new flixel.text.FlxText(0, 0, 40, (type == null || type == "Default Note" ? "" : '${PlayState.SONG.noteTypes.indexOf(type) + 1}'), 30); noteTypeText.alignment = "center"; } @@ -73,7 +73,7 @@ class CharterNote extends UISprite implements ICharterSelectable { this.id = id; this.susLength = susLength; this.type = type; - noteTypeText.text = (type == null || type == "Default Note" ? "" : '${PlayState.SONG.noteTypes.indexOf(type)}'); + noteTypeText.text = (type == null || type == "Default Note" ? "" : '${PlayState.SONG.noteTypes.indexOf(type) + 1}'); if (strumLine != null) this.strumLine = strumLine; y = step * 40;