New profiles system + auto version label
This commit is contained in:
parent
94ee27472c
commit
6ffa6e643b
7 changed files with 128 additions and 49 deletions
|
|
@ -1,9 +1,25 @@
|
|||
extends Button
|
||||
|
||||
var texts = {
|
||||
"NewGame" : "New Game",
|
||||
"CreateProfile" : "Create Profile",
|
||||
"CreateProfileConfirm" : "Confirm",
|
||||
"LoadProfile" : "Load Profile",
|
||||
"LoadProfileConfirm" : "Confirm",
|
||||
"DeleteProfile" : "Delete Profile",
|
||||
"ExitGame" : "Exit Game",
|
||||
"Settings" : "Settings",
|
||||
"AudioSettings" : "Audio",
|
||||
"VideoSettings" : "Video",
|
||||
"Profiles" : "Profiles",
|
||||
"Credits" : "Credits",
|
||||
"Back" : "Back",
|
||||
"Null" : Game.gameversion
|
||||
}
|
||||
|
||||
@export var id = "Null"
|
||||
|
||||
@onready var controller = $"../.."
|
||||
|
||||
func _ready():
|
||||
button_up.connect(_on_button_up)
|
||||
change_name()
|
||||
|
|
@ -12,10 +28,16 @@ func _on_button_up():
|
|||
match id:
|
||||
"NewGame":
|
||||
get_tree().change_scene_to_file("res://scenes/Space.tscn")
|
||||
"CreateProfile":
|
||||
Game.profile_create("1")
|
||||
"LoadProfile":
|
||||
Game.profile_legit_check(Game.profile_load("1"))
|
||||
"CreateProfileConfirm":
|
||||
var profile_name = controller.input.text
|
||||
Game.profile_create(profile_name)
|
||||
Game.profile_load(profile_name)
|
||||
"LoadProfileConfirm":
|
||||
var profile_name = controller.input.text
|
||||
var profile_meta = Game.profile_legit_check(Game.profile_load(profile_name))
|
||||
Game.profile = Profile.create(profile_meta)
|
||||
var format = {"profile": Game.profile.profile_meta['meta']['profile_name']}
|
||||
controller.profile_status.text = "Current profile: [{profile}]".format(format)
|
||||
"DeleteProfile":
|
||||
Game.profile_delete("1")
|
||||
"ExitGame":
|
||||
|
|
@ -24,31 +46,17 @@ func _on_button_up():
|
|||
controller.change_menu(1)
|
||||
"Back":
|
||||
var new_menu_id = 0
|
||||
match controller.menu_id:
|
||||
2:
|
||||
new_menu_id = 1
|
||||
3:
|
||||
new_menu_id = 1
|
||||
controller.change_menu(new_menu_id)
|
||||
"CreateProfile":
|
||||
controller.change_menu(2)
|
||||
"LoadProfile":
|
||||
controller.change_menu(3)
|
||||
|
||||
func change_name():
|
||||
visible = true
|
||||
match id:
|
||||
"NewGame":
|
||||
text = "New Game"
|
||||
"CreateProfile":
|
||||
text = "Create Profile"
|
||||
"LoadProfile":
|
||||
text = "Load Profile"
|
||||
"DeleteProfile":
|
||||
text = "Delete Profile"
|
||||
"ExitGame":
|
||||
text = "Exit Game"
|
||||
"Settings":
|
||||
text = "Settings (WIP)"
|
||||
"AudioSettings":
|
||||
text = "Audio (WIP)"
|
||||
"VideoSettings":
|
||||
text = "Video (WIP)"
|
||||
"Profiles":
|
||||
text = "Profiles (WIP)"
|
||||
"Back":
|
||||
text = "Back"
|
||||
"Null":
|
||||
text = Game.gameversion
|
||||
visible = false
|
||||
visible = id != "Null"
|
||||
text = texts[id]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue