diff options
| author | metamuffin <metamuffin@disroot.org> | 2024-09-27 23:55:57 +0200 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2024-09-27 23:56:00 +0200 |
| commit | 9469650dd3102336330e574f1c2b38067c733a5e (patch) | |
| tree | 4eb5219c47315ba1dd811ff91e82ff5e7ebd02be /client/menu/character.gd | |
| parent | 1532ae28ba34915aae3f289a6b2f9f86fe5bd144 (diff) | |
| download | hurrycurry-9469650dd3102336330e574f1c2b38067c733a5e.tar hurrycurry-9469650dd3102336330e574f1c2b38067c733a5e.tar.bz2 hurrycurry-9469650dd3102336330e574f1c2b38067c733a5e.tar.zst | |
character "main" color
Diffstat (limited to 'client/menu/character.gd')
| -rw-r--r-- | client/menu/character.gd | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/client/menu/character.gd b/client/menu/character.gd index 67087b76..dd3bc5cd 100644 --- a/client/menu/character.gd +++ b/client/menu/character.gd @@ -18,7 +18,6 @@ extends Menu @onready var character: Character = $Node3D/Character -@onready var num_hairstyles := character.hairstyles.keys().size() @onready var back_button := $VBoxContainer/bottom_panel/back @onready var map: Map = $Node3D/Map @onready var username_edit = $VBoxContainer/top_panel/a/username @@ -26,7 +25,7 @@ extends Menu func _ready(): super() $VBoxContainer/top_panel/a/username.text = Global.get_profile("username") - character.select_hairstyle(Global.get_profile("character")) + character.set_style(Global.get_profile("character")) init_map() func init_map(): @@ -69,9 +68,9 @@ func _on_back_pressed(): replace_menu("res://menu/main.tscn") func _on_character_back_pressed(): - Global.set_profile("character", (Global.get_profile("character") - 1) % num_hairstyles) - character.select_hairstyle(Global.get_profile("character")) + Global.set_profile("character", max(Global.get_profile("character") - 1, 0)) + character.set_style(Global.get_profile("character")) func _on_character_forward_pressed(): - Global.set_profile("character", (Global.get_profile("character") + 1) % num_hairstyles) - character.select_hairstyle(Global.get_profile("character")) + Global.set_profile("character", max(Global.get_profile("character") + 1, 0)) + character.set_style(Global.get_profile("character")) |