mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-06 16:00:08 +01:00
* Remove unnecessary use of `self`
* Connect to signals directly over `connect("name")`
* Use `call_deferred` on callables over `call_deferred("name"))`
* Emit signals directly over `emit_signal("name"...)`
25 lines
447 B
GDScript
25 lines
447 B
GDScript
extends ScrollContainer
|
|
|
|
|
|
@export var auto_scroll = false
|
|
|
|
|
|
func _ready():
|
|
var scrollbar = get_v_scroll_bar()
|
|
scrollbar.scrolling.connect(_on_scrolling)
|
|
|
|
|
|
func _process(_delta):
|
|
if auto_scroll:
|
|
var scrollbar = get_v_scroll_bar()
|
|
scrollbar.value = scrollbar.max_value
|
|
|
|
|
|
func _on_scrolling():
|
|
auto_scroll = false
|
|
$"../CheckBoxScroll".button_pressed = false
|
|
|
|
|
|
func _on_check_box_scroll_toggled(button_pressed):
|
|
auto_scroll = button_pressed
|