summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-01-21 13:21:01 +0100
committerGitHub <noreply@github.com>2020-01-21 13:21:01 +0100
commitd4ac0ca15397932960403d595f2e08f926411471 (patch)
tree0cdc09032101630b9b01ec53165af5d73a525ecf /editor
parent423f15262f44a7688dcd102d7b9257dc2571f683 (diff)
parent3a0dc521274e6ab3228825bbf1fb9b68665ca3d1 (diff)
Merge pull request #35393 from YeldhamDev/plugin_script_syntax
Make script made via plugin creation obey syntax settings
Diffstat (limited to 'editor')
-rw-r--r--editor/plugin_config_dialog.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp
index 28667abe77..07b87633a9 100644
--- a/editor/plugin_config_dialog.cpp
+++ b/editor/plugin_config_dialog.cpp
@@ -77,16 +77,19 @@ void PluginConfigDialog::_on_confirmed() {
if (lang_name == GDScriptLanguage::get_singleton()->get_name()) {
// Hard-coded GDScript template to keep usability until we use script templates.
- Ref<GDScript> gdscript = memnew(GDScript);
+ Ref<Script> gdscript = memnew(GDScript);
gdscript->set_source_code(
"tool\n"
"extends EditorPlugin\n"
"\n"
- "func _enter_tree():\n"
- "\tpass\n"
"\n"
- "func _exit_tree():\n"
- "\tpass\n");
+ "func _enter_tree()%VOID_RETURN%:\n"
+ "%TS%pass\n"
+ "\n"
+ "\n"
+ "func _exit_tree()%VOID_RETURN%:\n"
+ "%TS%pass\n");
+ GDScriptLanguage::get_singleton()->make_template("", "", gdscript);
String script_path = path.plus_file(script_edit->get_text());
gdscript->set_path(script_path);
ResourceSaver::save(script_path, gdscript);