fix: make run menus layout and input robust
This commit is contained in:
@@ -8,17 +8,17 @@ const RunSettingsType = preload("res://scripts/domain/run/run_settings.gd")
|
||||
const DIFFICULTY_IDS: Array[StringName] = [&"touriste", &"crawler", &"veteran", &"masochiste"]
|
||||
const ARCHETYPE_IDS: Array[StringName] = [&"vanguard", &"mystic", &"scout"]
|
||||
|
||||
@onready var name_edit: LineEdit = $Panel/Fields/NameEdit
|
||||
@onready var archetype_option: OptionButton = $Panel/Fields/ArchetypeOption
|
||||
@onready var pet_check: CheckBox = $Panel/Fields/PetCheck
|
||||
@onready var seed_edit: LineEdit = $Panel/Fields/SeedEdit
|
||||
@onready var difficulty_option: OptionButton = $Panel/Fields/DifficultyOption
|
||||
@onready var permadeath_option: OptionButton = $Panel/Fields/PermadeathOption
|
||||
@onready var validation_label: Label = $Panel/ValidationLabel
|
||||
@onready var name_edit: LineEdit = $Panel/Layout/Fields/NameEdit
|
||||
@onready var archetype_option: OptionButton = $Panel/Layout/Fields/ArchetypeOption
|
||||
@onready var pet_check: CheckBox = $Panel/Layout/Fields/PetCheck
|
||||
@onready var seed_edit: LineEdit = $Panel/Layout/Fields/SeedEdit
|
||||
@onready var difficulty_option: OptionButton = $Panel/Layout/Fields/DifficultyOption
|
||||
@onready var permadeath_option: OptionButton = $Panel/Layout/Fields/PermadeathOption
|
||||
@onready var validation_label: Label = $Panel/Layout/ValidationLabel
|
||||
|
||||
func _ready() -> void:
|
||||
$Panel/StartRunButton.pressed.connect(_on_start_run_pressed)
|
||||
$Panel/CancelButton.pressed.connect(func() -> void: cancelled.emit())
|
||||
$Panel/Layout/Actions/StartRunButton.pressed.connect(_on_start_run_pressed)
|
||||
$Panel/Layout/Actions/CancelButton.pressed.connect(func() -> void: cancelled.emit())
|
||||
|
||||
func _on_start_run_pressed() -> void:
|
||||
var selected_difficulty := DIFFICULTY_IDS[difficulty_option.selected]
|
||||
|
||||
Reference in New Issue
Block a user