From 6173d3e9a45f17dc92318d11786c5631143808e5 Mon Sep 17 00:00:00 2001 From: tpart Date: Fri, 12 Jul 2024 00:49:30 +0200 Subject: Add hint system --- client/menu/character.gd | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'client/menu/character.gd') diff --git a/client/menu/character.gd b/client/menu/character.gd index b4427e13..0d6a625c 100644 --- a/client/menu/character.gd +++ b/client/menu/character.gd @@ -23,8 +23,8 @@ extends Menu func _ready(): super() - $VBoxContainer/top_panel/a/username.text = Global.profile["username"] - character.select_hairstyle(Global.profile["character"]) + $VBoxContainer/top_panel/a/username.text = Global.get_profile("username") + character.select_hairstyle(Global.get_profile("character")) init_map() func init_map(): @@ -61,16 +61,14 @@ func _on_back_pressed(): OS.alert("Username cannot be empty.") return - Global.profile["username"] = username_edit.text + Global.set_profile("username", username_edit.text) Global.save_profile() replace_menu("res://menu/main.tscn") func _on_character_back_pressed(): - Global.profile["character"] = (Global.profile["character"] - 1) % num_hairstyles - character.select_hairstyle(Global.profile["character"]) - Global.save_profile() + Global.set_profile("character", (Global.get_profile("character") - 1) % num_hairstyles) + character.select_hairstyle(Global.get_profile("character")) func _on_character_forward_pressed(): - Global.profile["character"] = (Global.profile["character"] + 1) % num_hairstyles - character.select_hairstyle(Global.profile["character"]) - Global.save_profile() + Global.set_profile("character", (Global.get_profile("character") + 1) % num_hairstyles) + character.select_hairstyle(Global.get_profile("character")) -- cgit v1.2.3-70-g09d2