diff options
Diffstat (limited to 'client/gui/menus')
-rw-r--r-- | client/gui/menus/character.gd | 14 | ||||
-rw-r--r-- | client/gui/menus/main/play.gd | 12 | ||||
-rw-r--r-- | client/gui/menus/setup/setup.gd | 8 |
3 files changed, 17 insertions, 17 deletions
diff --git a/client/gui/menus/character.gd b/client/gui/menus/character.gd index 3c1230ae..715a7b1f 100644 --- a/client/gui/menus/character.gd +++ b/client/gui/menus/character.gd @@ -22,8 +22,8 @@ extends Menu func _ready(): super() - $VBoxContainer/top_panel/a/username.text = Global.get_profile("username") - character.set_style(Global.get_profile("character_style"), "chef") + $VBoxContainer/top_panel/a/username.text = Profile.read("username") + character.set_style(Profile.read("character_style"), "chef") init_map() func init_map(): @@ -61,8 +61,8 @@ func exit(): popup_data.buttons = [accept_button] await submenu("res://gui/menus/popup.tscn", popup_data) return - Global.set_profile("username", username_edit.text) - Global.save_profile() + Profile.write("username", username_edit.text) + Profile.save() super() func _on_character_back_pressed(): @@ -90,7 +90,7 @@ func _on_hairstyle_forward_pressed() -> void: current_style.hairstyle = G.rem_euclid(current_style.hairstyle + 1, character.hairstyles.size())) func modify_style(modifier: Callable): - var current_style: Dictionary = Global.get_profile("character_style") + var current_style: Dictionary = Profile.read("character_style") modifier.call(current_style) - Global.set_profile("character_style", current_style) - character.set_style(Global.get_profile("character_style"), "chef") + Profile.write("character_style", current_style) + character.set_style(Profile.read("character_style"), "chef") diff --git a/client/gui/menus/main/play.gd b/client/gui/menus/main/play.gd index 87b0b5bf..1e64a02f 100644 --- a/client/gui/menus/main/play.gd +++ b/client/gui/menus/main/play.gd @@ -34,7 +34,7 @@ func _ready(): url_regex.compile("^(?:(ws|wss)://)?([^:]+)(?::([0-9]+))?$") if OS.has_feature("web"): server.hide() - connect_uri.text = Global.get_profile("last_server_url") + connect_uri.text = Profile.read("last_server_url") Sound.play_music("MainMenu") ServerList.update_server_list.connect(update_server_list) @@ -43,7 +43,7 @@ func _ready(): update_server_list_loading(ServerList.loading) super() - if not Global.get_profile("registry_asked"): + if not Profile.read("registry_asked"): var popup_data := MenuPopup.Data.new() popup_data.text = tr("c.menu.play.allow_query_registry").format([Settings.read("online.registry_url")]) var allow_button := Button.new() @@ -54,8 +54,8 @@ func _ready(): deny_button.pressed.connect(func(): Settings.write("online.use_registry", false)) popup_data.buttons = [allow_button, deny_button] await submenu("res://gui/menus/popup.tscn", popup_data) - Global.set_profile("registry_asked", true) - Global.save_profile() + Profile.write("registry_asked", true) + Profile.save() Settings.save() ServerList.start() @@ -110,8 +110,8 @@ func _on_connect_pressed(): if result.get_string(3) == "" and result.get_string(1) != "wss": url = url + ":27032" connect_uri.text = url - Global.set_profile("last_server_url", url) - Global.save_profile() + Profile.write("last_server_url", url) + Profile.save() connect_to(url) func _on_quick_connect_pressed(): diff --git a/client/gui/menus/setup/setup.gd b/client/gui/menus/setup/setup.gd index e4103603..878331ff 100644 --- a/client/gui/menus/setup/setup.gd +++ b/client/gui/menus/setup/setup.gd @@ -92,12 +92,12 @@ func _on_sign_pressed(): anim.play_backwards("paper_slide") await anim.animation_finished - Global.set_profile("username", username.text) - Global.set_profile("character_style", character_style) + Profile.write("username", username.text) + Profile.write("character_style", character_style) if skip_tutorial.button_pressed: for k in Global.profile["hints"].keys(): - Global.set_hint(k, true) - Global.save_profile() + Profile.set_hint(k, true) + Profile.save() Settings.write("gameplay.hints_started", skip_tutorial.button_pressed) Settings.write("gameplay.tutorial_disabled", skip_tutorial.button_pressed) |