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; }