From 43b952b321b0a47b98ea1e00d92aa3ac2e5b9b0a Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Thu, 8 Sep 2022 16:39:31 -0400 Subject: [PATCH] char input haxeUI stuff --- .../ui/animDebugShit/DebugBoundingState.hx | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/source/funkin/ui/animDebugShit/DebugBoundingState.hx b/source/funkin/ui/animDebugShit/DebugBoundingState.hx index f92e38d67..cf28d23da 100644 --- a/source/funkin/ui/animDebugShit/DebugBoundingState.hx +++ b/source/funkin/ui/animDebugShit/DebugBoundingState.hx @@ -56,8 +56,6 @@ class DebugBoundingState extends FlxState var hudCam:FlxCamera; - var charInput:FlxUIDropDownMenu; - var curView:ANIMDEBUGVIEW = SPRITESHEET; var spriteSheetView:FlxGroup; @@ -113,11 +111,6 @@ class DebugBoundingState extends FlxState initSpritesheetView(); initOffsetView(); - // charInput = new FlxInputText(300, 10, 150, "bf", 16); - // charInput.focusCam = hudCam; - // charInput.cameras = [hudCam]; - // charInput.scrollFactor.set(); - uiStuff.cameras = [hudCam]; add(uiStuff); @@ -258,15 +251,16 @@ class DebugBoundingState extends FlxState var characters:Array = CoolUtil.coolTextFile(Paths.txt('characterList')); - // charInput isnt only exclusive to offsetView shit now - charInput = new FlxUIDropDownMenu(500, 20, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(str:String) + var charDropdown:DropDown = cast uiStuff.findComponent('characterDropdown'); + for (char in characters) { - loadAnimShit(characters[Std.parseInt(str)]); - // trace(); - }); - // charInput. - charInput.cameras = [hudCam]; - add(charInput); + charDropdown.dataSource.add({text: char}); + } + + charDropdown.onChange = function(e:UIEvent) + { + loadAnimShit(e.data.text); + }; } public var mouseOffset:FlxPoint = FlxPoint.get(0, 0); @@ -361,11 +355,6 @@ class DebugBoundingState extends FlxState if (FlxG.keys.justPressed.H) hudCam.visible = !hudCam.visible; - /* if (charInput.hasFocus && FlxG.keys.justPressed.ENTER) - { - loadAnimShit(); - }*/ - CoolUtil.mouseCamDrag(); CoolUtil.mouseWheelZoom(); @@ -480,6 +469,9 @@ class DebugBoundingState extends FlxState var swagChar:BaseCharacter; + /* + Called when animation dropdown is changed! + */ function loadAnimShit(char:String) { if (swagChar != null)