From 214fa00ee416dd030bab09048919b5e787c7ce2c Mon Sep 17 00:00:00 2001 From: lemz1 Date: Sat, 16 Nov 2024 12:58:46 +0100 Subject: [PATCH] background text stuff TODO: Move this to FreeplayDJCreator --- assets | 2 +- .../PlayableCharacterSettingsDialog.hx | 39 +++++++++++++++---- .../debug/char/pages/CharCreatorSelectPage.hx | 4 +- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/assets b/assets index c5672733fb..25e93b5ac1 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit c5672733fb862b908a362d0094e65bdf5b59cd74 +Subproject commit 25e93b5ac179439129d797c8b281926f1f65410f diff --git a/source/funkin/ui/debug/char/components/dialogs/PlayableCharacterSettingsDialog.hx b/source/funkin/ui/debug/char/components/dialogs/PlayableCharacterSettingsDialog.hx index 645bcadd9b..ca9a83d8cf 100644 --- a/source/funkin/ui/debug/char/components/dialogs/PlayableCharacterSettingsDialog.hx +++ b/source/funkin/ui/debug/char/components/dialogs/PlayableCharacterSettingsDialog.hx @@ -8,9 +8,39 @@ import haxe.ui.data.ArrayDataSource; import funkin.data.character.CharacterRegistry; import funkin.util.SortUtil; +// TODO: Move bgText to FreeplayDJCreator + @:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/char-creator/dialogs/playable-character-settings-dialog.xml")) class PlayableCharacterSettingsDialog extends DefaultPageDialog { + public var ownedCharacters(get, never):Array; + + function get_ownedCharacters():Array + { + return ownedCharBox.listOwnedCharacters(); + } + + public var bgText1(get, never):String; + + function get_bgText1():String + { + return bgTextField1.value ?? bgTextField1.placeholder; + } + + public var bgText2(get, never):String; + + function get_bgText2():String + { + return bgTextField2.value ?? bgTextField2.placeholder; + } + + public var bgText3(get, never):String; + + function get_bgText3():String + { + return bgTextField3.value ?? bgTextField3.placeholder; + } + var ownedCharBox:AddOwnedCharBox; override public function new(daPage:CharCreatorDefaultPage) @@ -21,11 +51,6 @@ class PlayableCharacterSettingsDialog extends DefaultPageDialog ownedCharsView.addComponent(ownedCharBox); } - - public function listOwnedCharacters():Array - { - return ownedCharBox.listOwnedCharacters(); - } } private class AddOwnedCharBox extends HBox @@ -42,9 +67,9 @@ private class AddOwnedCharBox extends HBox verticalAlign = "center"; var addButton = new Button(); - addButton.text = "Add New Box"; + addButton.text = "Add"; var removeButton = new Button(); - removeButton.text = "Remove Last Box"; + removeButton.text = "Remove"; addButton.percentWidth = removeButton.percentWidth = 50; addButton.percentHeight = removeButton.percentHeight = 100; diff --git a/source/funkin/ui/debug/char/pages/CharCreatorSelectPage.hx b/source/funkin/ui/debug/char/pages/CharCreatorSelectPage.hx index 9b80fef7ae..03c46df9a0 100644 --- a/source/funkin/ui/debug/char/pages/CharCreatorSelectPage.hx +++ b/source/funkin/ui/debug/char/pages/CharCreatorSelectPage.hx @@ -383,9 +383,11 @@ class CharCreatorSelectPage extends CharCreatorDefaultPage public function toJSON():String { + var settingsDialog:PlayableCharacterSettingsDialog = cast dialogMap[SettingsDialog]; + var playerData:PlayerData = new PlayerData(); playerData.name = "Unknown"; - playerData.ownedChars = cast(dialogMap[SettingsDialog], PlayableCharacterSettingsDialog).listOwnedCharacters(); + playerData.ownedChars = settingsDialog.ownedCharacters; playerData.showUnownedChars = false; playerData.freeplayStyle = "bf"; playerData.freeplayDJ = null;