You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +00:00
Added drag and drop support for shaderinclude
Dragging and dropping now works for shader include file.
This commit is contained in:
@@ -376,6 +376,12 @@ bool ShaderEditorPlugin::can_drop_data_fw(const Point2 &p_point, const Variant &
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ResourceLoader::exists(file, "ShaderInclude")) {
|
||||||
|
Ref<ShaderInclude> sinclude = ResourceLoader::load(file);
|
||||||
|
if (sinclude.is_valid()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -405,11 +411,10 @@ void ShaderEditorPlugin::drop_data_fw(const Point2 &p_point, const Variant &p_da
|
|||||||
|
|
||||||
for (int i = 0; i < files.size(); i++) {
|
for (int i = 0; i < files.size(); i++) {
|
||||||
String file = files[i];
|
String file = files[i];
|
||||||
if (!ResourceLoader::exists(file, "Shader")) {
|
Ref<Resource> res;
|
||||||
continue;
|
if (ResourceLoader::exists(file, "Shader") || ResourceLoader::exists(file, "ShaderInclude")) {
|
||||||
|
res = ResourceLoader::load(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<Resource> res = ResourceLoader::load(file);
|
|
||||||
if (res.is_valid()) {
|
if (res.is_valid()) {
|
||||||
edit(res.ptr());
|
edit(res.ptr());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user