summaryrefslogtreecommitdiff
path: root/editor/editor_resource_picker.cpp
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2021-09-17 16:35:24 +0200
committerkobewi <kobewi4e@gmail.com>2021-11-03 15:27:38 +0100
commit07065d67e12d2fb0923c3fc892234a9142f9c9e6 (patch)
tree13b3df30d0b47f9ea2fa9e0d0997eea03ef63bf4 /editor/editor_resource_picker.cpp
parent0bf3204d89dd57c2409446b91ecfd14f32a5f985 (diff)
Infer shader type based on edited node
Diffstat (limited to 'editor/editor_resource_picker.cpp')
-rw-r--r--editor/editor_resource_picker.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp
index 9dbf69a779..ca6c2e931a 100644
--- a/editor/editor_resource_picker.cpp
+++ b/editor/editor_resource_picker.cpp
@@ -934,7 +934,7 @@ bool EditorShaderPicker::handle_menu_selected(int p_which) {
switch (p_which) {
case OBJ_MENU_NEW_SHADER: {
if (material.is_valid()) {
- EditorNode::get_singleton()->get_scene_tree_dock()->open_shader_dialog(material);
+ EditorNode::get_singleton()->get_scene_tree_dock()->open_shader_dialog(material, preferred_mode);
return true;
}
} break;
@@ -952,5 +952,9 @@ ShaderMaterial *EditorShaderPicker::get_edited_material() const {
return edited_material;
}
+void EditorShaderPicker::set_preferred_mode(int p_mode) {
+ preferred_mode = p_mode;
+}
+
EditorShaderPicker::EditorShaderPicker() {
}