diary/user_interface/topic_panel/add_button.gd
2022-05-21 14:56:02 +02:00

20 lines
403 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.add_topic(get_index())
yield(get_tree(), "idle_frame")
scroll_container.scroll_vertical += 64