From a84dac98845d6ccf094da47516274cd1852d9c32 Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Sun, 9 Jun 2024 02:40:37 -0700 Subject: [PATCH] ok it works just gotta fix isOnScreen --- source/funkin/editors/ui/UISliceSprite.hx | 29 ++++++++++++++++------- source/funkin/editors/ui/UISlider.hx | 2 ++ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/source/funkin/editors/ui/UISliceSprite.hx b/source/funkin/editors/ui/UISliceSprite.hx index d4da80d7..c72307e8 100644 --- a/source/funkin/editors/ui/UISliceSprite.hx +++ b/source/funkin/editors/ui/UISliceSprite.hx @@ -245,15 +245,26 @@ class UISliceSprite extends UISprite { private inline function __genUVs() { uvtData.length = 0; - __genSliceUV(topleft); - __genSliceUV(top); - __genSliceUV(topright); - __genSliceUV(middleleft); - __genSliceUV(middle); - __genSliceUV(middleright); - __genSliceUV(bottomleft); - __genSliceUV(bottom); - __genSliceUV(bottomright); + if (drawTop) { + __genSliceUV(topleft); + if (bWidth > topleft.frame.width + topright.frame.width) + __genSliceUV(top); + __genSliceUV(topright); + } + + if (drawMiddle && bHeight > top.frame.height + bottom.frame.height) { + __genSliceUV(middleleft); + if (bWidth > (middleleft.frame.width * Math.min(bWidth/(middleleft.frame.width*2), 1)) + middleright.frame.width) + __genSliceUV(middle); + __genSliceUV(middleright); + } + + if (drawBottom) { + __genSliceUV(bottomleft); + if (bWidth > bottomleft.frame.width + bottomright.frame.width) + __genSliceUV(bottom); + __genSliceUV(bottomright); + } __framesDirty = false; } diff --git a/source/funkin/editors/ui/UISlider.hx b/source/funkin/editors/ui/UISlider.hx index 86f1eed6..5869a08b 100644 --- a/source/funkin/editors/ui/UISlider.hx +++ b/source/funkin/editors/ui/UISlider.hx @@ -100,6 +100,8 @@ class UISlider extends UISprite { valueStepper.bWidth = Std.int(FlxMath.lerp(valueStepper.bWidth, __stepperWidth, 1/2.25)); valueStepper.follow(this, -startText.width-10 - valueStepper.bWidth - 4, (height-valueStepper.bHeight)/2); + @:privateAccess valueStepper.__framesDirty = true; + var lastBarProgress:Float = __barProgress; if (selectableHitbox.hovered && FlxG.mouse.pressed) {