Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: godotengine/godot
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1715c33b5adc2fcf924f97a2165890a81cf204e2
Choose a base ref
..
head repository: godotengine/godot
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8d0fcbcc5e2b3fbd128019d9dbe1c2d9d62d8991
Choose a head ref
Showing with 11 additions and 7 deletions.
  1. +4 −0 editor/editor_resource_picker.cpp
  2. +5 −5 editor/gui/editor_quick_open_dialog.cpp
  3. +2 −2 modules/gdscript/gdscript_cache.cpp
4 changes: 4 additions & 0 deletions editor/editor_resource_picker.cpp
Original file line number Diff line number Diff line change
@@ -160,6 +160,10 @@ void EditorResourcePicker::_file_selected(const String &p_path) {

any_type_matches = is_global_class ? EditorNode::get_editor_data().script_class_is_parent(res_type, base) : loaded_resource->is_class(base);

if (!any_type_matches && loaded_resource->get_script()) {
any_type_matches = static_cast<Ref<Script>>(loaded_resource->get_script())->has_script_type(base);
}

if (any_type_matches) {
break;
}
10 changes: 5 additions & 5 deletions editor/gui/editor_quick_open_dialog.cpp
Original file line number Diff line number Diff line change
@@ -395,19 +395,19 @@ void QuickOpenResultContainer::_find_filepaths_in_folder(EditorFileSystemDirecto
const StringName &actual_type = is_engine_type ? engine_type : script_type;

Ref<Resource> res;
if (!is_engine_type && ClassDB::is_parent_class(SNAME("Resource"), engine_type)) {
res = ResourceLoader::load(p_directory->get_file_path(i), "Resource");
if (ClassDB::is_parent_class(SNAME("Script"), engine_type) && ScriptServer::is_scripting_enabled()) {
if (ClassDB::is_parent_class(engine_type, SNAME("Resource"))) {
res = ResourceLoader::load(p_directory->get_file_path(i));
if (ClassDB::is_parent_class(engine_type, SNAME("Script"))) {
if (res.is_valid() && !static_cast<Ref<Script>>(res)->is_attachable()) {
continue; // Exclude scripts that can not be attacheched to nodes.
continue; // Exclude scripts that can not be attached to nodes.
}
}
}

for (const StringName &parent_type : base_types) {
bool is_valid = ClassDB::is_parent_class(engine_type, parent_type) || (!is_engine_type && EditorNode::get_editor_data().script_class_is_parent(script_type, parent_type));

if (!is_valid && res.is_valid() && res->get_script()) {
if (!is_valid && !is_engine_type && res.is_valid() && res->get_script()) {
is_valid = static_cast<Ref<Script>>(res->get_script())->has_script_type(parent_type);
}

4 changes: 2 additions & 2 deletions modules/gdscript/gdscript_cache.cpp
Original file line number Diff line number Diff line change
@@ -323,11 +323,11 @@ Ref<GDScript> GDScriptCache::get_shallow_script(const String &p_path, Error &r_e
// Affects Icon appearing on script editor tab.
Ref<GDScriptTrait> trait_script;
trait_script.instantiate();
trait_script->set_path_cache(p_path, true);
trait_script->set_path_cache(p_path);
script = trait_script;
} else {
script.instantiate();
script->set_path_cache(p_path, true);
script->set_path_cache(p_path);
}
if (remapped_path.get_extension().to_lower() == "gdc") {
Vector<uint8_t> buffer = get_binary_tokens(remapped_path);