From d343018d900312dc1d13a8314e6c7222389e3dd7 Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Wed, 20 Mar 2024 19:38:31 -0700 Subject: [PATCH] waveforms bassicly done --- source/funkin/editors/charter/Charter.hx | 15 +++++++++++++-- .../editors/charter/CharterBackdropGroup.hx | 1 + source/funkin/editors/charter/CharterStrumline.hx | 2 +- .../editors/charter/CharterWaveformHandler.hx | 1 + source/funkin/options/Options.hx | 1 + 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 62fd5cde..273ec529 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -271,6 +271,12 @@ class Charter extends UIState { label: 'Show Beats Separator', onSelect: _view_showeventBeatSeparator, icon: Options.charterShowBeats ? 1 : 0 + }, + null, + { + label: 'Low Detail Waveforms', + onSelect: _view_switchWaveformDetail, + icon: Options.charterLowDetailWaveforms ? 1 : 0 } ] }, @@ -552,8 +558,8 @@ class Charter extends UIState { __relinkUndos(); __applyPlaytestInfo(); - var dataDisplay:FlxSprite = new FlxSprite().loadGraphic(waveformHandler.waveDatas.get("Voices.ogg")); - dataDisplay.cameras = [charterCamera]; dataDisplay.x = -dataDisplay.width; add(dataDisplay); + // var dataDisplay:FlxSprite = new FlxSprite().loadGraphic(waveformHandler.waveDatas.get("Voices.ogg")); + // dataDisplay.cameras = [charterCamera]; dataDisplay.x = -dataDisplay.width; add(dataDisplay); } public var __endStep:Float = 0; @@ -1494,6 +1500,11 @@ class Charter extends UIState { t.icon = (Options.charterShowBeats = !Options.charterShowBeats) ? 1 : 0; eventsBackdrop.eventBeatSeparator.visible = gridBackdrops.beatsVisible = Options.charterShowBeats; } + function _view_switchWaveformDetail(t) { + t.icon = (Options.charterLowDetailWaveforms = !Options.charterLowDetailWaveforms) ? 1 : 0; + for (shader in waveformHandler.waveShaders) shader.data.lowDetail.value = [Options.charterLowDetailWaveforms]; + } + inline function _snap_increasesnap(_) changequant(1); inline function _snap_decreasesnap(_) changequant(-1); inline function _snap_resetsnap(_) setquant(16); diff --git a/source/funkin/editors/charter/CharterBackdropGroup.hx b/source/funkin/editors/charter/CharterBackdropGroup.hx index ae65f7fe..e9240ad1 100644 --- a/source/funkin/editors/charter/CharterBackdropGroup.hx +++ b/source/funkin/editors/charter/CharterBackdropGroup.hx @@ -233,6 +233,7 @@ class CharterBackdrop extends FlxTypedGroup { waveformSprite.shader.data.pixelOffset.value = [Math.max(conductorFollowerSpr.y - ((FlxG.height * (1/cameras[0].zoom)) * 0.5), 0)]; waveformSprite.shader.data.textureRes.value = [waveformSprite.width, waveformSprite.height]; + waveformSprite.shader.data.playerPosition.value = [conductorFollowerSpr.y]; } } diff --git a/source/funkin/editors/charter/CharterStrumline.hx b/source/funkin/editors/charter/CharterStrumline.hx index f4e1fbb6..3850c2fa 100644 --- a/source/funkin/editors/charter/CharterStrumline.hx +++ b/source/funkin/editors/charter/CharterStrumline.hx @@ -179,7 +179,7 @@ class CharterStrumlineOptions extends UITopMenuButton { contextMenu.insert(1+i, { label: name, onSelect: function(_) {strLine.selectedWaveform = i;}, - icon: strLine.selectedWaveform == i ? 1 : 0 + icon: strLine.selectedWaveform == i ? 6 : 5 }); contextMenu.insert(1+Charter.waveformHandler.waveformList.length, null); diff --git a/source/funkin/editors/charter/CharterWaveformHandler.hx b/source/funkin/editors/charter/CharterWaveformHandler.hx index 8e48ee62..44ef5ee9 100644 --- a/source/funkin/editors/charter/CharterWaveformHandler.hx +++ b/source/funkin/editors/charter/CharterWaveformHandler.hx @@ -72,6 +72,7 @@ class CharterWaveformHandler extends FlxBasic { waveShader.data.waveformTexture.input = waveData; waveShader.data.textureRes.value = [0, 0]; waveShader.data.pixelOffset.value = [0]; + waveShader.data.lowDetail.value = [Options.charterLowDetailWaveforms]; waveShaders.set(name, waveShader); return waveShader; diff --git a/source/funkin/options/Options.hx b/source/funkin/options/Options.hx index 3f27a109..5935e623 100644 --- a/source/funkin/options/Options.hx +++ b/source/funkin/options/Options.hx @@ -62,6 +62,7 @@ class Options public static var charterShowSections:Bool = true; public static var charterShowBeats:Bool = true; public static var charterEnablePlaytestScripts:Bool = true; + public static var charterLowDetailWaveforms:Bool = false; /** * PLAYER 1 CONTROLS