diff options
Diffstat (limited to 'client/menu/scroll_container_custom.gd')
-rw-r--r-- | client/menu/scroll_container_custom.gd | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/client/menu/scroll_container_custom.gd b/client/menu/scroll_container_custom.gd index cc578bb1..a456f644 100644 --- a/client/menu/scroll_container_custom.gd +++ b/client/menu/scroll_container_custom.gd @@ -21,9 +21,18 @@ class_name ScrollContainerCustom const SCROLL_SPEED := 1000. var velocity := 0. +@export var auto_scroll_to_bottom := false + func _init(): follow_focus = true +func _ready(): + if auto_scroll_to_bottom: + call_deferred("scroll_to_bottom") + +func scroll_to_bottom(): + set_deferred("scroll_vertical", get_v_scroll_bar().max_value) + func _process(delta): velocity = G.interpolate(velocity, 0., delta * 5.) velocity = 0. if abs(velocity) < .001 else velocity |