Skip to content

Commit

Permalink
this is actually way too much
Browse files Browse the repository at this point in the history
will i continue this?
  • Loading branch information
lemz1 authored and charlesisfeline committed Jul 16, 2024
1 parent 69b036d commit b60f6af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion source/funkin/ui/debug/charting/ChartEditorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import funkin.data.notestyle.NoteStyleRegistry;
import funkin.data.song.SongData.SongCharacterData;
import funkin.data.song.SongData.SongChartData;
import funkin.data.song.SongData.SongEventData;
import funkin.data.song.SongData.SongEventListData;
import funkin.data.song.SongData.SongMetadata;
import funkin.data.song.SongData.SongNoteData;
import funkin.data.song.SongData.SongOffsets;
Expand Down Expand Up @@ -4752,7 +4753,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
// TODO: Figure out configuring event data.
var newEventData:SongEventData = new SongEventData(cursorSnappedMs, eventKindToPlace, eventDataToPlace.copy());

performCommand(new AddEventsCommand([newEventData], FlxG.keys.pressed.CONTROL));
performCommand(new AddEventsCommand([new SongEventListData(newEventData.time, [newEventData])], FlxG.keys.pressed.CONTROL));
}
else
{
Expand Down Expand Up @@ -4897,12 +4898,14 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
if (gridGhostEvent == null) throw "ERROR: Tried to handle cursor, but gridGhostEvent is null! Check ChartEditorState.buildGrid()";

var eventData:SongEventData = gridGhostEvent.eventData != null ? gridGhostEvent.eventData : new SongEventData(cursorMs, eventKindToPlace, null);
var eventList:SongEventListData = new SongEventListData(eventData.time, [eventData]);

if (eventKindToPlace != eventData.eventKind)
{
eventData.eventKind = eventKindToPlace;
}
eventData.time = cursorSnappedMs;
eventList.time = eventData.time;

gridGhostEvent.visible = true;
gridGhostEvent.eventData = eventData;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package funkin.ui.debug.charting.components;

import funkin.data.song.SongData.SongEventData;
import funkin.data.song.SongData.SongEventListData;
import funkin.data.song.SongData.SongNoteData;
import flixel.math.FlxMath;
import flixel.FlxSprite;
Expand Down Expand Up @@ -70,7 +70,7 @@ class ChartEditorNotePreview extends FlxSprite
* @param event The data for the event.
* @param songLengthInMs The total length of the song in milliseconds.
*/
public function addEvent(event:SongEventData, songLengthInMs:Int, ?isSelection:Bool = false):Void
public function addEvent(event:SongEventListData, songLengthInMs:Int, ?isSelection:Bool = false):Void
{
drawNote(-1, false, Std.int(event.time), songLengthInMs, isSelection);
}
Expand Down Expand Up @@ -106,7 +106,7 @@ class ChartEditorNotePreview extends FlxSprite
* @param events The data for the events.
* @param songLengthInMs The total length of the song in milliseconds.
*/
public function addEvents(events:Array<SongEventData>, songLengthInMs:Int):Void
public function addEvents(events:Array<SongEventListData>, songLengthInMs:Int):Void
{
for (event in events)
{
Expand All @@ -119,7 +119,7 @@ class ChartEditorNotePreview extends FlxSprite
* @param events The data for the events.
* @param songLengthInMs The total length of the song in milliseconds.
*/
public function addSelectedEvents(events:Array<SongEventData>, songLengthInMs:Int):Void
public function addSelectedEvents(events:Array<SongEventListData>, songLengthInMs:Int):Void
{
for (event in events)
{
Expand Down

0 comments on commit b60f6af

Please sign in to comment.