mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-12-23 21:56:46 +00:00
Merge pull request #309 from FunkinCrew/feature/chart-editor-freeplay-difficulty
Implement difficulty rank into Metadata toolbox.
This commit is contained in:
commit
2d5b67d880
2
assets
2
assets
|
@ -1 +1 @@
|
|||
Subproject commit ba25cf692f7a09174860d50f011fef5643f68b0c
|
||||
Subproject commit 594853037cbea06caa5c141b0d9ed3736818e592
|
|
@ -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>;
|
||||
|
||||
/**
|
||||
|
|
|
@ -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<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
|
||||
|
|
|
@ -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()}';
|
||||
|
|
Loading…
Reference in a new issue