diff --git a/source/funkin/ui/debug/charting/ChartEditorDialogHandler.hx b/source/funkin/ui/debug/charting/ChartEditorDialogHandler.hx index 63dc8bd92..a93e9ec73 100644 --- a/source/funkin/ui/debug/charting/ChartEditorDialogHandler.hx +++ b/source/funkin/ui/debug/charting/ChartEditorDialogHandler.hx @@ -833,6 +833,9 @@ class ChartEditorDialogHandler songChartDataVariation = SongValidator.validateSongChartData(songChartDataVariation, 'import'); songChartData.set(variation, songChartDataVariation); + state.notePreviewDirty = true; + state.notePreviewViewportBoundsDirty = true; + state.noteDisplayDirty = true; // Tell the user the load was successful. NotificationManager.instance.addNotification( @@ -858,6 +861,9 @@ class ChartEditorDialogHandler songChartDataVariation = SongValidator.validateSongChartData(songChartDataVariation, 'import'); songChartData.set(variation, songChartDataVariation); + state.notePreviewDirty = true; + state.notePreviewViewportBoundsDirty = true; + state.noteDisplayDirty = true; // Tell the user the load was successful. NotificationManager.instance.addNotification( diff --git a/source/funkin/ui/debug/charting/ChartEditorNoteSprite.hx b/source/funkin/ui/debug/charting/ChartEditorNoteSprite.hx index 0adbf1a20..1c440f6ed 100644 --- a/source/funkin/ui/debug/charting/ChartEditorNoteSprite.hx +++ b/source/funkin/ui/debug/charting/ChartEditorNoteSprite.hx @@ -132,6 +132,8 @@ class ChartEditorNoteSprite extends FlxSprite public function updateNotePosition(?origin:FlxObject) { + if (this.noteData == null) return; + var cursorColumn:Int = this.noteData.data; if (cursorColumn < 0) cursorColumn = 0; diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 83c052050..86c0a11eb 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -569,7 +569,6 @@ class ChartEditorState extends HaxeUIState /** * Whether the note preview graphic needs to be FULLY rebuilt. - * The Bitmap can be modified by individual commands without using this. */ var notePreviewDirty:Bool = true; @@ -1317,7 +1316,7 @@ class ChartEditorState extends HaxeUIState healthIconBF = new HealthIcon(currentSongCharacterPlayer); healthIconBF.autoUpdate = false; healthIconBF.size.set(0.5, 0.5); - healthIconBF.x = gridTiledSprite.x + GRID_SIZE * (STRUMLINE_SIZE * 2 + 1) + 15; + healthIconBF.x = gridTiledSprite.x + gridTiledSprite.width + 15; healthIconBF.y = gridTiledSprite.y + 5; healthIconBF.flipX = true; add(healthIconBF); @@ -1797,7 +1796,7 @@ class ChartEditorState extends HaxeUIState if (healthIconBF != null) { // Base X position to the right of the grid. - var baseHealthIconXPos:Float = gridTiledSprite?.x ?? 0.0 + GRID_SIZE * (STRUMLINE_SIZE * 2 + 1) + 15; + var baseHealthIconXPos:Float = (gridTiledSprite == null) ? (0) : (gridTiledSprite.x + gridTiledSprite.width + 15); // Will be 0 when not bopping. When bopping, will increase to push the icon left. var healthIconOffset:Float = healthIconBF.width - (HealthIcon.HEALTH_ICON_SIZE * 0.5); healthIconBF.x = baseHealthIconXPos - healthIconOffset; @@ -2718,12 +2717,12 @@ class ChartEditorState extends HaxeUIState trace('Creating new Note... (${renderedNotes.members.length})'); noteSprite.parentState = this; - // Setting note data resets position relative to the grid so we fix that. - noteSprite.updateNotePosition(renderedNotes); - // The note sprite handles animation playback and positioning. noteSprite.noteData = noteData; + // Setting note data resets position relative to the grid so we fix that. + noteSprite.updateNotePosition(renderedNotes); + // Add hold notes that are now visible (and not already displayed). if (noteSprite.noteData != null && noteSprite.noteData.length > 0 && displayedHoldNoteData.indexOf(noteSprite.noteData) == -1) { @@ -3869,6 +3868,9 @@ class ChartEditorState extends HaxeUIState scrollPositionInPixels = 0; playheadPositionInPixels = 0; + notePreviewDirty = true; + notePreviewViewportBoundsDirty = true; + noteDisplayDirty = true; moveSongToScrollPosition(); }