Merge branch 'rewrite/master' into feature/chart-editor-backup-popup

This commit is contained in:
Cameron Taylor 2023-11-23 20:08:13 -05:00
commit 811640ef6a
3 changed files with 24 additions and 9 deletions

View file

@ -8,6 +8,7 @@ import funkin.ui.TextMenuList;
import funkin.ui.debug.charting.ChartEditorState;
import funkin.ui.MusicBeatSubState;
import funkin.util.logging.CrashHandler;
import flixel.addons.transition.FlxTransitionableState;
class DebugMenuSubState extends MusicBeatSubState
{
@ -84,6 +85,8 @@ class DebugMenuSubState extends MusicBeatSubState
function openChartEditor()
{
FlxTransitionableState.skipNextTransIn = true;
FlxG.switchState(new ChartEditorState());
}

View file

@ -1959,16 +1959,21 @@ class ChartEditorState extends HaxeUIState
}
}
playbarHead.onDrag = function(_:DragEvent) {
if (playbarHeadDragging)
{
var value:Null<Float> = playbarHead?.value;
// Set the song position to where the playhead was moved to.
scrollPositionInPixels = songLengthInPixels * ((value ?? 0.0) / 100);
// Update the conductor and audio tracks to match.
moveSongToScrollPosition();
}
}
playbarHead.onDragEnd = function(_:DragEvent) {
playbarHeadDragging = false;
var value:Null<Float> = playbarHead?.value;
// Set the song position to where the playhead was moved to.
scrollPositionInPixels = songLengthInPixels * ((value ?? 0.0) / 100);
// Update the conductor and audio tracks to match.
moveSongToScrollPosition();
// If we were dragging the playhead while the song was playing, resume playing.
if (playbarHeadDraggingWasPlaying)
{
@ -3018,9 +3023,10 @@ class ChartEditorState extends HaxeUIState
if (FlxG.mouse.justReleased) FlxG.sound.play(Paths.sound("chartingSounds/ClickUp"));
// Note: If a menu is open in HaxeUI, don't handle cursor behavior.
var shouldHandleCursor:Bool = !(isHaxeUIFocused || playbarHeadDragging)
var shouldHandleCursor:Bool = !(isHaxeUIFocused || playbarHeadDragging || isHaxeUIDialogOpen)
|| (selectionBoxStartPos != null)
|| (dragTargetNote != null || dragTargetEvent != null);
var eventColumn:Int = (STRUMLINE_SIZE * 2 + 1) - 1;
// trace('shouldHandleCursor: $shouldHandleCursor');

View file

@ -102,7 +102,13 @@ class ChartEditorDialogHandler
if (chartPath == null) continue;
var linkRecentChart:Link = new Link();
linkRecentChart.text = chartPath;
// regex to only use the filename, not the full path
// "dadbattle.fnc" insted of "c:/user/docs/funkin/dadbattle.fnc"
// hovering tooltip shows full path
var fileNamePattern:EReg = new EReg("([^/\\\\]+)$", "");
var fileName:String = fileNamePattern.match(chartPath) ? fileNamePattern.matched(1) : chartPath;
linkRecentChart.text = fileName;
linkRecentChart.tooltip = chartPath;
linkRecentChart.onClick = function(_event) {
dialog.hideDialog(DialogButton.CANCEL);
state.stopWelcomeMusic();