From ccbae3da7d580b12c33c6e216aafb5e4944636d2 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Mon, 24 Nov 2025 23:48:15 -0500 Subject: [PATCH] Implement a checkbox to hide the waveform, which improves FPS. --- source/funkin/audio/waveform/WaveformSprite.hx | 9 +++++++++ source/funkin/ui/debug/charting/ChartEditorState.hx | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/source/funkin/audio/waveform/WaveformSprite.hx b/source/funkin/audio/waveform/WaveformSprite.hx index 16247ed26..6ae139316 100644 --- a/source/funkin/audio/waveform/WaveformSprite.hx +++ b/source/funkin/audio/waveform/WaveformSprite.hx @@ -87,6 +87,15 @@ class WaveformSprite extends MeshRender return time; } + override function set_visible(value:Bool):Bool + { + if (visible == value) return value; + + visible = value; + isWaveformDirty = true; + return visible; + } + /** * The duration, in seconds, that the waveform represents. * The section of waveform from `time` to `time + duration` and `width` are used to determine how many samples each pixel represents. diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index f55903405..11f62328d 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -1939,6 +1939,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState */ var menubarItemViewSubtitles:MenuCheckBox; + /** + * The `View -> Waveforms` menu item. + */ + var menubarItemViewWaveforms:MenuCheckBox; + /** * The `View -> Increase Difficulty` menu item. */ @@ -3240,6 +3245,9 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState menubarItemViewSubtitles.onClick = event -> showSubtitles = menubarItemViewSubtitles.selected; menubarItemViewSubtitles.selected = showSubtitles; + menubarItemViewWaveforms.onClick = event -> audioWaveforms.visible = menubarItemViewWaveforms.selected; + menubarItemViewWaveforms.selected = audioWaveforms.visible; + menubarItemDifficultyUp.onClick = _ -> incrementDifficulty(1); menubarItemDifficultyDown.onClick = _ -> incrementDifficulty(-1);