108 lines
2.9 KiB
GDScript
108 lines
2.9 KiB
GDScript
extends Node
|
|
|
|
signal character_creation_finished
|
|
|
|
|
|
func _ready():
|
|
$login_menu.show()
|
|
self.connect( "character_creation_finished", global, "_on_login_scene_character_creation_finished" )
|
|
|
|
global.get_node( "audio_stream_player" ).stream = load( "res://assets/musics/pre-mix_menu_pantin_remake.ogg" )
|
|
global.get_node( "audio_stream_player" ).play()
|
|
|
|
$login_menu.show()
|
|
$register_menu.hide()
|
|
$license_menu.hide()
|
|
$settings_menu.hide()
|
|
$message_system.hide()
|
|
|
|
func _on_login_menu_login_button_pressed():
|
|
print("[login_scene] Launch game")
|
|
$login_menu.hide()
|
|
$message_system.show()
|
|
# $character_selection_menu.show()
|
|
|
|
func _on_character_selection_menu_return_button_pressed():
|
|
$login_menu.show()
|
|
$character_selection_menu.hide()
|
|
|
|
func _on_character_selection_menu_character_selected( slot ):
|
|
var config_file = ConfigFile.new()
|
|
var err = config_file.load( "user://player.cfg" )
|
|
if err:
|
|
print("Error code when loading player config file player.cfg: ", err)
|
|
|
|
character.slot = slot
|
|
character.pseudo = config_file.get_value( str(slot), "name", "player" )
|
|
character.gender = config_file.get_value( str(slot), "gender", 1 )
|
|
character.color = config_file.get_value( str(slot), "color", Color(1.0, 0.25, 0.25, 1.0) )
|
|
character.size = config_file.get_value( str(slot), "size", 1.0 )
|
|
character.ears_size = config_file.get_value( str(slot), "ears_size", 0.0 )
|
|
character.eyes_color = config_file.get_value( str(slot), "eyes_color", Color( 0.0, 1.0, 0.0, 1.0 ) )
|
|
character.update()
|
|
|
|
emit_signal( "character_creation_finished" )
|
|
|
|
|
|
func _on_quit_button_pressed():
|
|
print("[login_scene:_on_quit_button_pressed] Stop application")
|
|
net_low_level.disconnect_server()
|
|
self.get_tree().quit()
|
|
|
|
|
|
func _on_sound_button_toggled(button_pressed):
|
|
if button_pressed:
|
|
global.get_node( "audio_stream_player" ).stop()
|
|
else:
|
|
global.get_node( "audio_stream_player" ).play()
|
|
|
|
|
|
func _on_login_menu_register_button_pressed():
|
|
$login_menu.hide()
|
|
$register_menu.show()
|
|
$license_menu.hide()
|
|
$settings_menu.hide()
|
|
$message_system.hide()
|
|
|
|
func _on_register_menu_cancel_button_pressed():
|
|
$login_menu.show()
|
|
$register_menu.hide()
|
|
$license_menu.hide()
|
|
$settings_menu.hide()
|
|
$message_system.hide()
|
|
|
|
func _on_register_menu_license_button_pressed():
|
|
$login_menu.hide()
|
|
$register_menu.hide()
|
|
$license_menu.show()
|
|
$settings_menu.hide()
|
|
$message_system.hide()
|
|
|
|
func _on_license_menu_return_button_pressed():
|
|
$login_menu.hide()
|
|
$register_menu.show()
|
|
$license_menu.hide()
|
|
$settings_menu.hide()
|
|
$message_system.hide()
|
|
|
|
func _on_register_menu_register_account_created():
|
|
$login_menu.show()
|
|
$register_menu.hide()
|
|
$license_menu.hide()
|
|
$settings_menu.hide()
|
|
$message_system.hide()
|
|
|
|
func _on_Settings_menu_return_pressed():
|
|
$login_menu.show()
|
|
$register_menu.hide()
|
|
$license_menu.hide()
|
|
$settings_menu.hide()
|
|
$message_system.hide()
|
|
|
|
func _on_settings_button_pressed():
|
|
$login_menu.hide()
|
|
$register_menu.hide()
|
|
$license_menu.hide()
|
|
$settings_menu.load_settings()
|
|
$settings_menu.show()
|
|
$message_system.hide()
|