mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Disable signal callback generation in C#
This commit is contained in:
parent
d3352813ea
commit
9fa2355cef
10 changed files with 50 additions and 18 deletions
|
@ -345,14 +345,19 @@ void ScriptTextEditor::reload_text() {
|
|||
}
|
||||
|
||||
void ScriptTextEditor::add_callback(const String &p_function, PackedStringArray p_args) {
|
||||
ScriptLanguage *language = script->get_language();
|
||||
if (!language->can_make_function()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String code = code_editor->get_text_editor()->get_text();
|
||||
int pos = script->get_language()->find_function(p_function, code);
|
||||
int pos = language->find_function(p_function, code);
|
||||
code_editor->get_text_editor()->remove_secondary_carets();
|
||||
if (pos == -1) {
|
||||
//does not exist
|
||||
code_editor->get_text_editor()->deselect();
|
||||
pos = code_editor->get_text_editor()->get_line_count() + 2;
|
||||
String func = script->get_language()->make_function("", p_function, p_args);
|
||||
String func = language->make_function("", p_function, p_args);
|
||||
//code=code+func;
|
||||
code_editor->get_text_editor()->set_caret_line(pos + 1);
|
||||
code_editor->get_text_editor()->set_caret_column(1000000); //none shall be that big
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue