Skip to content

Commit

Permalink
background text stuff
Browse files Browse the repository at this point in the history
TODO: Move this to FreeplayDJCreator
  • Loading branch information
lemz1 committed Nov 16, 2024
1 parent 68e2a80 commit 214fa00
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 9 deletions.
2 changes: 1 addition & 1 deletion assets
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>;

function get_ownedCharacters():Array<String>
{
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)
Expand All @@ -21,11 +51,6 @@ class PlayableCharacterSettingsDialog extends DefaultPageDialog

ownedCharsView.addComponent(ownedCharBox);
}

public function listOwnedCharacters():Array<String>
{
return ownedCharBox.listOwnedCharacters();
}
}

private class AddOwnedCharBox extends HBox
Expand All @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion source/funkin/ui/debug/char/pages/CharCreatorSelectPage.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 214fa00

Please sign in to comment.