MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / get_script_templates

Method get_script_templates

editor/settings/editor_settings.cpp:1825–1844  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1823}
1824
1825Vector<String> EditorSettings::get_script_templates(const String &p_extension, const String &p_custom_path) {
1826 Vector<String> templates;
1827 String template_dir = EditorPaths::get_singleton()->get_script_templates_dir();
1828 if (!p_custom_path.is_empty()) {
1829 template_dir = p_custom_path;
1830 }
1831 Ref<DirAccess> d = DirAccess::open(template_dir);
1832 if (d.is_valid()) {
1833 d->list_dir_begin();
1834 String file = d->get_next();
1835 while (!file.is_empty()) {
1836 if (file.get_extension() == p_extension) {
1837 templates.push_back(file.get_basename());
1838 }
1839 file = d->get_next();
1840 }
1841 d->list_dir_end();
1842 }
1843 return templates;
1844}
1845
1846String EditorSettings::get_editor_layouts_config() const {
1847 return EditorPaths::get_singleton()->get_config_dir().path_join("editor_layouts.cfg");

Callers

nothing calls this directly

Calls 9

get_basenameMethod · 0.80
is_emptyMethod · 0.45
is_validMethod · 0.45
list_dir_beginMethod · 0.45
get_nextMethod · 0.45
get_extensionMethod · 0.45
push_backMethod · 0.45
list_dir_endMethod · 0.45

Tested by

no test coverage detected