summaryrefslogtreecommitdiff
path: root/editor/shader_create_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/shader_create_dialog.cpp')
-rw-r--r--editor/shader_create_dialog.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/editor/shader_create_dialog.cpp b/editor/shader_create_dialog.cpp
index 6bbefb3bb2..1ddd79eea8 100644
--- a/editor/shader_create_dialog.cpp
+++ b/editor/shader_create_dialog.cpp
@@ -168,6 +168,11 @@ void ShaderCreateDialog::_create_new() {
code += "\t// Place sky code here.\n";
code += "}\n";
break;
+ case Shader::MODE_FOG:
+ code += "void fog() {\n";
+ code += "\t// Place fog code here.\n";
+ code += "}\n";
+ break;
}
}
text_shader->set_code(code.as_string());
@@ -319,7 +324,7 @@ void ShaderCreateDialog::_path_submitted(const String &p_path) {
ok_pressed();
}
-void ShaderCreateDialog::config(const String &p_base_path, bool p_built_in_enabled, bool p_load_enabled) {
+void ShaderCreateDialog::config(const String &p_base_path, bool p_built_in_enabled, bool p_load_enabled, int p_preferred_type, int p_preferred_mode) {
if (p_base_path != "") {
initial_base_path = p_base_path.get_basename();
file_path->set_text(initial_base_path + "." + language_data[language_menu->get_selected()].default_extension);
@@ -333,6 +338,16 @@ void ShaderCreateDialog::config(const String &p_base_path, bool p_built_in_enabl
built_in_enabled = p_built_in_enabled;
load_enabled = p_load_enabled;
+ if (p_preferred_type > -1) {
+ language_menu->select(p_preferred_type);
+ _language_changed(p_preferred_type);
+ }
+
+ if (p_preferred_mode > -1) {
+ mode_menu->select(p_preferred_mode);
+ _mode_changed(p_preferred_mode);
+ }
+
_language_changed(current_language);
_path_changed(file_path->get_text());
}