diff options
Diffstat (limited to 'client/menu/character_menu.gd')
-rw-r--r-- | client/menu/character_menu.gd | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/client/menu/character_menu.gd b/client/menu/character_menu.gd index 836dc7c3..e63243e1 100644 --- a/client/menu/character_menu.gd +++ b/client/menu/character_menu.gd @@ -15,8 +15,13 @@ # extends Control +@onready var character: Character = $Character +@onready var num_hairstyles := character.hairstyles.keys().size() + +var hairstyle := 0 + func _ready(): - $top_panel/a/username.text = Global.username + $VBoxContainer/top_panel/a/username.text = Global.username func _notification(what): if what == NOTIFICATION_PREDELETE: @@ -27,3 +32,11 @@ func _on_back_pressed(): func _on_username_text_changed(new_text): Global.username = new_text + +func _on_character_back_pressed(): + hairstyle = (hairstyle - 1) % num_hairstyles + character.select_hairstyle(hairstyle) + +func _on_character_forward_pressed(): + hairstyle = (hairstyle + 1) % num_hairstyles + character.select_hairstyle(hairstyle) |