Skip to content

Commit 03633f5

Browse files
committed
Fix template methods after Godot API change
1 parent a50c489 commit 03633f5

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

lua_script_language.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ void LuaScriptLanguage::get_string_delimiters(List<String> *p_delimiters) const
152152
p_delimiters->push_back("[[ ]]"); // Mult-line strings
153153
}
154154

155-
Ref<Script> LuaScriptLanguage::get_template(const String &p_class_name, const String &p_base_class_name) const {
156-
print_debug("LuaScriptLanguage::get_template( p_class_name = " + p_class_name + ", p_base_class_name = " + p_base_class_name + " )");
155+
Ref<Script> LuaScriptLanguage::make_template(const String &p_template, const String &p_class_name, const String &p_base_class_name) const {
156+
print_debug("LuaScriptLanguage::make_template( p_class_name = " + p_class_name + ", p_base_class_name = " + p_base_class_name + " )");
157157

158158
String _template = String() +
159159

@@ -190,15 +190,11 @@ Ref<Script> LuaScriptLanguage::get_template(const String &p_class_name, const St
190190
return script;
191191
}
192192

193-
void LuaScriptLanguage::make_template(const String &p_class_name, const String &p_base_class_name, Ref<Script> &p_script) {
194-
print_debug("LuaScriptLanguage::make_template( p_class_name = " + p_class_name + ", p_base_class_name = " + p_base_class_name + " )");
193+
Vector<ScriptTemplate> LuaScriptLanguage::get_built_in_templates(StringName p_object) {
194+
print_debug("LuaScriptLanguage::get_built_in_templates");
195195

196-
String src = p_script->get_source_code();
197-
src = src.replace("%BASE%", p_base_class_name)
198-
.replace("%CLASS%", p_class_name)
199-
.replace("%TS%", get_indentation());
200-
p_script->set_source_code(src);
201-
}
196+
return Vector<ScriptTemplate>();
197+
} // TODO
202198

203199
bool LuaScriptLanguage::is_using_templates() {
204200
print_debug("LuaScriptLanguage::is_using_templates");

lua_script_language.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
#include <memory>
2929

30+
using ScriptTemplate = ScriptLanguage::ScriptTemplate;
31+
3032
class LuaScriptLanguage : public ScriptLanguage {
3133
static LuaScriptLanguage *singleton;
3234

@@ -49,8 +51,8 @@ class LuaScriptLanguage : public ScriptLanguage {
4951
bool is_control_flow_keyword(String p_keyword) const override;
5052
void get_comment_delimiters(List<String> *p_delimiters) const override;
5153
void get_string_delimiters(List<String> *p_delimiters) const override;
52-
Ref<Script> get_template(const String &p_class_name, const String &p_base_class_name) const override;
53-
void make_template(const String &p_class_name, const String &p_base_class_name, Ref<Script> &p_script) override;
54+
Ref<Script> make_template(const String &p_template, const String &p_class_name, const String &p_base_class_name) const override;
55+
Vector<ScriptTemplate> get_built_in_templates(StringName p_object) override;
5456
bool is_using_templates() override;
5557
bool validate(const String &p_script, const String &p_path = "", List<String> *r_functions = nullptr, List<ScriptError> *r_errors = nullptr, List<Warning> *r_warnings = nullptr, Set<int> *r_safe_lines = nullptr) const override;
5658
String validate_path(const String &p_path) const override;

0 commit comments

Comments
 (0)