Handle built-in resources in "Jump to owner" tab action
This commit is contained in:
parent
2b299c0007
commit
990438db55
|
@ -27,10 +27,16 @@
|
|||
|
||||
Vector<String> OwnerPicker::_find_owners(const String &p_path) const {
|
||||
Vector<String> owners;
|
||||
|
||||
if (RESOURCE_PATH_IS_BUILT_IN(p_path)) {
|
||||
// For built-in resources we use the path to the containing resource.
|
||||
String owner_path = p_path.substr(0, p_path.rfind("::"));
|
||||
owners.append(owner_path);
|
||||
return owners;
|
||||
}
|
||||
|
||||
List<EditorFileSystemDirectory *> dirs;
|
||||
|
||||
dirs.push_back(EDITOR_FILE_SYSTEM()->get_filesystem());
|
||||
|
||||
while (dirs.size() > 0) {
|
||||
EditorFileSystemDirectory *efd = dirs.front()->get();
|
||||
dirs.pop_front();
|
||||
|
|
|
@ -237,6 +237,7 @@ Variant VARIANT_DEFAULT(Variant::Type p_type);
|
|||
#define IS_RESOURCE_FILE(m_path) (m_path.begins_with("res://") && m_path.find("::") == -1)
|
||||
#define RESOURCE_TYPE_HINT(m_type) vformat("%s/%s:%s", Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, m_type)
|
||||
#define RESOURCE_IS_BUILT_IN(m_res) (m_res->get_path().is_empty() || m_res->get_path().contains("::"))
|
||||
#define RESOURCE_PATH_IS_BUILT_IN(m_path) (m_path.is_empty() || m_path.contains("::"))
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
|
||||
|
|
Loading…
Reference in New Issue