Skip to content

Commit e0b5369

Browse files
authored
"Delete Stacked Notes" functionality for the chart editor (#935)
* Delete Stacked Notes * unstack selection * Attempts to translate to italian and polish i do not know these languages so if they're wrong im sorry
1 parent d874ea0 commit e0b5369

File tree

6 files changed

+41
-12
lines changed

6 files changed

+41
-12
lines changed

assets/languages/en/Editors.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@
203203
<str id="paste">Paste</str>
204204
<str id="cut">Cut</str>
205205
<str id="delete">Delete</str>
206+
<str id="deletestacked">Delete Stacked Notes</str>
206207
</group>
207208

208209
<str id="topBar.chart">Chart</str>

assets/languages/es/Editors.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<str id="animation">Animación</str>
1717
<str id="atlas">Atlas</str>
1818
<str id="spritemap">Mapa de sprites</str>
19-
19+
2020
<str id="directory">Ubicación ({0}/)</str>
2121
<str id="found">{0} {1} Encontrado</str>
2222
<str id="foundplural">{0} {1} Encontrados</str>
@@ -188,6 +188,7 @@
188188
<str id="paste">Pegar</str>
189189
<str id="cut">Cortar</str>
190190
<str id="delete">Eliminar</str>
191+
<str id="deletestacked">Eliminar Notas Apiladas</str>
191192
</group>
192193

193194
<str id="topBar.chart">Chart</str>

assets/languages/it/Editors.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@
194194
<str id="paste">Incolla</str>
195195
<str id="cut">Taglia</str>
196196
<str id="delete">Elimina</str>
197+
<str id="deletestacked">Elimina Note Impilate</str>
197198
</group>
198199

199200
<str id="topBar.chart">Chart</str>

assets/languages/pl/Editors.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<str id="animation">Animacja</str>
1919
<str id="atlas">Atlas</str>
2020
<str id="spritemap">Mapa sprite'ów</str>
21-
21+
2222
<str id="directory">Folder ({0}/)</str>
2323
<str id="found">{0} {1} Znaleziono</str>
2424
<str id="foundplural">{0} {1} Znaleziono</str>
@@ -87,7 +87,7 @@
8787
<group name="CharterEventScreen" prefix="charterEventScreen.">
8888
<str id="title-creating">Stwórz Grupę Wydarzeń</str>
8989
<str id="title-editing">Edytuj Grupę Wydarzeń</str>
90-
90+
9191
<str id="noEvent">Brak Wydarzenia</str>
9292

9393
<str id="strumLine.format">Struma #{0} ({1})</str>
@@ -197,6 +197,7 @@
197197
<str id="paste">Wklej</str>
198198
<str id="cut">Wytnij</str>
199199
<str id="delete">Usuń</str>
200+
<str id="deletestacked">Usuń Notatki Ułożone w Stos</str>
200201
</group>
201202

202203
<str id="topBar.chart">Mapa</str>
@@ -223,7 +224,7 @@
223224
<str id="scrollRight">Przewiń w Prawo</str>
224225
<str id="scrollReset">Resetuj Przewinięcie</str>
225226
</group>
226-
227+
227228
<str id="topBar.song">Ścieżka</str>
228229
<group name="SongMenu" prefix="song.">
229230
<str id="goStart">Wróć do początku</str>

assets/languages/pt/Editors.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@
203203
<str id="paste">Colar</str>
204204
<str id="cut">Cortar</str>
205205
<str id="delete">Apagar</str>
206+
<str id="deletestacked">Apagar Notas Empilhadas</str>
206207
</group>
207208

208209
<str id="topBar.chart">Mapa</str>

source/funkin/editors/charter/Charter.hx

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ class Charter extends UIState {
232232
label: translate("edit.delete"),
233233
keybind: [DELETE],
234234
onSelect: _edit_delete
235+
},
236+
{
237+
label: translate("edit.deletestacked"),
238+
keybind: [SHIFT,DELETE],
239+
onSelect: _edit_deletestacked
235240
}
236241
]
237242
},
@@ -459,7 +464,7 @@ class Charter extends UIState {
459464
rightEventsGroup.eventsRowText = rightEventRowText;
460465

461466
// thank you neo for pointing out im stupid -lunar
462-
// this is future lunar i completely forgot what neo pointed out but hes awesome go follow him on twitter
467+
// this is future lunar i completely forgot what neo pointed out but hes awesome go follow him on twitter
463468

464469
add(gridBackdropDummy = new CameraHoverDummy(gridBackdrops, FlxPoint.weak(1, 0)));
465470
selectionBox = new UISliceSprite(0, 0, 2, 2, 'editors/ui/selection');
@@ -978,7 +983,7 @@ class Charter extends UIState {
978983
currentCursor = ARROW;
979984
}
980985
case NONE:
981-
if (FlxG.mouse.justPressed)
986+
if (FlxG.mouse.justPressed)
982987
FlxG.mouse.getWorldPosition(charterCamera, dragStartPos);
983988
else if (FlxG.mouse.justPressedRight) {
984989
closeCurrentContextMenu();
@@ -1719,6 +1724,25 @@ class Charter extends UIState {
17191724
selection = deleteSelection(selection, true);
17201725
}
17211726

1727+
function _edit_deletestacked(_) {
1728+
UIState.playEditorSound(Flags.DEFAULT_EDITOR_DELETE_SOUND);
1729+
if (notesGroup.members.length == 0) return;
1730+
var oldNote:CharterNote = null;
1731+
var selectionArray:Array<Dynamic> = ((selection.length != 0) ? selection : notesGroup.members.copy());
1732+
var toDelete:Selection = new Selection();
1733+
for (note in selectionArray) {
1734+
if (oldNote != null && oldNote.step == note.step && oldNote.strumLineID == note.strumLineID && oldNote.id == note.id) {
1735+
noteDeleteAnims.deleteNotes.push({note: oldNote, time: noteDeleteAnims.deleteTime});
1736+
toDelete.push(oldNote);
1737+
}
1738+
oldNote = note;
1739+
}
1740+
if (toDelete.length != 0) {
1741+
deleteSelection(toDelete);
1742+
if (selection.length != 0) for (i in toDelete) selection.remove(i); //crash prevention
1743+
}
1744+
}
1745+
17221746
function _undo(undo:CharterChange) {
17231747
UIState.playEditorSound(Flags.DEFAULT_EDITOR_UNDO_SOUND);
17241748
switch(undo) {
@@ -1955,7 +1979,7 @@ class Charter extends UIState {
19551979
if (PlayState.SONG.bookmarks != null)
19561980
bookmarks = PlayState.SONG.bookmarks;
19571981
} catch (e) {}
1958-
1982+
19591983
return bookmarks;
19601984
}
19611985

@@ -1965,9 +1989,9 @@ class Charter extends UIState {
19651989
var currentBookmarks:Array<ChartBookmark> = getBookmarkList();
19661990
var newBookmarks:Array<ChartBookmark> = getBookmarkList();
19671991
newBookmarks.push({time: daStep, name: name, color: color.toWebString()});
1968-
1992+
19691993
PlayState.SONG.bookmarks = newBookmarks;
1970-
updateBookmarks();
1994+
updateBookmarks();
19711995
undos.addToUndo(CEditBookmarks(currentBookmarks, newBookmarks));
19721996
}
19731997

@@ -1992,7 +2016,7 @@ class Charter extends UIState {
19922016
{
19932017
var bars:Array<FlxSprite> = bs[0];
19942018
var text:UIText = bs[1];
1995-
2019+
19962020
if (bars != null) {
19972021
for (spr in bars) {
19982022
if (spr == null) continue;
@@ -2046,7 +2070,7 @@ class Charter extends UIState {
20462070
0,
20472071
scrollBar.height
20482072
);
2049-
2073+
20502074
var bookmarkspr = new FlxSprite(scrollBar.x - 10, yPos).makeSolid(40, 4, bookmarkcolor);
20512075
uiGroup.add(bookmarkspr);
20522076
sprites.push(bookmarkspr);
@@ -2330,7 +2354,7 @@ class Charter extends UIState {
23302354
icon: this.noteType == 0 ? 1 : 0
23312355
}];
23322356

2333-
final noteKeys:Array<Array<Array<FlxKey>>> = [[[ZERO], [NUMPADZERO]], [[ONE], [NUMPADONE]], [[TWO], [NUMPADTWO]], [[THREE], [NUMPADTHREE]], [[FOUR], [NUMPADFOUR]], [[FIVE], [NUMPADFIVE]],
2357+
final noteKeys:Array<Array<Array<FlxKey>>> = [[[ZERO], [NUMPADZERO]], [[ONE], [NUMPADONE]], [[TWO], [NUMPADTWO]], [[THREE], [NUMPADTHREE]], [[FOUR], [NUMPADFOUR]], [[FIVE], [NUMPADFIVE]],
23342358
[[SIX], [NUMPADSIX]], [[SEVEN], [NUMPADSEVEN]], [[EIGHT], [NUMPADEIGHT]], [[NINE], [NUMPADNINE]]];
23352359
for (i=>type in noteTypes) {
23362360
var realNoteID:Int = i+1; // Default Note not stored

0 commit comments

Comments
 (0)