From d095d9f2de0be0e3b2f4c62136e42f86d678472e Mon Sep 17 00:00:00 2001 From: Sara Date: Thu, 21 Mar 2024 22:50:49 +0100 Subject: [PATCH] feat: added player_spawned signal to GameRoot --- game_root.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/game_root.cpp b/game_root.cpp index f00134b..8a803ae 100644 --- a/game_root.cpp +++ b/game_root.cpp @@ -21,6 +21,7 @@ void GameRoot::_bind_methods() { GDFUNCTION(reset_game_mode); GDSIGNAL("player_connected", PropertyInfo(Variant::OBJECT, "player_input", PROPERTY_HINT_NODE_TYPE, "PlayerInput")); GDSIGNAL("player_disconnected", PropertyInfo(Variant::OBJECT, "player_input", PROPERTY_HINT_NODE_TYPE, "PlayerInput")); + GDSIGNAL("player_spawned", PropertyInfo(Variant::OBJECT, "player_info", PROPERTY_HINT_NODE_TYPE, "Node")); } GameRoot *GameRoot::get_singleton() { @@ -84,6 +85,7 @@ bool GameRoot::initialize_player(IPlayer *player, uint32_t id) { player->player_id = id; this->add_child(player->to_node()); player->setup_player_input(found.first); + this->emit_signal("player_spawned", player->to_node()); return true; }