From ef532885ce623de0981052d3b4f87788c377b679 Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Tue, 23 Apr 2024 19:44:43 -0700 Subject: [PATCH] i forgot --- .../images/editors/character/edit-button.png | Bin 335 -> 389 bytes .../images/editors/character/ghost-button.png | Bin 287 -> 0 bytes assets/images/editors/character/ghost.png | Bin 0 -> 248 bytes .../editors/character/CharacterAnimButton.hx | 73 +++++++++++++++--- .../editors/character/CharacterAnimsWindow.hx | 2 +- 5 files changed, 62 insertions(+), 13 deletions(-) delete mode 100644 assets/images/editors/character/ghost-button.png create mode 100644 assets/images/editors/character/ghost.png diff --git a/assets/images/editors/character/edit-button.png b/assets/images/editors/character/edit-button.png index e0018a547525ca652a7510bc245fab0b2904a965..bcbcaf6b903be078669efd376cf4f219201971aa 100644 GIT binary patch literal 389 zcmV;00eb$4P)Px$KS@MER7i>ClOb<|Kp2MKBdcvvU6z!9nOWLpe`8`6!9SSpT$8GyYpN00iS}nS zYlFc+5FMHXTX7T3v1|Fb9k;o?34(*?yNB;P7|!AN4nzMK^A-Re#SW6xMpcK`#k4m6 z4R6Ueqv70C!kBLa?(aU4q&AM_%1FYL7xUs#>|i=OH4kpbFBlEy@;j=K{Nuwb@~rV7 z>&T0(A^`CGR3gu~k%ZtE%LxL%ASL88zyiO(VLt$HZmC?nvOxtL-FsMF#zDOAGA6_w$}C7g{deY^3(ZH@z)YJRDnF>pynyE z*{;cTiDv+KRfjm1E9JXZ$NI%Qf|fAst$RQ+DcZ} jM!Px$2}wjjR5*>DlCe(1Fcd{k{11`Uq3YZnDJwsKqAXol*cpn2g!~B+5=t1dF|e?( zL=iv0z!E7t0~2CE5&zII*|Oub4cyUw=lZ_)3^SFb$uPHe68?C28>UR6Iq>Dl6#%Qn zlAD)n>ZY~aK?4J?7E3%VXEK?V zS(*&n%{nkKu$1v$*h{e8tf`w8rTwp=wAc%K2B+tbygpsnxW`^Lin25r>ZY}@(f#xL hQ5c*pj4$TE0KZP1j^USEO4R@W002ovPDHLkV1j?Zk~IJT diff --git a/assets/images/editors/character/ghost-button.png b/assets/images/editors/character/ghost-button.png deleted file mode 100644 index 65e136bcc57de276d84a9da945b335cf6df9d177..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 287 zcmV+)0pR|LP)Px#*-1n}R7i=fm0=EpFbIXgc%oiq*W6X4M`Ay=Hk3Y;>Rw_@jUT)MR;ECzs_1#G zby$~D_z4fetVCo=vdV86*IC`+hw`lkVCGAnnMqaq-Sc}}pmO>kO{k9|q9_?kZu!jz za+~TwywLEWWY!eocXG;hp;gQpi7J5N4iy)XmEj%qm`5Px#vPnciR5*>rlg$moAPj{cy_XA77s(X4;2E4vGDT+Wfr}S#Pe`Ew@gvlJ5;C&L zd*+D%f5sI0I`GYqMovscJ8ufrtPAM1*DCz|8gOzY`F=h7#D1Gtt?PvoC?j yQ{N4q^GF`ywe}{E(`fk%a5+$_O&6J<@f$u$`w^bp1wu&x0000 = []; public function new(x:Float, y:Float, animData:AnimData, parent:CharacterAnimsWindow) { @@ -28,7 +39,7 @@ class CharacterAnimButton extends UIButton { this.parent = parent; super(x,y, '${animData.name} (${animData.x}, ${animData.y})', function () { CharacterEditor.instance.playAnimation(this.anim); - }, Std.int(500-16-32), 184); + }, Std.int(500-16-32), 208); function addLabelOn(ui:UISprite, text:String, ?size:Int):UIText { var uiText:UIText = new UIText(ui.x, ui.y-18, 0, text, size); @@ -40,7 +51,8 @@ class CharacterAnimButton extends UIButton { frames = Paths.getFrames('editors/ui/inputbox'); field.fieldWidth = 0; framesOffset = 9; - field.visible = false; + field.size = 14; + // field.visible = false; animationDisplayBG = new UISliceSprite(x+12, y+12+18+12, 128, 128, 'editors/ui/inputbox-small'); members.push(animationDisplayBG); @@ -75,23 +87,60 @@ class CharacterAnimButton extends UIButton { indicesTextBox = new UITextBox(nameTextBox.x, nameTextBox.y, animData.indices.getDefault([]).join(","), 278, 22, false, true); members.push(indicesTextBox); addLabelOn(indicesTextBox, "Indices (frames)", 12); + + editIcon = new FlxSprite().loadGraphic(Paths.image('editors/character/edit-button'), true, 16, 16); + editIcon.animation.add("open", [0]); + editIcon.animation.add("closed", [1]); + editIcon.animation.play("closed"); + editIcon.antialiasing = false; + editIcon.updateHitbox(); + members.push(editIcon); + + deleteButton = new UIButton(0, 0, "", null, 28*2,24); + deleteButton.color = 0xFFAC3D3D; + members.push(deleteButton); + + deleteIcon = new FlxSprite(x-(10+16), y+8).loadGraphic(Paths.image("editors/deleter")); + deleteIcon.color = 0xFFD60E0E; + deleteIcon.antialiasing = false; + members.push(deleteIcon); + + ghostButton = new UIButton(0, 0, "", null, 28,24); + ghostButton.color = 0xFFADADAD; + ghostButton.alpha = 0.5; + members.push(ghostButton); + + ghostIcon = new FlxSprite(x-(10+16), y+8).loadGraphic(Paths.image('editors/character/ghost'), true, 16, 12); + ghostIcon.animation.add("alive", [0]); + ghostIcon.animation.add("dead", [1]); + ghostIcon.animation.play("dead"); + ghostIcon.antialiasing = false; + ghostIcon.updateHitbox(); + members.push(ghostIcon); } public override function update(elapsed:Float) { - field.follow(this, 20, 12); + editIcon.follow(this, 22, 18); + field.follow(this, 22+16+8, 17); - animationDisplayBG.follow(this, 16, 12+18+11); - nameTextBox.follow(this, 14+128+16, 12+18+8+14); - animTextBox.follow(this, 14+128+12+116+20, 12+18+8+14); + deleteButton.follow(this, (500-16-32)-16-(28*2), 14); + deleteIcon.follow(deleteButton, (deleteButton.bWidth/2)-6.5, (deleteButton.bHeight/2)-6); - positionXStepper.follow(this, 14+128+16, 12+18+8+10+24+26); - positionYStepper.follow(this, 14+128+16+64-32+28, 12+18+8+10+24+26); + ghostButton.follow(this, (500-16-32)-16-(28*2)-16-28, 14); + ghostIcon.follow(ghostButton, (ghostButton.bWidth/2)-8, (ghostButton.bHeight/2)-6); + + animationDisplayBG.follow(this, 16, 8+32+8+2+11); + nameTextBox.follow(this, 14+128+16, 8+32+8+2+8+14); + animTextBox.follow(this, 14+128+12+116+20, 8+32+8+2+8+14); + + positionXStepper.follow(this, 14+128+16, 8+32+8+2+8+10+24+26); + positionYStepper.follow(this, 14+128+16+64-32+28, 8+32+8+2+8+10+24+26); XYComma.follow(positionXStepper, 64-24, 6); - fpsStepper.follow(this, 14+128+16+64-32+28+64-22+20, 12+18+8+10+24+26); - loopedCheckbox.follow(this, 14+128+16+64-32+28+64-22+20+52-22+18+8, 12+18+8+10+24+32); + fpsStepper.follow(this, 14+128+16+64-32+28+64-22+20, 8+32+8+2+8+10+24+26); + loopedCheckbox.follow(this, 14+128+16+64-32+28+64-22+20+52-22+18+8, 8+32+8+2+8+10+24+32); - indicesTextBox.follow(this, 14+128+16, 12+18+8+10+24+26+24+22); + indicesTextBox.follow(this, 14+128+16, 8+32+8+2+8+10+24+26+24+22); for (ui => text in labels) text.follow(ui, -(2+(ui is UICheckbox?12:0)), -(18+(ui is UICheckbox?6:0))); @@ -113,7 +162,7 @@ class CharacterAnimButton extends UIButton { parent.displayWindowSprite.follow( this, 16+(128/2)-((parent.displayWindowSprite.frame.sourceSize.x*displayData.scale)/2), - 12+18+11+(128/2)-((parent.displayWindowSprite.frame.sourceSize.y*displayData.scale)/2) + 8+32+8+2+11+(128/2)-((parent.displayWindowSprite.frame.sourceSize.y*displayData.scale)/2) ); parent.displayWindowSprite.draw(); } diff --git a/source/funkin/editors/character/CharacterAnimsWindow.hx b/source/funkin/editors/character/CharacterAnimsWindow.hx index 508b24bf..d801298b 100644 --- a/source/funkin/editors/character/CharacterAnimsWindow.hx +++ b/source/funkin/editors/character/CharacterAnimsWindow.hx @@ -15,7 +15,7 @@ class CharacterAnimsWindow extends UIButtonList { public var displayAnimsFramesList:Map = []; public function new(x:Float, y:Float, character:Character) { - super(x, y, Std.int(500-16), 419, "", FlxPoint.get(Std.int(500-16-32), 184)); + super(x, y, Std.int(500-16), 419, "", FlxPoint.get(Std.int(500-16-32), 208)); cameraSpacing = 0; frames = Paths.getFrames('editors/ui/inputbox');