diary/user_interface/topic_panel/add_button.gd
2022-06-04 13:33:00 +02:00

20 lines
406 B
GDScript

extends TextureButton
onready var scroll_container = get_node("../..")
func _ready():
# warning-ignore:return_value_discarded
Users.connect("switched", self, "_on_user_switched")
func _on_user_switched():
self_modulate = Users.get_current().add_topic_button_color
func _on_pressed():
Data.topics.insert_topic(get_index())
yield(get_tree(), "idle_frame")
scroll_container.scroll_vertical += 64