diff --git a/source/funkin/ui/debug/char/components/wizard/AddCharFilesDialog.hx b/source/funkin/ui/debug/char/components/wizard/AddCharFilesDialog.hx index a85ac296f6..dba55737ba 100644 --- a/source/funkin/ui/debug/char/components/wizard/AddCharFilesDialog.hx +++ b/source/funkin/ui/debug/char/components/wizard/AddCharFilesDialog.hx @@ -43,7 +43,8 @@ class AddCharFilesDialog extends DefaultWizardDialog addAssetsBox.addComponent(new UploadAssetsBox("Put the path to the Spritesheet Image here.", FileUtil.FILE_EXTENSION_INFO_PNG)); case CharacterRenderType.MultiSparrow: - recursiveUploadBox(); + addAssetsBox.addComponent(new UploadAssetsBox("Put the path to the Spritesheet Image here.", FileUtil.FILE_EXTENSION_INFO_PNG)); + addAssetsBox.addComponent(new AddAssetBox()); case CharacterRenderType.Packer: addAssetsBox.addComponent(new UploadAssetsBox("Put the path to the Spritesheet Image here.", FileUtil.FILE_EXTENSION_INFO_PNG)); @@ -81,7 +82,7 @@ class AddCharFilesDialog extends DefaultWizardDialog // check if the files even exist for (thingy in uploadBoxes) { - if (!FileUtil.doesFileExist(thingy.daField.text)) return false; + if (!FileUtil.doesFileExist(thingy.daField.text) && !openfl.Assets.exists(thingy.daField.text)) return false; } // we do a little trollin @@ -105,6 +106,7 @@ class AddCharFilesDialog extends DefaultWizardDialog // testing if we could actually use these var imgBytes = CharCreatorUtil.gimmeTheBytes(imgPath); var xmlBytes = CharCreatorUtil.gimmeTheBytes(xmlPath); + if (imgBytes == null || xmlBytes == null) return false; var tempSprite = new FlxSprite(); try @@ -144,6 +146,7 @@ class AddCharFilesDialog extends DefaultWizardDialog // testing if we could actually use these var imgBytes = CharCreatorUtil.gimmeTheBytes(imgPath); var txtBytes = CharCreatorUtil.gimmeTheBytes(txtPath); + if (imgBytes == null || txtBytes == null) return false; var tempSprite = new FlxSprite(); try @@ -230,13 +233,62 @@ class AddCharFilesDialog extends DefaultWizardDialog } } +class AddAssetBox extends HBox +{ + override public function new() + { + super(); + + styleString = "border:1px solid $normal-border-color"; + percentWidth = 100; + height = 25; + verticalAlign = "center"; + + var addButton = new Button(); + addButton.text = "Add New Box"; + var removeButton = new Button(); + removeButton.text = "Remove Last Box"; + + addButton.percentWidth = removeButton.percentWidth = 50; + addButton.percentHeight = removeButton.percentHeight = 100; + + addButton.onClick = function(_) { + var parentList = this.parentComponent; + if (parentList == null) return; + + var first = parentList.childComponents[0]; + if (!Std.isOfType(first, UploadAssetsBox)) return; + + var firstBox:UploadAssetsBox = cast first; + + var newBox = new UploadAssetsBox(firstBox.daField.placeholder, firstBox.lookFor); + parentList.addComponentAt(newBox, parentList.childComponents.length - 1); // considering this box is last + removeButton.disabled = false; + } + + removeButton.disabled = true; + removeButton.onClick = function(_) { + var parentList = this.parentComponent; + if (parentList == null) return; + + parentList.removeComponentAt(parentList.childComponents.length - 2); + if (parentList.childComponents.length <= 2) removeButton.disabled = true; + } + + addComponent(addButton); + addComponent(removeButton); + } +} + class UploadAssetsBox extends HBox { public var daField:TextField; + public var lookFor:FileDialogExtensionInfo = null; override public function new(title:String = "", lookFor:FileDialogExtensionInfo = null) { super(); + this.lookFor = lookFor; styleString = "border:1px solid $normal-border-color"; percentWidth = 100; diff --git a/source/funkin/ui/debug/char/pages/subpages/CharSelectIndexSubPage.hx b/source/funkin/ui/debug/char/pages/subpages/CharSelectIndexSubPage.hx index 2b4351dfac..4f55a77bbb 100644 --- a/source/funkin/ui/debug/char/pages/subpages/CharSelectIndexSubPage.hx +++ b/source/funkin/ui/debug/char/pages/subpages/CharSelectIndexSubPage.hx @@ -62,7 +62,7 @@ class CharSelectIndexSubPage extends FlxSpriteGroup if (!isSelecting) { changeSelectedIcon(); - + updateIconAnims(); handleMousePress(); if (FlxG.keys.justPressed.X) @@ -333,4 +333,31 @@ class CharSelectIndexSubPage extends FlxSpriteGroup cursorLocIntended.put(); } + + var selectedBizz:Array = [ + new openfl.filters.DropShadowFilter(0, 0, 0xFFFFFF, 1, 2, 2, 19, 1, false, false, false), + new openfl.filters.DropShadowFilter(5, 45, 0x000000, 1, 2, 2, 1, 1, false, false, false) + ]; + + function updateIconAnims():Void + { + for (index => member in grpIcons.group.members) + { + if (Std.isOfType(member, PixelatedIcon)) + { + var memb:PixelatedIcon = cast member; + + if (index == cursorIndex) + { + memb.filters = selectedBizz; + memb.scale.set(2.6, 2.6); + } + else + { + memb.filters = null; + memb.scale.set(2, 2); + } + } + } + } }