diff --git a/assets b/assets index ba25cf692..594853037 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit ba25cf692f7a09174860d50f011fef5643f68b0c +Subproject commit 594853037cbea06caa5c141b0d9ed3736818e592 diff --git a/source/funkin/data/song/SongData.hx b/source/funkin/data/song/SongData.hx index 7d5bc4e19..95ee117ab 100644 --- a/source/funkin/data/song/SongData.hx +++ b/source/funkin/data/song/SongData.hx @@ -418,10 +418,10 @@ class SongPlayData implements ICloneable /** * The difficulty ratings for this song as displayed in Freeplay. - * Key is a difficulty ID or `default`. + * Key is a difficulty ID. */ @:optional - @:default(['default' => 1]) + @:default(['normal' => 0]) public var ratings:Map; /** diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 53325acb8..dab79a21c 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -1296,6 +1296,29 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState return currentSongChartData.events = value; } + /** + * Convenience property to get the rating for this difficulty in the Freeplay menu. + */ + var currentSongChartDifficultyRating(get, set):Int; + + function get_currentSongChartDifficultyRating():Int + { + var result:Null = currentSongMetadata.playData.ratings.get(selectedDifficulty); + if (result == null) + { + // Initialize to the default value if not set. + currentSongMetadata.playData.ratings.set(selectedDifficulty, 0); + return 0; + } + return result; + } + + function set_currentSongChartDifficultyRating(value:Int):Int + { + currentSongMetadata.playData.ratings.set(selectedDifficulty, value); + return value; + } + var currentSongNoteStyle(get, set):String; function get_currentSongNoteStyle():String diff --git a/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx b/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx index 5d8c25bae..f85307c64 100644 --- a/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx +++ b/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx @@ -151,6 +151,10 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox labelScrollSpeed.text = 'Scroll Speed: ${chartEditorState.currentSongChartScrollSpeed}x'; }; + inputDifficultyRating.onChange = function(event:UIEvent) { + chartEditorState.currentSongChartDifficultyRating = event.target.value; + }; + buttonCharacterOpponent.onClick = function(_) { chartEditorState.openCharacterDropdown(CharacterType.DAD, false); }; @@ -175,6 +179,7 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox inputStage.value = chartEditorState.currentSongMetadata.playData.stage; inputNoteStyle.value = chartEditorState.currentSongMetadata.playData.noteStyle; inputBPM.value = chartEditorState.currentSongMetadata.timeChanges[0].bpm; + inputDifficultyRating.value = chartEditorState.currentSongChartDifficultyRating; inputScrollSpeed.value = chartEditorState.currentSongChartScrollSpeed; labelScrollSpeed.text = 'Scroll Speed: ${chartEditorState.currentSongChartScrollSpeed}x'; frameVariation.text = 'Variation: ${chartEditorState.selectedVariation.toTitleCase()}';