mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-23 08:07:54 -05:00
Merge pull request #234 from FunkinCrew/polish/welcome-screen
more info on playbar
This commit is contained in:
commit
0899c60e8d
5 changed files with 46 additions and 8 deletions
2
assets
2
assets
|
@ -1 +1 @@
|
|||
Subproject commit 2dd4ab0eb9979422c1c4cb849ebe899b7bf1758a
|
||||
Subproject commit f3e9cd8355f20445fcad7030fdb6363a2325adb3
|
|
@ -35,15 +35,15 @@ class Conductor
|
|||
static var timeChanges:Array<SongTimeChange> = [];
|
||||
|
||||
/**
|
||||
* The current time change.
|
||||
* The most recent time change for the current song position.
|
||||
*/
|
||||
static var currentTimeChange:SongTimeChange;
|
||||
public static var currentTimeChange(default, null):SongTimeChange;
|
||||
|
||||
/**
|
||||
* The current position in the song in milliseconds.
|
||||
* Updated every frame based on the audio position.
|
||||
* Update this every frame based on the audio position using `Conductor.update()`.
|
||||
*/
|
||||
public static var songPosition:Float = 0;
|
||||
public static var songPosition(default, null):Float = 0;
|
||||
|
||||
/**
|
||||
* Beats per minute of the current song at the current time.
|
||||
|
|
|
@ -2085,10 +2085,34 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
if (noteSnapQuantIndex < 0) noteSnapQuantIndex = SNAP_QUANTS.length - 1;
|
||||
};
|
||||
playbarNoteSnap.onClick = _ -> {
|
||||
noteSnapQuantIndex++;
|
||||
if (noteSnapQuantIndex >= SNAP_QUANTS.length) noteSnapQuantIndex = 0;
|
||||
if (FlxG.keys.pressed.SHIFT)
|
||||
{
|
||||
noteSnapQuantIndex = BASE_QUANT_INDEX;
|
||||
}
|
||||
else
|
||||
{
|
||||
noteSnapQuantIndex++;
|
||||
if (noteSnapQuantIndex >= SNAP_QUANTS.length) noteSnapQuantIndex = 0;
|
||||
}
|
||||
};
|
||||
|
||||
playbarBPM.onClick = _ -> {
|
||||
if (FlxG.keys.pressed.CONTROL)
|
||||
{
|
||||
this.setToolboxState(CHART_EDITOR_TOOLBOX_METADATA_LAYOUT, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
Conductor.currentTimeChange.bpm += 1;
|
||||
refreshMetadataToolbox();
|
||||
}
|
||||
}
|
||||
|
||||
playbarBPM.onRightClick = _ -> {
|
||||
Conductor.currentTimeChange.bpm -= 1;
|
||||
refreshMetadataToolbox();
|
||||
}
|
||||
|
||||
// Add functionality to the menu items.
|
||||
|
||||
// File
|
||||
|
@ -2264,6 +2288,10 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
menubarLabelPlaybackSpeed.text = 'Playback Speed - ${pitchDisplay}x';
|
||||
}
|
||||
|
||||
playbarDifficulty.onClick = _ -> {
|
||||
this.setToolboxState(CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT, true);
|
||||
}
|
||||
|
||||
menubarItemToggleToolboxDifficulty.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT, event.value);
|
||||
menubarItemToggleToolboxMetadata.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_METADATA_LAYOUT, event.value);
|
||||
menubarItemToggleToolboxNotes.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_NOTEDATA_LAYOUT, event.value);
|
||||
|
@ -3979,6 +4007,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
if (playbarSongRemaining.value != songRemainingString) playbarSongRemaining.value = songRemainingString;
|
||||
|
||||
playbarNoteSnap.text = '1/${noteSnapQuant}';
|
||||
playbarDifficulty.text = "Difficulty: " + selectedDifficulty.toTitleCase();
|
||||
playbarBPM.text = "BPM: " + Conductor.currentTimeChange.bpm;
|
||||
}
|
||||
|
||||
function handlePlayhead():Void
|
||||
|
|
|
@ -83,10 +83,18 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog
|
|||
public function addRecentFilePath(state:ChartEditorState, chartPath:String):Void
|
||||
{
|
||||
var linkRecentChart:Link = new Link();
|
||||
|
||||
var fileNamePattern:EReg = new EReg("([^/\\\\]+)$", "");
|
||||
var fileName:String = fileNamePattern.match(chartPath) ? fileNamePattern.matched(1) : chartPath;
|
||||
linkRecentChart.text = fileName;
|
||||
|
||||
linkRecentChart.tooltip = chartPath;
|
||||
|
||||
#if sys
|
||||
var lastModified:String = "Last Modified: " + sys.FileSystem.stat(chartPath).mtime.toString();
|
||||
linkRecentChart.tooltip += "\n" + lastModified;
|
||||
#end
|
||||
|
||||
linkRecentChart.onClick = function(_event) {
|
||||
this.hideDialog(DialogButton.CANCEL);
|
||||
|
||||
|
|
|
@ -267,7 +267,7 @@ class LatencyState extends MusicBeatSubState
|
|||
|
||||
function generateBeatStuff()
|
||||
{
|
||||
Conductor.songPosition = swagSong.getTimeWithDiff();
|
||||
Conductor.update(swagSong.getTimeWithDiff());
|
||||
|
||||
var closestBeat:Int = Math.round(Conductor.songPosition / Conductor.beatLengthMs) % diffGrp.members.length;
|
||||
var getDiff:Float = Conductor.songPosition - (closestBeat * Conductor.beatLengthMs);
|
||||
|
|
Loading…
Reference in a new issue