1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-20 13:53:13 +00:00

Implement difficulty rank into Metadata toolbox.

This commit is contained in:
EliteMasterEric 2024-02-08 19:22:28 -05:00
parent 401c200070
commit 4491465bf9
4 changed files with 31 additions and 3 deletions

2
assets

@ -1 +1 @@
Subproject commit 251d4640bd77ee0f0b6122a13f123274c43dd3f5
Subproject commit 02da1c72a22ddf8cc167f014888a94ebf468d5b1

View file

@ -418,10 +418,10 @@ class SongPlayData implements ICloneable<SongPlayData>
/**
* 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<String, Int>;
/**

View file

@ -1294,6 +1294,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<Int> = 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

View file

@ -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()}';