Skip to content

Commit a75c7dd

Browse files
Charter: Auto-generate strumlines if the JSON is missing (#1056)
* Add dummy strumlines on newly created songs shoutout that one dude in modding help who pointed out that cne crashes if you do something other than make a strumline immediately after loading into the charter * typo fix oopsie * typo fix + condense the thing
1 parent 4a1cef8 commit a75c7dd

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

source/funkin/editors/charter/Charter.hx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,28 @@ class Charter extends UIState {
656656
noteCount += strL.notes.length;
657657
}
658658

659+
// checks for newly created songs
660+
if (PlayState.SONG.strumLines.length == 0) {
661+
createStrumline(0, {
662+
characters: ["dad"],
663+
type: 0, // Opponent
664+
notes: [],
665+
position: "dad",
666+
visible: true,
667+
keyCount: 4
668+
}, false, false);
669+
670+
createStrumline(1, {
671+
characters: ["bf"],
672+
type: 1, // Player
673+
notes: [],
674+
position: "boyfriend",
675+
visible: true,
676+
strumLinePos: 0.75,
677+
keyCount: 4
678+
}, false, false);
679+
}
680+
659681
// create notes
660682
notesGroup.autoSort = false;
661683
notesGroup.preallocate(noteCount);

0 commit comments

Comments
 (0)