You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Add ability to use custom script templates.
Templates will be loaded from .godot/script_templates For now they're disabled for GDNative. Ideas for further improvements: - Add a "Save as Template" option to the script editor, as it can normally only save to res:// - Support more placeholders / custom placeholders
This commit is contained in:
@@ -615,6 +615,11 @@ Error GDScript::reload(bool p_keep_state) {
|
||||
if (basedir != "")
|
||||
basedir = basedir.get_base_dir();
|
||||
|
||||
if (basedir.find("res://") == -1 && basedir.find("user://") == -1) {
|
||||
//loading a template, don't parse
|
||||
return OK;
|
||||
}
|
||||
|
||||
valid = false;
|
||||
GDParser parser;
|
||||
Error err = parser.parse(source, basedir, false, path);
|
||||
|
||||
Reference in New Issue
Block a user