From fb2c9c3687342240dd2f2fb10bfdd93da046cd5a Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Tue, 19 Dec 2023 12:01:54 +0100 Subject: Add _to_string method to extension classes. So printing them in Godot shows the proper class name instead of "Wrapped". --- src/WebRTCLibDataChannel.hpp | 4 ++++ src/WebRTCLibPeerConnection.hpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/WebRTCLibDataChannel.hpp b/src/WebRTCLibDataChannel.hpp index 1c69997..3524e02 100644 --- a/src/WebRTCLibDataChannel.hpp +++ b/src/WebRTCLibDataChannel.hpp @@ -74,6 +74,10 @@ private: protected: static void _bind_methods() {} + godot::String _to_string() const { + return "WebRTCLibDataChannel"; + } + public: static WebRTCLibDataChannel *new_data_channel(std::shared_ptr p_channel, bool p_negotiated); diff --git a/src/WebRTCLibPeerConnection.hpp b/src/WebRTCLibPeerConnection.hpp index 6608735..1bcb29e 100644 --- a/src/WebRTCLibPeerConnection.hpp +++ b/src/WebRTCLibPeerConnection.hpp @@ -67,6 +67,10 @@ private: protected: static void _bind_methods() {} + godot::String _to_string() const { + return "WebRTCLibPeerConnection"; + } + public: static void _register_methods() {} static void initialize_signaling(); -- cgit v1.2.3