online multiplayer chess game (note server currently down)
Diffstat (limited to 'ui/menus/local_multiplayer/GameConfig.gd')
-rw-r--r--ui/menus/local_multiplayer/GameConfig.gd27
1 files changed, 27 insertions, 0 deletions
diff --git a/ui/menus/local_multiplayer/GameConfig.gd b/ui/menus/local_multiplayer/GameConfig.gd
new file mode 100644
index 0000000..f4dbc45
--- /dev/null
+++ b/ui/menus/local_multiplayer/GameConfig.gd
@@ -0,0 +1,27 @@
+extends GameConfig
+
+enum { HUMAN, ENGINE }
+
+var players: PoolIntArray = [
+ HUMAN,
+ HUMAN,
+]
+var depth: int
+
+
+func _player_selected(index: int, player: int) -> void:
+ players[player - 1] = index
+
+
+func _ready() -> void:
+ get_tree().call_group("freeifnoengine", "hide")
+ var loader = StockfishLoader.new()
+ if loader.is_supported():
+ get_tree().call_group("freeifnoengine", "show")
+ return
+ get_tree().call_group("freeifnoengine", "queue_free")
+ get_tree().call_group("showifnoengine", "show")
+
+
+func _depth_changed(new_depth: int) -> void:
+ depth = new_depth