From a77164d630786ab7b135e5fc8473f96e537d2459 Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Sun, 8 Oct 2023 22:24:06 -0700 Subject: [PATCH] asodj --- source/funkin/editors/charter/Charter.hx | 7 +++++++ source/funkin/editors/ui/UISlider.hx | 10 +++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index dd257318..e04119e8 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -1,5 +1,6 @@ package funkin.editors.charter; +import funkin.editors.ui.UITopMenu.UITopMenuButton; import funkin.editors.charter.CharterStrumline; import funkin.editors.charter.CharterBackdropGroup.EventBackdrop; import funkin.backend.system.framerate.Framerate; @@ -893,6 +894,12 @@ class Charter extends UIState { ((((40*4) * gridBackdrops.strumlinesAmount) - FlxG.width) / 2), gridBackdrops.conductorSprY - (FlxG.height * 0.5) ); + + if (topMenuSpr.members[5] != null) { + var playBackMenu:UITopMenuButton = cast topMenuSpr.members[5]; + playBackMenu.x = playBackSlider.x-playBackSlider.startText.width-10-playBackSlider.valueStepper.bWidth-playBackMenu.bWidth-10; + playBackMenu.label.offset.x = -2; + } super.update(elapsed); diff --git a/source/funkin/editors/ui/UISlider.hx b/source/funkin/editors/ui/UISlider.hx index 5ef8c9bb..fca67325 100644 --- a/source/funkin/editors/ui/UISlider.hx +++ b/source/funkin/editors/ui/UISlider.hx @@ -80,17 +80,21 @@ class UISlider extends UISprite { valueStepper.onChange = function (text:String) { @:privateAccess valueStepper.__onChange(text); visualProgress = __barProgress = __calcProgress(value = valueStepper.value); + if (onChange != null) onChange(value); } members.push(valueStepper); } var __barProgress:Float = 0; var visualProgress:Float = 0; + + var __stepperWidth = 25; public override function update(elapsed:Float) { selectableHitbox.follow(this, 0, (height-selectableHitbox.height)/2); - valueStepper.bWidth = valueStepper.label.text.length <= 0 ? 25 : Std.int(valueStepper.label.textField.width) + 12; + __stepperWidth = valueStepper.label.text.length <= 0 ? 25 : Std.int(valueStepper.label.textField.width) + 12; + 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); var lastBarProgress:Float = __barProgress; @@ -102,7 +106,7 @@ class UISlider extends UISprite { } if (__barProgress != lastBarProgress) { - onChange(@:bypassAccessor value = __calcValue(__barProgress)); + if (onChange != null) onChange(@:bypassAccessor value = __calcValue(__barProgress)); valueStepper.value = value; } @@ -112,7 +116,7 @@ class UISlider extends UISprite { progressbar.colorTransform.color = FlxColor.interpolate(progressbar.colorTransform.color, selectableHitbox.hovered ? 0xFF7F00BF : 0xFF67009B, 1/14); selectableBar.follow(this, (visualProgress * barWidth) - (selectableBar.width/2), (height-selectableBar.height)/2); selectableBarHighlight.follow(selectableBar); - selectableBarHighlight.alpha = FlxMath.lerp(selectableBarHighlight.alpha, selectableHitbox.hovered ? 0.075: 0, 1/14); + selectableBarHighlight.alpha = FlxMath.lerp(selectableBarHighlight.alpha, selectableHitbox.hovered ? 0.1: 0, 1/14); startText.follow(this, -startText.width-10, (height/2) - (startText.height/2)); endText.follow(this, barWidth + 10, (height/2) - (endText.height/2));