|
@@ -35,22 +35,6 @@
|
|
|
|
|
|
#include "core/string/string_builder.h"
|
|
#include "core/string/string_builder.h"
|
|
|
|
|
|
-static String _get_script_name(const Ref<Script> &p_script) {
|
|
|
|
- if (p_script.is_valid()) {
|
|
|
|
- if (p_script->get_global_name() != StringName()) {
|
|
|
|
- return p_script->get_global_name();
|
|
|
|
- }
|
|
|
|
- GDScript *gdscript = Object::cast_to<GDScript>(p_script.ptr());
|
|
|
|
- if (gdscript) {
|
|
|
|
- return gdscript->get_fully_qualified_name().get_file();
|
|
|
|
- }
|
|
|
|
- if (!p_script->get_path().is_empty()) {
|
|
|
|
- return p_script->get_path().get_file();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return "<unknown script>";
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static String _get_variant_string(const Variant &p_variant) {
|
|
static String _get_variant_string(const Variant &p_variant) {
|
|
String txt;
|
|
String txt;
|
|
if (p_variant.get_type() == Variant::STRING) {
|
|
if (p_variant.get_type() == Variant::STRING) {
|
|
@@ -70,11 +54,11 @@ static String _get_variant_string(const Variant &p_variant) {
|
|
} else {
|
|
} else {
|
|
Script *script = Object::cast_to<Script>(obj);
|
|
Script *script = Object::cast_to<Script>(obj);
|
|
if (script) {
|
|
if (script) {
|
|
- txt = "script(" + _get_script_name(script) + ")";
|
|
|
|
|
|
+ txt = "script(" + GDScript::debug_get_script_name(script) + ")";
|
|
} else {
|
|
} else {
|
|
txt = "object(" + obj->get_class();
|
|
txt = "object(" + obj->get_class();
|
|
if (obj->get_script_instance()) {
|
|
if (obj->get_script_instance()) {
|
|
- txt += ", " + _get_script_name(obj->get_script_instance()->get_script());
|
|
|
|
|
|
+ txt += ", " + GDScript::debug_get_script_name(obj->get_script_instance()->get_script());
|
|
}
|
|
}
|
|
txt += ")";
|
|
txt += ")";
|
|
}
|
|
}
|
|
@@ -179,7 +163,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
|
|
|
|
|
|
if (script_type.is_valid() && script_type->is_valid()) {
|
|
if (script_type.is_valid() && script_type->is_valid()) {
|
|
text += "script(";
|
|
text += "script(";
|
|
- text += _get_script_name(script_type);
|
|
|
|
|
|
+ text += GDScript::debug_get_script_name(script_type);
|
|
text += ")";
|
|
text += ")";
|
|
} else if (native_type != StringName()) {
|
|
} else if (native_type != StringName()) {
|
|
text += native_type;
|
|
text += native_type;
|
|
@@ -339,7 +323,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
|
|
Ref<GDScript> gdscript = get_constant(_code_ptr[ip + 2] & ADDR_MASK);
|
|
Ref<GDScript> gdscript = get_constant(_code_ptr[ip + 2] & ADDR_MASK);
|
|
|
|
|
|
text += "set_static_variable script(";
|
|
text += "set_static_variable script(";
|
|
- text += _get_script_name(gdscript);
|
|
|
|
|
|
+ text += GDScript::debug_get_script_name(gdscript);
|
|
text += ")";
|
|
text += ")";
|
|
if (gdscript.is_valid()) {
|
|
if (gdscript.is_valid()) {
|
|
text += "[\"" + gdscript->debug_get_static_var_by_index(_code_ptr[ip + 3]) + "\"]";
|
|
text += "[\"" + gdscript->debug_get_static_var_by_index(_code_ptr[ip + 3]) + "\"]";
|
|
@@ -357,7 +341,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
|
|
text += "get_static_variable ";
|
|
text += "get_static_variable ";
|
|
text += DADDR(1);
|
|
text += DADDR(1);
|
|
text += " = script(";
|
|
text += " = script(";
|
|
- text += _get_script_name(gdscript);
|
|
|
|
|
|
+ text += GDScript::debug_get_script_name(gdscript);
|
|
text += ")";
|
|
text += ")";
|
|
if (gdscript.is_valid()) {
|
|
if (gdscript.is_valid()) {
|
|
text += "[\"" + gdscript->debug_get_static_var_by_index(_code_ptr[ip + 3]) + "\"]";
|
|
text += "[\"" + gdscript->debug_get_static_var_by_index(_code_ptr[ip + 3]) + "\"]";
|
|
@@ -421,7 +405,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
|
|
Ref<Script> script = get_constant(_code_ptr[ip + 3] & ADDR_MASK);
|
|
Ref<Script> script = get_constant(_code_ptr[ip + 3] & ADDR_MASK);
|
|
|
|
|
|
text += "assign typed script (";
|
|
text += "assign typed script (";
|
|
- text += _get_script_name(script);
|
|
|
|
|
|
+ text += GDScript::debug_get_script_name(script);
|
|
text += ") ";
|
|
text += ") ";
|
|
text += DADDR(1);
|
|
text += DADDR(1);
|
|
text += " = ";
|
|
text += " = ";
|
|
@@ -527,7 +511,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
|
|
|
|
|
|
String type_name;
|
|
String type_name;
|
|
if (script_type.is_valid() && script_type->is_valid()) {
|
|
if (script_type.is_valid() && script_type->is_valid()) {
|
|
- type_name = "script(" + _get_script_name(script_type) + ")";
|
|
|
|
|
|
+ type_name = "script(" + GDScript::debug_get_script_name(script_type) + ")";
|
|
} else if (native_type != StringName()) {
|
|
} else if (native_type != StringName()) {
|
|
type_name = native_type;
|
|
type_name = native_type;
|
|
} else {
|
|
} else {
|
|
@@ -994,7 +978,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
|
|
Ref<Script> script = get_constant(_code_ptr[ip + 2] & ADDR_MASK);
|
|
Ref<Script> script = get_constant(_code_ptr[ip + 2] & ADDR_MASK);
|
|
|
|
|
|
text += "return typed script (";
|
|
text += "return typed script (";
|
|
- text += _get_script_name(script);
|
|
|
|
|
|
+ text += GDScript::debug_get_script_name(script);
|
|
text += ") ";
|
|
text += ") ";
|
|
text += DADDR(1);
|
|
text += DADDR(1);
|
|
|
|
|