7d285bd607
- added user switching - added Topic Panel functionality (features are missing) - some basic refactoring
27 lines
678 B
GDScript
27 lines
678 B
GDScript
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()
|