From 8c7b14a7e1e28154ae3feeec1d52100f71fa2874 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Wed, 8 May 2024 22:16:27 +0200 Subject: [PATCH] Allow for scroll wheel speed manipulation --- sui/src/SuiScroller.gd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sui/src/SuiScroller.gd b/sui/src/SuiScroller.gd index 5a16c2c..975af8c 100644 --- a/sui/src/SuiScroller.gd +++ b/sui/src/SuiScroller.gd @@ -10,6 +10,8 @@ extends SuiBaseClass @export var speed_mode: SuiTypes.ScrollMode = SuiTypes.ScrollMode.MULTIPLY_CUSTOM_VALUE @export var speed_multiplier: float = 1 @export var speed_value: float = 1 +@export_subgroup("Scroller speed (wheel)") +@export var speed_wheel_multiplier: float = 50 @export_subgroup("Scroller size") @export var size_mode: SuiTypes.ScrollMode = SuiTypes.ScrollMode.MULTIPLY_VIEWPORT @export var size_multiplier: float = 0.025 @@ -167,7 +169,7 @@ func scroll(direction: SuiTypes.ScrollDirection) -> void: SuiTypes.ScrollDirection.LEFT: bar = $HScrollBar SuiTypes.ScrollDirection.RIGHT: bar = $HScrollBar - bar.value = bar.value + bar.step * 50 * dsign + bar.value = bar.value + bar.step * speed_wheel_multiplier * dsign func _input(event: InputEvent): if event is InputEventMouseButton: