test-client-godot/scenes/Main.gd

45 lines
No EOL
1.7 KiB
GDScript

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")
# $GUI.pause()
$GUI/character_creation_menu/v_box_container/h_box_container/center_container/character_creation_scene/camera.make_current()
$Game.hide()
# BugGodot?: Meme si tous les nodes parent sont caché les gridmaps s'affichent quand meme :/
# ce qui les rends quelque peu inutilisables.
$Game/World/GridMaps/Ground.hide()
$Game/World/GridMaps/wall.hide()
$Game/World/GridMaps/ceilling.hide()
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) + ")"
OS.set_window_title( title )
func _on_GUI_character_creation_finished():
$Game.show()
$Game/World/GridMaps/Ground.show()
$Game/World/GridMaps/wall.show()
$Game/World/GridMaps/ceilling.show()
$Game/Character/Camera_rotation_helper/Camera.make_current()
$GUI/character_creation_menu/v_box_container/h_box_container/center_container/character_creation_scene.hide()
$Game/Character/MeshInstance.get_surface_material(0).albedo_color = $GUI/character_creation_menu/v_box_container/h_box_container/center_container/character_creation_scene/mesh_instance.get_surface_material(0).albedo_color