From 9d5b80705912d85c3c7301ac0ea0afbf9372a660 Mon Sep 17 00:00:00 2001 From: fabriceci Date: Mon, 11 Oct 2021 11:30:59 +0200 Subject: Improve editor template workflow Co-Authored-By: jmb462 --- core/object/script_language.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/object/script_language.h b/core/object/script_language.h index 8d76cbf479..4754b01a07 100644 --- a/core/object/script_language.h +++ b/core/object/script_language.h @@ -274,13 +274,32 @@ public: String message; }; + enum TemplateLocation { + TEMPLATE_BUILT_IN, + TEMPLATE_EDITOR, + TEMPLATE_PROJECT + }; + + struct ScriptTemplate { + String inherit = "Object"; + String name; + String description; + String content; + int id = 0; + TemplateLocation origin = TemplateLocation::TEMPLATE_BUILT_IN; + + String get_hash() const { + return itos(origin) + inherit + name; + } + }; + void get_core_type_words(List *p_core_type_words) const; virtual void get_reserved_words(List *p_words) const = 0; virtual bool is_control_flow_keyword(String p_string) const = 0; virtual void get_comment_delimiters(List *p_delimiters) const = 0; virtual void get_string_delimiters(List *p_delimiters) const = 0; - virtual Ref