From f95ac046d6197f69cafe86fc640319aba267cf35 Mon Sep 17 00:00:00 2001 From: Ralty <78720179+Raltyro@users.noreply.github.com> Date: Sat, 19 Jul 2025 01:38:58 +0700 Subject: [PATCH] Whoops! --- .../editors/character/CharacterInfoScreen.hx | 69 +++---------------- .../editors/charter/CharterStrumlineButton.hx | 2 +- .../editors/charter/SongCreationScreen.hx | 11 +-- .../options/keybinds/KeybindsOptions.hx | 1 + 4 files changed, 19 insertions(+), 64 deletions(-) diff --git a/source/funkin/editors/character/CharacterInfoScreen.hx b/source/funkin/editors/character/CharacterInfoScreen.hx index 251be501..8241c198 100644 --- a/source/funkin/editors/character/CharacterInfoScreen.hx +++ b/source/funkin/editors/character/CharacterInfoScreen.hx @@ -8,8 +8,6 @@ import openfl.geom.Point; import openfl.geom.Rectangle; import openfl.display.BitmapData; import funkin.game.Character; -import funkin.game.HealthIcon; -import haxe.xml.Access; using funkin.backend.utils.BitmapUtil; @@ -24,12 +22,6 @@ class CharacterInfoScreen extends UISubstateWindow { public var character:Character; public var iconColorPicker:UIIconColorPicker; - public var spriteTextBox:UITextBox; - public var iconTextBox:UITextBox; - public var iconSprite:HealthIcon; - public var gameOverCharTextBox:UITextBox; - public var antialiasingCheckbox:UICheckbox; - public var flipXCheckbox:UICheckbox; public var iconColorWheel:UIColorwheel; public var useDurationCheckbox:UICheckbox; @@ -109,58 +101,17 @@ class CharacterInfoScreen extends UISubstateWindow { closeButton.color = 0xFFFF0000; } - function updateIcon(icon:String) { - if (iconSprite == null) add(iconSprite = new HealthIcon()); - - iconSprite.setIcon(icon); - var size = Std.int(150 * 0.5); - iconSprite.setUnstretchedGraphicSize(size, size, true); - iconSprite.updateHitbox(); - iconSprite.setPosition(iconTextBox.x + iconTextBox.bWidth + 8, iconTextBox.y + (iconTextBox.bHeight / 2) - (iconSprite.height / 2)); - iconSprite.scrollFactor.set(1, 1); - } - - function saveCharacterInfo() { + public function saveCharacterInfo() { UIUtil.confirmUISelections(this); - //for (stepper in [positionXStepper, positionYStepper, cameraXStepper, cameraYStepper, singTimeStepper, scaleStepper]) - // @:privateAccess stepper.__onChange(stepper.label.text); - - var xml = Xml.createElement("character"); - xml.set("isPlayer", isPlayerCheckbox.checked ? "true" : "false"); - xml.set("x", Std.string(positionXStepper.value)); - xml.set("y", Std.string(positionYStepper.value)); - xml.set("gameOverChar", gameOverCharTextBox.label.text); - xml.set("camx", Std.string(cameraXStepper.value)); - xml.set("camy", Std.string(cameraYStepper.value)); - xml.set("holdTime", Std.string(singTimeStepper.value)); - xml.set("flipX", Std.string(flipXCheckbox.checked)); - xml.set("icon", iconTextBox.label.text); - xml.set("scale", Std.string(scaleStepper.value)); - xml.set("antialiasing", antialiasingCheckbox.checked ? "true" : "false"); - xml.set("sprite", spriteTextBox.label.text); - if (iconColorWheel.colorChanged) - xml.set("color", iconColorWheel.curColor.toWebString()); - for (val in customPropertiesButtonList.buttons.members) - xml.set(val.propertyText.label.text, val.valueText.label.text); - - for (anim in character.animDatas) - { - var animXml:Xml = Xml.createElement('anim'); - animXml.set("name", anim.name); - animXml.set("anim", anim.anim); - animXml.set("loop", Std.string(anim.loop)); - animXml.set("fps", Std.string(anim.fps)); - var offset:FlxPoint = character.getAnimOffset(anim.name); - animXml.set("x", Std.string(offset.x)); - animXml.set("y", Std.string(offset.y)); - offset.put(); - - if (anim.indices.length > 0) - animXml.set("indices", CoolUtil.formatNumberRange(anim.indices)); - xml.addChild(animXml); - } - - if (onSave != null) onSave(xml); + if (onSave != null) onSave({ + icon: iconColorPicker.iconTextBox.label.text, + iconColor: iconColorWheel.curColor, + holdTime: useDurationCheckbox.checked ? durationStepper.value : -1, + customProperties: [ + for (val in customPropertiesButtonList.buttons.members) + val.propertyText.label.text => val.valueText.label.text + ] + }); } } \ No newline at end of file diff --git a/source/funkin/editors/charter/CharterStrumlineButton.hx b/source/funkin/editors/charter/CharterStrumlineButton.hx index 402c73ee..a1955248 100644 --- a/source/funkin/editors/charter/CharterStrumlineButton.hx +++ b/source/funkin/editors/charter/CharterStrumlineButton.hx @@ -58,8 +58,8 @@ class CharterStrumlineButton extends UISprite { super.update(elapsed); + button.updateSpriteRect(); if (UIState.state.curContextMenu == null && UIState.state.isOverlapping(button, button.__rect) && button.visible) { - UIState.state.updateSpriteRect(button); buttonScale.set(0.95, 0.95); if (FlxG.mouse.justPressed && onClick != null) { onClick(); diff --git a/source/funkin/editors/charter/SongCreationScreen.hx b/source/funkin/editors/charter/SongCreationScreen.hx index 9ce8513f..167147d0 100644 --- a/source/funkin/editors/charter/SongCreationScreen.hx +++ b/source/funkin/editors/charter/SongCreationScreen.hx @@ -110,7 +110,8 @@ class SongCreationScreen extends UISubstateWindow { stepsPerBeatStepper = new UINumericStepper(beatsPerMeasureStepper.x + 30 + 24, beatsPerMeasureStepper.y, 4, 1, 0, 1, null, 54); songDataGroup.add(stepsPerBeatStepper); - instExplorer = new UIFileExplorer(songNameTextBox.x, songNameTextBox.y + 32 + 36, null, null, Flags.SOUND_EXT, function (res) { + instExplorer = new UIFileExplorer(songNameTextBox.x, songNameTextBox.y + 32 + 36, null, null, Flags.SOUND_EXT, function (path, res) { + if (path == null || res == null) return; var audioPlayer:UIAudioPlayer = new UIAudioPlayer(instExplorer.x + 8, instExplorer.y + 8, res); instExplorer.members.push(audioPlayer); instExplorer.uiElement = audioPlayer; @@ -186,7 +187,8 @@ class SongCreationScreen extends UISubstateWindow { var menuTitle:UIText; importAudioGroup.add(menuTitle = new UIText(windowSpr.x + 20, windowSpr.y + 30 + 16, 0, "Add Audios", 28)); - importInstExplorer = new UIFileExplorer(menuTitle.x, menuTitle.y + menuTitle.height + 36, null, null, Flags.SOUND_EXT, function (res) { + importInstExplorer = new UIFileExplorer(menuTitle.x, menuTitle.y + menuTitle.height + 36, null, null, Flags.SOUND_EXT, function (path, res) { + if (path == null || res == null) return; var audioPlayer:UIAudioPlayer = new UIAudioPlayer(importInstExplorer.x + 8, importInstExplorer.y + 8, res); importInstExplorer.members.push(audioPlayer); importInstExplorer.uiElement = audioPlayer; @@ -196,7 +198,8 @@ class SongCreationScreen extends UISubstateWindow { "Inst Audio File $* Required$", [new FlxTextFormatMarkerPair(new FlxTextFormat(0xFFAD1212), "$")]); - importVoicesExplorer = new UIFileExplorer(importInstExplorer.x + 320 + 26, importInstExplorer.y, null, null, Flags.SOUND_EXT, function (res) { + importVoicesExplorer = new UIFileExplorer(importInstExplorer.x + 320 + 26, importInstExplorer.y, null, null, Flags.SOUND_EXT, function (path, res) { + if (path == null || res == null) return; var audioPlayer:UIAudioPlayer = new UIAudioPlayer(importVoicesExplorer.x + 8, importVoicesExplorer.y + 8, res); importVoicesExplorer.members.push(audioPlayer); importVoicesExplorer.uiElement = audioPlayer; @@ -212,7 +215,7 @@ class SongCreationScreen extends UISubstateWindow { "Song file name $* Required$", [new FlxTextFormatMarkerPair(new FlxTextFormat(0xFFAD1212), "$")]); - importChartFile = new UIFileExplorer(importIdTextBox.x, importIdTextBox.y + importIdTextBox.height + 56, null, null, "fnfc", function (_) importIdTextBox.label.text = new haxe.io.Path(importChartFile.filePath).file); + importChartFile = new UIFileExplorer(importIdTextBox.x, importIdTextBox.y + importIdTextBox.height + 56, null, null, "fnfc", function (_, _) importIdTextBox.label.text = new haxe.io.Path(importChartFile.filePath).file); importDataGroup.add(importChartFile); addLabelOn(importChartFile, "Data/Chart File").applyMarkup( "Data/Chart File $* Required$", diff --git a/source/funkin/options/keybinds/KeybindsOptions.hx b/source/funkin/options/keybinds/KeybindsOptions.hx index b330a6e8..861296ba 100644 --- a/source/funkin/options/keybinds/KeybindsOptions.hx +++ b/source/funkin/options/keybinds/KeybindsOptions.hx @@ -352,4 +352,5 @@ typedef KeybindSettingData = { typedef ControlsCategory = { var name:String; var settings:Array; + var ?devModeOnly:Bool; } \ No newline at end of file