2018-07-25 07:36:19 +00:00
|
|
|
extends Node
|
|
|
|
|
|
|
|
# class member variables go here, for example:
|
|
|
|
# var a = 2
|
|
|
|
# var b = "textvar"
|
|
|
|
|
|
|
|
const WINDOW_TITLE_INPUT = "GUI/Settings/Menus/TabContainer/Test/ScrollContainer/VBoxContainer/TitleBox/Title"
|
|
|
|
|
|
|
|
func _ready():
|
|
|
|
change_title()
|
|
|
|
get_tree().get_root().connect("size_changed", self, "on_window_size_changed")
|
|
|
|
|
2018-08-06 15:43:56 +00:00
|
|
|
global.character_creation_camera.make_current()
|
2018-08-07 08:18:26 +00:00
|
|
|
|
2018-08-05 12:47:18 +00:00
|
|
|
|
2018-07-25 07:36:19 +00:00
|
|
|
|
|
|
|
func _process(delta):
|
|
|
|
pass
|
|
|
|
|
|
|
|
func on_window_size_changed():
|
|
|
|
change_title()
|
|
|
|
|
|
|
|
func change_title():
|
|
|
|
var title_node = get_node( WINDOW_TITLE_INPUT )
|
|
|
|
var title = "Khanat"
|
|
|
|
if title_node and not title_node.text.strip_edges() == "":
|
|
|
|
title = title_node.text.strip_edges()
|
|
|
|
title += " (" + String(OS.get_window_size().x) + "x" + String(OS.get_window_size().y) + ")"
|
2018-08-05 12:47:18 +00:00
|
|
|
OS.set_window_title( title )
|
|
|
|
|
2018-08-07 08:18:26 +00:00
|
|
|
func _on_login_scene_character_creation_finished():
|
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 config file: ", err)
|
|
|
|
|
|
|
|
config_file.set_value(str(global.character_slot), "name", global.character_name)
|
|
|
|
config_file.set_value(str(global.character_slot), "color", global.character_color)
|
|
|
|
|
|
|
|
config_file.save( "user://player.cfg" )
|
|
|
|
print("test")
|
2018-08-08 08:46:16 +00:00
|
|
|
global.goto_scene_loading( "res://game_scene/game_scene.tscn" )
|
2018-08-07 08:18:26 +00:00
|
|
|
|