From 25a66ddbfe04111126b4adaddc7c040513799929 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 21 Nov 2023 15:23:24 -0500 Subject: [PATCH] open recent on welcome screen --- .../debug/charting/handlers/ChartEditorDialogHandler.hx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx b/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx index 06da6ee12..c9229009c 100644 --- a/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx +++ b/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx @@ -101,7 +101,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();