You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Merge pull request #35393 from YeldhamDev/plugin_script_syntax
Make script made via plugin creation obey syntax settings
This commit is contained in:
@@ -77,16 +77,19 @@ void PluginConfigDialog::_on_confirmed() {
|
|||||||
|
|
||||||
if (lang_name == GDScriptLanguage::get_singleton()->get_name()) {
|
if (lang_name == GDScriptLanguage::get_singleton()->get_name()) {
|
||||||
// Hard-coded GDScript template to keep usability until we use script templates.
|
// 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(
|
gdscript->set_source_code(
|
||||||
"tool\n"
|
"tool\n"
|
||||||
"extends EditorPlugin\n"
|
"extends EditorPlugin\n"
|
||||||
"\n"
|
"\n"
|
||||||
"func _enter_tree():\n"
|
|
||||||
"\tpass\n"
|
|
||||||
"\n"
|
"\n"
|
||||||
"func _exit_tree():\n"
|
"func _enter_tree()%VOID_RETURN%:\n"
|
||||||
"\tpass\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());
|
String script_path = path.plus_file(script_edit->get_text());
|
||||||
gdscript->set_path(script_path);
|
gdscript->set_path(script_path);
|
||||||
ResourceSaver::save(script_path, gdscript);
|
ResourceSaver::save(script_path, gdscript);
|
||||||
|
|||||||
Reference in New Issue
Block a user