diff options
Diffstat (limited to 'client/menu/character_menu.gd')
-rw-r--r-- | client/menu/character_menu.gd | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/client/menu/character_menu.gd b/client/menu/character_menu.gd index e63243e1..f4b878be 100644 --- a/client/menu/character_menu.gd +++ b/client/menu/character_menu.gd @@ -18,25 +18,22 @@ extends Control @onready var character: Character = $Character @onready var num_hairstyles := character.hairstyles.keys().size() -var hairstyle := 0 - func _ready(): - $VBoxContainer/top_panel/a/username.text = Global.username - -func _notification(what): - if what == NOTIFICATION_PREDELETE: - Global.save_profile() + $VBoxContainer/top_panel/a/username.text = Global.settings["username"] + character.select_hairstyle(Global.settings["character"]) func _on_back_pressed(): $SceneTransition.transition_to("res://menu/main_menu.tscn") func _on_username_text_changed(new_text): - Global.username = new_text + Global.settings["username"] = new_text func _on_character_back_pressed(): - hairstyle = (hairstyle - 1) % num_hairstyles - character.select_hairstyle(hairstyle) + Global.settings["character"] = (Global.settings["character"] - 1) % num_hairstyles + character.select_hairstyle(Global.settings["character"]) + Global.save_profile() func _on_character_forward_pressed(): - hairstyle = (hairstyle + 1) % num_hairstyles - character.select_hairstyle(hairstyle) + Global.settings["character"] = (Global.settings["character"] + 1) % num_hairstyles + character.select_hairstyle(Global.settings["character"]) + Global.save_profile() |