fixed saving & added first basic save creation menu

This commit is contained in:
2025-10-15 05:36:33 +02:00
parent 283e3cbb5a
commit f87cc28c57
12 changed files with 155 additions and 28 deletions

View File

@@ -1,6 +1,9 @@
extends Control
@onready var tab_container: TabContainer = $TabContainer
func _on_start_button_pressed() -> void:
pass # Replace with function body.
tab_container.current_tab = 1
func _on_profile_creator_exit() -> void:
tab_container.current_tab = 0

View File

@@ -1 +1,45 @@
extends Control
signal exit
var profile: Profile = Profile.new("profile")
@onready var next: Button = $VBoxContainer/HBoxContainer/Next
@onready var line_edit: LineEdit = $VBoxContainer/LineEdit
@onready var max_index: int = profile.named_things.keys().size() - 1
var index: int = 0
func _ready() -> void:
next.disabled = index == max_index
func _on_back_button_pressed() -> void:
if index == 0:
exit.emit()
else:
index -= 1
update_name()
func _on_next_pressed() -> void:
index += 1
update_name()
func update_name() -> void:
if index == max_index:
next.text = "Finish"
elif index > max_index:
profile.save()
index = max_index
return
else:
next.text = "Next"
var labels: Dictionary = {
"player_name": "Name him",
"villain_friend": "Name him too",
"stupid_friend": "And also name him",
"favourite_candy": "Favourite candy?"
}
var label: String = labels[profile.named_things.keys()[index]]
line_edit.placeholder_text = label