From 2abc94de8d3a2b1a0a163cfb2c83806a7ba23be0 Mon Sep 17 00:00:00 2001 From: lemz1 Date: Sat, 2 Nov 2024 11:38:11 +0100 Subject: [PATCH] starting to implement export --- source/funkin/ui/debug/char/CharCreatorState.hx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/funkin/ui/debug/char/CharCreatorState.hx b/source/funkin/ui/debug/char/CharCreatorState.hx index b626c4be95..052435dd29 100644 --- a/source/funkin/ui/debug/char/CharCreatorState.hx +++ b/source/funkin/ui/debug/char/CharCreatorState.hx @@ -84,6 +84,8 @@ class CharCreatorState extends UIState if (FlxG.mouse.justPressed || FlxG.mouse.justPressedRight) FunkinSound.playOnce(Paths.sound("chartingSounds/ClickDown")); if (FlxG.mouse.justReleased || FlxG.mouse.justReleasedRight) FunkinSound.playOnce(Paths.sound("chartingSounds/ClickUp")); + handleShortcuts(); + if (!CharCreatorUtil.isCursorOverHaxeUI) { if (camGame.zoom > 0.11) MouseUtil.mouseWheelZoom(); @@ -96,6 +98,12 @@ class CharCreatorState extends UIState function setupUICallbacks() { menubarOptionGameplay.onChange = function(_) switchToPage(Gameplay); + menubarItemExport.onClick = _ -> exportCharacter(); + } + + function handleShortcuts():Void + { + if (FlxG.keys.pressed.CONTROL && FlxG.keys.justPressed.S) exportCharacter(); } function wizardComplete(params:WizardGenerateParams) @@ -150,6 +158,13 @@ class CharCreatorState extends UIState selectedPage.fillUpBottomBar(bottomBarLeftBox, bottomBarMiddleBox, bottomBarRightBox); selectedPage.fillUpPageSettings(menubarMenuSettings); } + + function exportCharacter():Void + { + funkin.util.FileUtil.saveFile(haxe.io.Bytes.ofString("lol"), [funkin.util.FileUtil.FILE_FILTER_JSON], (path:String) -> { + trace('PATH: $path'); + }); + } } enum CharCreatorPage