2018-08-07 08:18:26 +00:00
|
|
|
extends Node
|
|
|
|
|
|
|
|
signal character_creation_finished
|
|
|
|
|
|
|
|
|
|
|
|
func _ready():
|
2018-08-08 13:48:37 +00:00
|
|
|
$login_menu.show()
|
2018-08-09 07:36:14 +00:00
|
|
|
self.connect( "character_creation_finished", global, "_on_login_scene_character_creation_finished" )
|
2018-08-08 13:48:37 +00:00
|
|
|
|
2018-08-07 08:18:26 +00:00
|
|
|
|
|
|
|
func _on_login_menu_login_button_pressed():
|
|
|
|
$login_menu.hide()
|
|
|
|
$character_selection_menu.show()
|
|
|
|
|
2018-08-09 14:09:55 +00:00
|
|
|
func _on_character_selection_menu_return_button_pressed():
|
|
|
|
$login_menu.show()
|
|
|
|
$character_selection_menu.hide()
|
2018-08-07 08:18:26 +00:00
|
|
|
|
2018-08-09 14:09:55 +00:00
|
|
|
func _on_character_selection_menu_character_selected(slot):
|
2018-08-08 12:31:51 +00:00
|
|
|
var config_file = ConfigFile.new()
|
|
|
|
var err = config_file.load( "user://player.cfg" )
|
|
|
|
if err:
|
|
|
|
print("Error code when loading player config file: ", err)
|
2018-08-09 14:09:55 +00:00
|
|
|
global.character_slot = slot
|
|
|
|
global.character_name = config_file.get_value( str(slot), "name", "player")
|
|
|
|
global.character_color = config_file.get_value( str(slot), "color", Color(1.0, 63.0, 63.0, 1.0) )
|
2018-08-08 12:31:51 +00:00
|
|
|
|
2018-08-09 14:09:55 +00:00
|
|
|
|
|
|
|
emit_signal( "character_creation_finished" )
|