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

Method _get_current_template

editor/script/script_create_dialog.cpp:721–736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

719}
720
721ScriptLanguage::ScriptTemplate ScriptCreateDialog::_get_current_template() const {
722 int selected_index = template_menu->get_selected();
723 for (const ScriptLanguage::ScriptTemplate &t : template_list) {
724 if (is_using_templates) {
725 if (t.id == selected_index) {
726 return t;
727 }
728 } else {
729 // Using empty built-in template if templates are disabled.
730 if (t.origin == ScriptLanguage::TemplateLocation::TEMPLATE_BUILT_IN && t.name == "Empty") {
731 return t;
732 }
733 }
734 }
735 return ScriptLanguage::ScriptTemplate();
736}
737
738Vector<ScriptLanguage::ScriptTemplate> ScriptCreateDialog::_get_user_templates(const ScriptLanguage *p_language, const StringName &p_object, const String &p_dir, const ScriptLanguage::TemplateLocation &p_origin) const {
739 Vector<ScriptLanguage::ScriptTemplate> user_templates;

Callers

nothing calls this directly

Calls 2

ScriptTemplateClass · 0.85
get_selectedMethod · 0.45

Tested by

no test coverage detected