1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Improve to_string() and add it to Resource

This commit is contained in:
kobewi
2024-07-07 20:18:35 +02:00
parent 9a5d6d1049
commit e6783dbdd1
13 changed files with 53 additions and 61 deletions

View File

@@ -205,7 +205,7 @@ public:
bool has_java_method(const StringName &p_method) const;
#ifdef ANDROID_ENABLED
virtual String to_string() override;
virtual String _to_string() override;
#endif
JavaClass();
@@ -232,7 +232,7 @@ public:
bool has_java_method(const StringName &p_method) const;
#ifdef ANDROID_ENABLED
virtual String to_string() override;
virtual String _to_string() override;
jobject get_instance() { return instance; }

View File

@@ -826,7 +826,7 @@ Ref<JavaClass> JavaClass::get_java_parent_class() const {
return ret;
}
String JavaClass::to_string() {
String JavaClass::_to_string() {
return "<JavaClass:" + java_class_name + ">";
}
@@ -874,11 +874,11 @@ Ref<JavaClass> JavaObject::get_java_class() const {
return base_class;
}
String JavaObject::to_string() {
String JavaObject::_to_string() {
if (base_class.is_valid() && instance) {
return "<JavaObject:" + base_class->java_class_name + " \"" + (String)call("toString") + "\">";
}
return RefCounted::to_string();
return RefCounted::_to_string();
}
bool JavaObject::has_java_method(const StringName &p_method) const {