summaryrefslogtreecommitdiff
path: root/core/variant/variant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/variant/variant.cpp')
-rw-r--r--core/variant/variant.cpp24
1 files changed, 2 insertions, 22 deletions
diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp
index db198da54a..fcfa530388 100644
--- a/core/variant/variant.cpp
+++ b/core/variant/variant.cpp
@@ -38,8 +38,6 @@
#include "core/math/math_funcs.h"
#include "core/string/print_string.h"
#include "core/variant/variant_parser.h"
-#include "scene/gui/control.h"
-#include "scene/main/node.h"
String Variant::get_type_name(Variant::Type p_type) {
switch (p_type) {
@@ -1692,8 +1690,6 @@ String Variant::stringify(int recursion_count) const {
pairs.push_back(sp);
}
- pairs.sort();
-
for (int i = 0; i < pairs.size(); i++) {
if (i > 0) {
str += ", ";
@@ -2006,22 +2002,6 @@ Object *Variant::get_validated_object() const {
}
}
-Variant::operator Node *() const {
- if (type == OBJECT) {
- return Object::cast_to<Node>(_get_obj().obj);
- } else {
- return nullptr;
- }
-}
-
-Variant::operator Control *() const {
- if (type == OBJECT) {
- return Object::cast_to<Control>(_get_obj().obj);
- } else {
- return nullptr;
- }
-}
-
Variant::operator Dictionary() const {
if (type == DICTIONARY) {
return *reinterpret_cast<const Dictionary *>(_data._mem);
@@ -3256,7 +3236,7 @@ bool Variant::hash_compare(const Variant &p_variant, int recursion_count) const
return false;
}
-bool Variant::is_ref() const {
+bool Variant::is_ref_counted() const {
return type == OBJECT && _get_obj().id.is_ref_counted();
}
@@ -3416,7 +3396,7 @@ String Variant::get_call_error_text(Object *p_base, const StringName &p_method,
}
String class_name = p_base->get_class();
- Ref<Script> script = p_base->get_script();
+ Ref<Resource> script = p_base->get_script();
if (script.is_valid() && script->get_path().is_resource_file()) {
class_name += "(" + script->get_path().get_file() + ")";
}