diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-03 20:40:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-03 20:40:33 +0100 |
commit | 98b3ba1842a47a34097499a9eee6aa31083a99df (patch) | |
tree | 33efc4bb525ed4452c4924efc459bacbf4c5d68b /modules/visual_script | |
parent | 20563b081bcbfe853622a139422751dba6a75714 (diff) | |
parent | 9d5b80705912d85c3c7301ac0ea0afbf9372a660 (diff) |
Merge pull request #53957 from fabriceci/new-template-workflow
Diffstat (limited to 'modules/visual_script')
-rw-r--r-- | modules/visual_script/visual_script.cpp | 15 | ||||
-rw-r--r-- | modules/visual_script/visual_script.h | 79 |
2 files changed, 44 insertions, 50 deletions
diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 63bd9bbee4..50c24179ff 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -2241,20 +2241,15 @@ void VisualScriptLanguage::get_comment_delimiters(List<String> *p_delimiters) co void VisualScriptLanguage::get_string_delimiters(List<String> *p_delimiters) const { } -Ref<Script> VisualScriptLanguage::get_template(const String &p_class_name, const String &p_base_class_name) const { - Ref<VisualScript> script; - script.instantiate(); - script->set_instance_base_type(p_base_class_name); - return script; -} - bool VisualScriptLanguage::is_using_templates() { - return true; + return false; } -void VisualScriptLanguage::make_template(const String &p_class_name, const String &p_base_class_name, Ref<Script> &p_script) { - Ref<VisualScript> script = p_script; +Ref<Script> VisualScriptLanguage::make_template(const String &p_template, const String &p_class_name, const String &p_base_class_name) const { + Ref<VisualScript> script; + script.instantiate(); script->set_instance_base_type(p_base_class_name); + return script; } bool VisualScriptLanguage::validate(const String &p_script, const String &p_path, List<String> *r_functions, List<ScriptLanguage::ScriptError> *r_errors, List<ScriptLanguage::Warning> *r_warnings, Set<int> *r_safe_lines) const { diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index 39cef8f68b..e321ef236d 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -554,57 +554,56 @@ public: ////////////////////////////////////// - virtual String get_name() const; + virtual String get_name() const override; /* LANGUAGE FUNCTIONS */ - virtual void init(); - virtual String get_type() const; - virtual String get_extension() const; - virtual Error execute_file(const String &p_path); - virtual void finish(); + virtual void init() override; + virtual String get_type() const override; + virtual String get_extension() const override; + virtual Error execute_file(const String &p_path) override; + virtual void finish() override; /* EDITOR FUNCTIONS */ - virtual void get_reserved_words(List<String> *p_words) const; - virtual bool is_control_flow_keyword(String p_keyword) const; - virtual void get_comment_delimiters(List<String> *p_delimiters) const; - virtual void get_string_delimiters(List<String> *p_delimiters) const; - virtual Ref<Script> get_template(const String &p_class_name, const String &p_base_class_name) const; - virtual bool is_using_templates(); - virtual void make_template(const String &p_class_name, const String &p_base_class_name, Ref<Script> &p_script); - virtual bool validate(const String &p_script, const String &p_path = "", List<String> *r_functions = nullptr, List<ScriptLanguage::ScriptError> *r_errors = nullptr, List<ScriptLanguage::Warning> *r_warnings = nullptr, Set<int> *r_safe_lines = nullptr) const; - virtual Script *create_script() const; - virtual bool has_named_classes() const; - virtual bool supports_builtin_mode() const; - virtual int find_function(const String &p_function, const String &p_code) const; - virtual String make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const; - virtual void auto_indent_code(String &p_code, int p_from_line, int p_to_line) const; - virtual void add_global_constant(const StringName &p_variable, const Variant &p_value); + virtual void get_reserved_words(List<String> *p_words) const override; + virtual bool is_control_flow_keyword(String p_keyword) const override; + virtual void get_comment_delimiters(List<String> *p_delimiters) const override; + virtual void get_string_delimiters(List<String> *p_delimiters) const override; + virtual bool is_using_templates() override; + virtual Ref<Script> make_template(const String &p_template, const String &p_class_name, const String &p_base_class_name) const override; + virtual bool validate(const String &p_script, const String &p_path = "", List<String> *r_functions = nullptr, List<ScriptLanguage::ScriptError> *r_errors = nullptr, List<ScriptLanguage::Warning> *r_warnings = nullptr, Set<int> *r_safe_lines = nullptr) const override; + virtual Script *create_script() const override; + virtual bool has_named_classes() const override; + virtual bool supports_builtin_mode() const override; + virtual int find_function(const String &p_function, const String &p_code) const override; + virtual String make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const override; + virtual void auto_indent_code(String &p_code, int p_from_line, int p_to_line) const override; + virtual void add_global_constant(const StringName &p_variable, const Variant &p_value) override; /* DEBUGGER FUNCTIONS */ - virtual String debug_get_error() const; - virtual int debug_get_stack_level_count() const; - virtual int debug_get_stack_level_line(int p_level) const; - virtual String debug_get_stack_level_function(int p_level) const; - virtual String debug_get_stack_level_source(int p_level) const; - virtual void debug_get_stack_level_locals(int p_level, List<String> *p_locals, List<Variant> *p_values, int p_max_subitems = -1, int p_max_depth = -1); - virtual void debug_get_stack_level_members(int p_level, List<String> *p_members, List<Variant> *p_values, int p_max_subitems = -1, int p_max_depth = -1); - virtual void debug_get_globals(List<String> *p_locals, List<Variant> *p_values, int p_max_subitems = -1, int p_max_depth = -1); - virtual String debug_parse_stack_level_expression(int p_level, const String &p_expression, int p_max_subitems = -1, int p_max_depth = -1); - - virtual void reload_all_scripts(); - virtual void reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload); + virtual String debug_get_error() const override; + virtual int debug_get_stack_level_count() const override; + virtual int debug_get_stack_level_line(int p_level) const override; + virtual String debug_get_stack_level_function(int p_level) const override; + virtual String debug_get_stack_level_source(int p_level) const override; + virtual void debug_get_stack_level_locals(int p_level, List<String> *p_locals, List<Variant> *p_values, int p_max_subitems = -1, int p_max_depth = -1) override; + virtual void debug_get_stack_level_members(int p_level, List<String> *p_members, List<Variant> *p_values, int p_max_subitems = -1, int p_max_depth = -1) override; + virtual void debug_get_globals(List<String> *p_locals, List<Variant> *p_values, int p_max_subitems = -1, int p_max_depth = -1) override; + virtual String debug_parse_stack_level_expression(int p_level, const String &p_expression, int p_max_subitems = -1, int p_max_depth = -1) override; + + virtual void reload_all_scripts() override; + virtual void reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload) override; /* LOADER FUNCTIONS */ - virtual void get_recognized_extensions(List<String> *p_extensions) const; - virtual void get_public_functions(List<MethodInfo> *p_functions) const; - virtual void get_public_constants(List<Pair<String, Variant>> *p_constants) const; + virtual void get_recognized_extensions(List<String> *p_extensions) const override; + virtual void get_public_functions(List<MethodInfo> *p_functions) const override; + virtual void get_public_constants(List<Pair<String, Variant>> *p_constants) const override; - virtual void profiling_start(); - virtual void profiling_stop(); + virtual void profiling_start() override; + virtual void profiling_stop() override; - virtual int profiling_get_accumulated_data(ProfilingInfo *p_info_arr, int p_info_max); - virtual int profiling_get_frame_data(ProfilingInfo *p_info_arr, int p_info_max); + virtual int profiling_get_accumulated_data(ProfilingInfo *p_info_arr, int p_info_max) override; + virtual int profiling_get_frame_data(ProfilingInfo *p_info_arr, int p_info_max) override; void add_register_func(const String &p_name, VisualScriptNodeRegisterFunc p_func); void remove_register_func(const String &p_name); |