online multiplayer chess game (note server currently down)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
extends VBoxContainer

export(PoolStringArray) var pgns = []

var in_sim = false


func _ready():
	if !Debug.debug:
		queue_free()


func _load(i: int):
	in_sim = true
	var boar = load("res://ui/board/Game.tscn").instance()
	get_tree().get_root().add_child(boar)
	boar = boar.get_board()
	boar.load_pgn(pgns[i])
	get_parent().hide()


func _input(_event):
	if Input.is_action_pressed("ui_cancel") and in_sim:
		in_sim = false
		get_node("/root/Game").queue_free()
		get_parent().show()
		Globals.reset_vars()


func _on_test_chat_pressed():
	get_tree().change_scene_to(preload("res://ui/chat/Chat.tscn"))