diff options
Diffstat (limited to 'client/menu/setup.gd')
-rw-r--r-- | client/menu/setup.gd | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/client/menu/setup.gd b/client/menu/setup.gd index 279c54ff..7a56a14d 100644 --- a/client/menu/setup.gd +++ b/client/menu/setup.gd @@ -1,6 +1,7 @@ # Hurry Curry! - a game about cooking # Copyright 2024 metamuffin # Copyright 2024 tpart +# Copyright 2024 nokoe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -22,22 +23,28 @@ var character := -1 @onready var anim: AnimationPlayer = $AnimationPlayer @onready var username: LineEdit = $ScrollContainer/Control/TextureRect/PaperMargin/Contents/NameEntry/LineEdit -@onready var character_opts: Container = $ScrollContainer/Control/TextureRect/PaperMargin/Contents/SelectUniform/UniformEntry -@onready var character_model: Character = $ScrollContainer/Control/TextureRect/PaperMargin/Contents/SelectUniform/HairViewport/Node3D/Character -@onready var sign: AudioStreamPlayer = $Sign +@onready var sign_sound: AudioStreamPlayer = $Sign @onready var sign_button: Button = $ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign/Signature @onready var scroll: ScrollContainer = $ScrollContainer +@onready var select_uniform: HBoxContainer = $ScrollContainer/Control/TextureRect/PaperMargin/Contents/SelectUniform func _ready(): anim.play("paper_slide") - for i in character_opts.get_children().size(): - var box: CheckBox = character_opts.get_child(i) - box.pressed.connect(_character_selected.bind(i)) + var button_group := ButtonGroup.new() + for i in range(3): + var preview: HairstylePreview = preload("res://menu/hairstyle_preview.tscn").instantiate() + select_uniform.add_child(preview) + preview.setup(i, button_group) + preview.selected.connect(_character_selected) + if i < 2: + var spacer = Control.new() + spacer.size_flags_vertical = Control.SIZE_EXPAND + spacer.custom_minimum_size.x = 50 + select_uniform.add_child(spacer) super() func _character_selected(idx: int): character = idx - character_model.select_hairstyle(character) func _process(delta): var s = Input.get_axis("rotate_up", "rotate_down") @@ -49,8 +56,8 @@ func _on_sign_pressed(): sign_button.disabled = true - sign.play() - await sign.finished + sign_sound.play() + await sign_sound.finished anim.play_backwards("paper_slide") await anim.animation_finished |