From e341380f49293bb69fece5bd488e82420dd8b3aa Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Thu, 3 Aug 2023 16:43:03 -0700 Subject: [PATCH] event screen looks better --- .../editors/charter/CharterEventScreen.hx | 1 + source/funkin/editors/ui/UISliceSprite.hx | 36 ++++++++++--------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/source/funkin/editors/charter/CharterEventScreen.hx b/source/funkin/editors/charter/CharterEventScreen.hx index 318fddfa..3a6d0405 100644 --- a/source/funkin/editors/charter/CharterEventScreen.hx +++ b/source/funkin/editors/charter/CharterEventScreen.hx @@ -45,6 +45,7 @@ class CharterEventScreen extends UISubstateWindow { events = chartEvent.events.copy(); eventsList = new UIButtonList(0,0,75, 570, "", FlxPoint.get(73, 40), null, 0); + eventsList.drawTop = false; eventsList.addButton.callback = () -> openSubState(new CharterEventTypeSelection(function(eventName) { events.push({ time: Conductor.getTimeForStep(chartEvent.step), diff --git a/source/funkin/editors/ui/UISliceSprite.hx b/source/funkin/editors/ui/UISliceSprite.hx index 1ce1e5c0..4184409f 100644 --- a/source/funkin/editors/ui/UISliceSprite.hx +++ b/source/funkin/editors/ui/UISliceSprite.hx @@ -30,6 +30,8 @@ class UISliceSprite extends UISprite { bHeight = h; } + public var drawTop:Bool = true; + public override function draw() { var x:Float = this.x; var y:Float = this.y; @@ -45,26 +47,28 @@ class UISliceSprite extends UISprite { var bottom:FlxFrame = frames.frames[framesOffset + 7]; var bottomright:FlxFrame = frames.frames[framesOffset + 8]; - // TOP LEFT - frame = topleft; - setPosition(x, y); - __setSize(topleft.frame.width, topleft.frame.height); - super.drawSuper(); + if (drawTop) { + // TOP LEFT + frame = topleft; + setPosition(x, y); + __setSize(topleft.frame.width, topleft.frame.height); + super.drawSuper(); - // TOP - if (bWidth > topleft.frame.width + topright.frame.width) { - frame = top; - setPosition(x + topleft.frame.width, y); - __setSize(bWidth - topleft.frame.width - topright.frame.width, top.frame.height); + // TOP + if (bWidth > topleft.frame.width + topright.frame.width) { + frame = top; + setPosition(x + topleft.frame.width, y); + __setSize(bWidth - topleft.frame.width - topright.frame.width, top.frame.height); + super.drawSuper(); + } + + // TOP RIGHT + frame = topright; + setPosition(x + bWidth - topright.frame.width, y); + __setSize(topright.frame.width, topright.frame.height); super.drawSuper(); } - // TOP RIGHT - frame = topright; - setPosition(x + bWidth - topright.frame.width, y); - __setSize(topright.frame.width, topright.frame.height); - super.drawSuper(); - // MIDDLE LEFT if (bHeight > top.frame.height + bottom.frame.height) { frame = middleleft;