From b02839dfa4c1727509ff0f46f2842b28f4a07573 Mon Sep 17 00:00:00 2001 From: bctix <51544115+bctix@users.noreply.github.com> Date: Thu, 15 Feb 2024 09:36:10 -0500 Subject: [PATCH 1/2] Fix repeating number option (#243) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * round number option * optimized --------- Co-authored-by: ⍚~Nex <87421482+NexIsDumb@users.noreply.github.com> --- source/funkin/options/type/NumOption.hx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/source/funkin/options/type/NumOption.hx b/source/funkin/options/type/NumOption.hx index fb490f10..541981f9 100644 --- a/source/funkin/options/type/NumOption.hx +++ b/source/funkin/options/type/NumOption.hx @@ -36,19 +36,15 @@ class NumOption extends OptionType { this.currentSelection = Reflect.field(parent, optionName); this.changeVal = changeVal; this.optionName = optionName; - + add(__text = new Alphabet(100, 20, text, true)); add(__number = new Alphabet(__text.width + 120, -30, ': $currentSelection', false)); } - public override function draw() { - super.draw(); - } - public override function onChangeSelection(change:Float):Void { - if(currentSelection <= min && change == -1 || currentSelection >= max && change == 1 ) return; - currentSelection += change*changeVal; + if(currentSelection <= min && change == -1 || currentSelection >= max && change == 1) return; + currentSelection = FlxMath.roundDecimal(currentSelection + (change * changeVal), FlxMath.getDecimals(changeVal)); __number.text = ': $currentSelection'; Reflect.setField(parent, optionName, currentSelection); From 78e25fbefa090f15e56ac674a3711ff80f03e6de Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Sun, 18 Feb 2024 01:56:39 -0700 Subject: [PATCH 2/2] Cleanup :D --- source/funkin/backend/scripting/events/AmountEvent.hx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/funkin/backend/scripting/events/AmountEvent.hx b/source/funkin/backend/scripting/events/AmountEvent.hx index 45b5c9ce..f660cb4f 100644 --- a/source/funkin/backend/scripting/events/AmountEvent.hx +++ b/source/funkin/backend/scripting/events/AmountEvent.hx @@ -5,4 +5,9 @@ final class AmountEvent extends CancellableEvent { * Amount */ public var amount:Int; -} \ No newline at end of file + + /** + * Shows wether or not psych users complained about this class + */ + public var psychUsersComplained:Bool = true; +}