diff --git a/source/funkin/options/type/Checkbox.hx b/source/funkin/options/type/Checkbox.hx index 592b7723..2e333420 100644 --- a/source/funkin/options/type/Checkbox.hx +++ b/source/funkin/options/type/Checkbox.hx @@ -19,12 +19,17 @@ class Checkbox extends TextOption { "checking" => FlxPoint.get(35, 29) ]; + override function set_text(v:String) { + super.set_text(v); + checkbox.x = __text.x + __text.width + 26; + return v; + } + public function new(text:String, desc:String, optionName:String, ?selectCallback:Void->Void, ?parent:Dynamic) { - super(text, desc, selectCallback); this.optionName = optionName; this.parent = parent = parent != null ? parent : Options; - add(checkbox = new FlxSprite(10, -30)); + checkbox = new FlxSprite(10, -30); checkbox.frames = Paths.getFrames('menus/options/checkboxThingie'); checkbox.animation.addByPrefix("unchecked", "Check Box unselected0", 24); checkbox.animation.addByPrefix("checked", "Check Box Selected Static0", 24); @@ -34,10 +39,13 @@ class Checkbox extends TextOption { checkbox.scale.set(0.75, 0.75); checkbox.updateHitbox(); - __text.x = 100; + //__text.x = 100; if (optionName != null) checked = Reflect.field(parent, optionName); else checked = false; + + super(text, desc, selectCallback); + add(checkbox); } public var firstFrame:Bool = true; diff --git a/source/funkin/options/type/SliderOption.hx b/source/funkin/options/type/SliderOption.hx index ed0ce5b8..1cdfc3a0 100644 --- a/source/funkin/options/type/SliderOption.hx +++ b/source/funkin/options/type/SliderOption.hx @@ -19,10 +19,15 @@ class SliderOption extends TextOption implements ITreeFloatOption { function getValue():Float return (currentValue - min) / (max - min); + override function set_text(v:String) { + super.set_text(v); + slider.x = __text.x + __text.width + 30; + return v; + } + public function new(text:String, desc:String, min:Float, max:Float, step:Float, ?segments:Int, optionName:String, barWidth = 600.0, ?changedCallback:Float->Void = null, ?parent:Dynamic) { - super(text, desc); this.changedCallback = changedCallback; this.min = min; this.max = max; @@ -32,16 +37,19 @@ class SliderOption extends TextOption implements ITreeFloatOption { if (Reflect.field(parent, optionName) != null) currentValue = Reflect.field(parent, optionName); - add(slider = new Slider(16, 0, getValue(), barWidth, segments)); + slider = new Slider(12, 0, getValue(), barWidth, segments); slider.scale.set(0.75, 0.75); slider.updateHitbox(); - slider.y = __text.y + (__text.height - slider.height) * 0.5; + + super(text, desc); + add(slider); + slider.y = Math.floor(__text.y + (__text.height - slider.height) * 0.5 + 2); } override function update(elapsed:Float) { slider.selected = selected && !locked; slider.value = getValue(); - __text.x = slider.x + slider.width + 30; + //__text.x = slider.x + slider.width + 30; super.update(elapsed); }