stick-the-quick/ui/DebugMenu/ChangeCharacter.gd

25 lines
576 B
GDScript3
Raw Permalink Normal View History

class_name ChangeCharacter extends Control
@onready var _choice := (
$OuterMargin/Content/VBoxContainer/HBoxContainer/OptionButton
) as OptionButton
@onready var _ok := (
$OuterMargin/Content/VBoxContainer/OK
) as Button
func _ready() -> void:
_ok.pressed.connect(_on_ok)
func _on_ok() -> void:
var character: StringName
match _choice.selected:
0: character = &'stick'
1: character = &'lorna'
2: character = &'blujai'
3: character = &'gibbo'
if character:
await Storyboard.switch_character(character)
UI.Return(self, true)
else:
UI.Return(self, false)