aboutsummaryrefslogtreecommitdiff
path: root/client/menu
diff options
context:
space:
mode:
Diffstat (limited to 'client/menu')
-rw-r--r--client/menu/character_menu.gd17
1 files changed, 9 insertions, 8 deletions
diff --git a/client/menu/character_menu.gd b/client/menu/character_menu.gd
index e63243e1..90bc9648 100644
--- a/client/menu/character_menu.gd
+++ b/client/menu/character_menu.gd
@@ -18,10 +18,9 @@ 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
+ $VBoxContainer/top_panel/a/username.text = Global.settings["username"]
+ character.select_hairstyle(Global.settings["character"])
func _notification(what):
if what == NOTIFICATION_PREDELETE:
@@ -31,12 +30,14 @@ 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()