diary/user_interface/tool_bar/tool_bar.gd

27 lines
678 B
GDScript3
Raw Normal View History

extends PanelContainer
onready var profile_image_rect = get_node("Margin/Structure/Profile/ProfileImageRect")
onready var username = get_node("Margin/Structure/Profile/UserTexts/Username")
func _ready():
# warning-ignore:return_value_discarded
Users.connect("switched", self, "_on_user_switched")
func _input(event):
if event is InputEventKey:
if event.scancode == KEY_T and event.control and event.alt:
if event.pressed and !event.is_echo():
Users.switch()
func _on_user_switched():
profile_image_rect.texture = Users.get_current().profile_image
username.text = Users.get_current().username
func _on_CheckButton_toggled(_button_pressed):
Users.switch()