Allow to define and load script templates per project
Previously it was only possible to create custom script templates per
editor instance which could lead to certain name collisions, but now one
can create such templates per project tailored for specific use cases.
The default path to search for custom script templates is defined in
project settings via `editor/script_templates_search_path` setting as
`res://script_templates` path, yet this can be configured per project.
Templates have at most two origins now:
1. Project-specific, defined in `ProjectSettings`, for instance:
- res://script_templates/
2. Editor script templates, for instance:
- %APPDATA%/Godot/script_templates/
As script templates can have the same name over different paths,
the override mechanism was also added, enabling project-specific
templates over the editor ones.
This commit is contained in:
@ -166,6 +166,7 @@ public:
|
||||
String get_project_settings_dir() const;
|
||||
String get_text_editor_themes_dir() const;
|
||||
String get_script_templates_dir() const;
|
||||
String get_project_script_templates_dir() const;
|
||||
String get_cache_dir() const;
|
||||
String get_feature_profiles_dir() const;
|
||||
|
||||
@ -187,7 +188,7 @@ public:
|
||||
bool save_text_editor_theme_as(String p_file);
|
||||
bool is_default_text_editor_theme();
|
||||
|
||||
Vector<String> get_script_templates(const String &p_extension);
|
||||
Vector<String> get_script_templates(const String &p_extension, const String &p_custom_path = String());
|
||||
String get_editor_layouts_config() const;
|
||||
|
||||
void add_shortcut(const String &p_name, Ref<ShortCut> &p_shortcut);
|
||||
|
||||
Reference in New Issue
Block a user