Merge pull request #80281 from KoBeWi/unacceptable
Assign temporary path to preloaded resources
This commit is contained in:
commit
8928b2044b
7 changed files with 17 additions and 0 deletions
|
|
@ -992,6 +992,7 @@ void GDScript::set_path(const String &p_path, bool p_take_over) {
|
|||
|
||||
String old_path = path;
|
||||
path = p_path;
|
||||
path_valid = true;
|
||||
GDScriptCache::move_script(old_path, p_path);
|
||||
|
||||
for (KeyValue<StringName, Ref<GDScript>> &kv : subclasses) {
|
||||
|
|
@ -1000,6 +1001,9 @@ void GDScript::set_path(const String &p_path, bool p_take_over) {
|
|||
}
|
||||
|
||||
String GDScript::get_script_path() const {
|
||||
if (!path_valid && !get_path().is_empty()) {
|
||||
return get_path();
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
|
|
@ -1035,6 +1039,7 @@ Error GDScript::load_source_code(const String &p_path) {
|
|||
|
||||
source = s;
|
||||
path = p_path;
|
||||
path_valid = true;
|
||||
#ifdef TOOLS_ENABLED
|
||||
source_changed_cache = true;
|
||||
set_edited(false);
|
||||
|
|
|
|||
|
|
@ -171,6 +171,7 @@ class GDScript : public Script {
|
|||
//exported members
|
||||
String source;
|
||||
String path;
|
||||
bool path_valid = false; // False if using default path.
|
||||
StringName local_name; // Inner class identifier or `class_name`.
|
||||
StringName global_name; // `class_name`.
|
||||
String fully_qualified_name;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue