From 0f8af2ca504d27e33ffb0078da87e45f0b7d0284 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 18 Jan 2024 22:08:01 -0500 Subject: [PATCH 1/5] Switch branches for HaxeUI-Flixel --- hmm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index 7e17f105c..cd3a9063c 100644 --- a/hmm.json +++ b/hmm.json @@ -61,7 +61,7 @@ "name": "haxeui-flixel", "type": "git", "dir": null, - "ref": "1ec470c297afd7758a90dc9399aa1e3a4ea6ca0b", + "ref": "566872c5c697916ecbb7378808413ef7ed926dd0", "url": "https://github.com/haxeui/haxeui-flixel" }, { From d215152aaff9997179c9c09a2f445f75516433cf Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 18 Jan 2024 22:28:25 -0500 Subject: [PATCH 2/5] Fix a bug where removing audio tracks wouldn't remove their visualizers. --- .../funkin/audio/visualize/PolygonVisGroup.hx | 40 ++++++++++++++++++- .../handlers/ChartEditorAudioHandler.hx | 4 ++ 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/source/funkin/audio/visualize/PolygonVisGroup.hx b/source/funkin/audio/visualize/PolygonVisGroup.hx index 2903eaccd..cc68f4ae0 100644 --- a/source/funkin/audio/visualize/PolygonVisGroup.hx +++ b/source/funkin/audio/visualize/PolygonVisGroup.hx @@ -8,8 +8,7 @@ class PolygonVisGroup extends FlxTypedGroup { public var playerVis:PolygonSpectogram; public var opponentVis:PolygonSpectogram; - - var instVis:PolygonSpectogram; + public var instVis:PolygonSpectogram; public function new() { @@ -51,6 +50,43 @@ class PolygonVisGroup extends FlxTypedGroup instVis = vis; } + public function clearPlayerVis():Void + { + if (playerVis != null) + { + remove(playerVis); + playerVis.destroy(); + playerVis = null; + } + } + + public function clearOpponentVis():Void + { + if (opponentVis != null) + { + remove(opponentVis); + opponentVis.destroy(); + opponentVis = null; + } + } + + public function clearInstVis():Void + { + if (instVis != null) + { + remove(instVis); + instVis.destroy(); + instVis = null; + } + } + + public function clearAllVis():Void + { + clearPlayerVis(); + clearOpponentVis(); + clearInstVis(); + } + /** * Overrides the add function to add a visualizer to the group. * @param vis The visualizer to add. diff --git a/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx b/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx index d7fbd42c2..f402574fd 100644 --- a/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx +++ b/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx @@ -223,6 +223,10 @@ class ChartEditorAudioHandler { state.audioVocalTrackGroup.clear(); } + if (state.audioVisGroup != null) + { + state.audioVisGroup.clearAllVis(); + } } /** From 9adfd0b6f16dd3e3f016431851edd489be30bede Mon Sep 17 00:00:00 2001 From: Jenny Crowe Date: Fri, 19 Jan 2024 21:02:43 -0700 Subject: [PATCH 3/5] Vocal offset is now properly taken into account when playing a song --- .../ui/debug/charting/ChartEditorState.hx | 57 +++++++++++++++++++ .../handlers/ChartEditorAudioHandler.hx | 4 +- .../toolboxes/ChartEditorMetadataToolbox.hx | 7 ++- 3 files changed, 65 insertions(+), 3 deletions(-) diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index c9f1e4137..27a899aef 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -1395,6 +1395,46 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState return currentSongMetadata.artist = value; } + /** + * Convenience property to get the player charId for the current variation. + */ + var currentPlayerChar(get, set):String; + + function get_currentPlayerChar():String + { + if (currentSongMetadata.playData.characters.player == null) + { + // Initialize to the default value if not set. + currentSongMetadata.playData.characters.player = Constants.DEFAULT_CHARACTER; + } + return currentSongMetadata.playData.characters.player; + } + + function set_currentPlayerChar(value:String):String + { + return currentSongMetadata.playData.characters.player = value; + } + + /** + * Convenience property to get the opponent charId for the current variation. + */ + var currentOpponentChar(get, set):String; + + function get_currentOpponentChar():String + { + if (currentSongMetadata.playData.characters.opponent == null) + { + // Initialize to the default value if not set. + currentSongMetadata.playData.characters.opponent = Constants.DEFAULT_CHARACTER; + } + return currentSongMetadata.playData.characters.opponent; + } + + function set_currentOpponentChar(value:String):String + { + return currentSongMetadata.playData.characters.opponent = value; + } + /** * Convenience property to get the song offset data for the current variation. */ @@ -1430,6 +1470,23 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState return value; } + var currentVocalOffset(get, set):Float; + + function get_currentVocalOffset():Float + { + // Currently there's only one vocal offset, so we just grab the player's offset since both should be the same. + // Should probably make it so we can set offsets for player + opponent individually, though. + return currentSongOffsets.getVocalOffset(currentPlayerChar); + } + + function set_currentVocalOffset(value:Float):Float + { + // Currently there's only one vocal offset, so we just apply it to both characters. + currentSongOffsets.setVocalOffset(currentPlayerChar, value); + currentSongOffsets.setVocalOffset(currentOpponentChar, value); + return value; + } + /** * The variation ID for the difficulty which is currently being edited. */ diff --git a/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx b/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx index d7fbd42c2..0764d7af3 100644 --- a/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx +++ b/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx @@ -190,7 +190,7 @@ class ChartEditorAudioHandler state.audioVisGroup.playerVis.detail = 1; state.audioVisGroup.playerVis.y = Math.max(state.gridTiledSprite?.y ?? 0.0, ChartEditorState.GRID_INITIAL_Y_POS - ChartEditorState.GRID_TOP_PAD); - state.audioVocalTrackGroup.playerVoicesOffset = state.currentSongOffsets.getVocalOffset(charId); + state.audioVocalTrackGroup.playerVoicesOffset = state.currentVocalOffset; return true; case DAD: state.audioVocalTrackGroup.addOpponentVoice(vocalTrack); @@ -202,7 +202,7 @@ class ChartEditorAudioHandler state.audioVisGroup.opponentVis.detail = 1; state.audioVisGroup.opponentVis.y = Math.max(state.gridTiledSprite?.y ?? 0.0, ChartEditorState.GRID_INITIAL_Y_POS - ChartEditorState.GRID_TOP_PAD); - state.audioVocalTrackGroup.opponentVoicesOffset = state.currentSongOffsets.getVocalOffset(charId); + state.audioVocalTrackGroup.opponentVoicesOffset = state.currentVocalOffset; return true; case OTHER: diff --git a/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx b/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx index 06b20ed7c..c69ed9ddf 100644 --- a/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx +++ b/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx @@ -150,7 +150,12 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox inputOffsetVocal.onChange = function(event:UIEvent) { if (event.value == null) return; - chartEditorState.currentSongMetadata.offsets.setVocalOffset(chartEditorState.currentSongMetadata.playData.characters.player, event.value); + chartEditorState.currentVocalOffset = event.value; + if (chartEditorState.audioVocalTrackGroup != null) + { + chartEditorState.audioVocalTrackGroup.playerVoicesOffset = event.value; + chartEditorState.audioVocalTrackGroup.opponentVoicesOffset = event.value; + } }; inputScrollSpeed.onChange = function(event:UIEvent) { var valid:Bool = event.target.value != null && event.target.value > 0; From a7e9f08e2659ca879da757788ad61b039613e680 Mon Sep 17 00:00:00 2001 From: Jenny Crowe Date: Fri, 19 Jan 2024 21:24:18 -0700 Subject: [PATCH 4/5] Editor now loads saved inst/vocal offset properly. --- source/funkin/play/song/Song.hx | 1 + .../ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/source/funkin/play/song/Song.hx b/source/funkin/play/song/Song.hx index 089eb6c92..0434607f3 100644 --- a/source/funkin/play/song/Song.hx +++ b/source/funkin/play/song/Song.hx @@ -235,6 +235,7 @@ class Song implements IPlayStateScriptedClass implements IRegistryEntry Date: Thu, 25 Jan 2024 22:46:47 -0500 Subject: [PATCH 5/5] haxeui hmm update to latest --- hmm.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hmm.json b/hmm.json index cd3a9063c..4b2885a87 100644 --- a/hmm.json +++ b/hmm.json @@ -54,14 +54,14 @@ "name": "haxeui-core", "type": "git", "dir": null, - "ref": "bb904f8b4b205755a310c23ff25219f9dcd62711", + "ref": "5b2d5b8e7e470cf637953e1369c80a1f42016a75", "url": "https://github.com/haxeui/haxeui-core" }, { "name": "haxeui-flixel", "type": "git", "dir": null, - "ref": "566872c5c697916ecbb7378808413ef7ed926dd0", + "ref": "e9f880522e27134b29df4067f82df7d7e5237b70", "url": "https://github.com/haxeui/haxeui-flixel" }, {