feat: updated engine version to 4.4-rc1
This commit is contained in:
parent
ee00efde1f
commit
21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions
|
|
@ -31,10 +31,10 @@
|
|||
#include "text_editor.h"
|
||||
|
||||
#include "core/io/json.h"
|
||||
#include "core/os/keyboard.h"
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_settings.h"
|
||||
#include "scene/gui/menu_button.h"
|
||||
#include "scene/gui/split_container.h"
|
||||
|
||||
void TextEditor::add_syntax_highlighter(Ref<EditorSyntaxHighlighter> p_highlighter) {
|
||||
ERR_FAIL_COND(p_highlighter.is_null());
|
||||
|
|
@ -103,12 +103,12 @@ void TextEditor::set_edited_resource(const Ref<Resource> &p_res) {
|
|||
edited_res = p_res;
|
||||
|
||||
Ref<TextFile> text_file = edited_res;
|
||||
if (text_file != nullptr) {
|
||||
if (text_file.is_valid()) {
|
||||
code_editor->get_text_editor()->set_text(text_file->get_text());
|
||||
}
|
||||
|
||||
Ref<JSON> json_file = edited_res;
|
||||
if (json_file != nullptr) {
|
||||
if (json_file.is_valid()) {
|
||||
code_editor->get_text_editor()->set_text(json_file->get_parsed_text());
|
||||
}
|
||||
|
||||
|
|
@ -168,12 +168,12 @@ void TextEditor::reload_text() {
|
|||
int v = te->get_v_scroll();
|
||||
|
||||
Ref<TextFile> text_file = edited_res;
|
||||
if (text_file != nullptr) {
|
||||
if (text_file.is_valid()) {
|
||||
te->set_text(text_file->get_text());
|
||||
}
|
||||
|
||||
Ref<JSON> json_file = edited_res;
|
||||
if (json_file != nullptr) {
|
||||
if (json_file.is_valid()) {
|
||||
te->set_text(json_file->get_parsed_text());
|
||||
}
|
||||
|
||||
|
|
@ -193,7 +193,7 @@ void TextEditor::_validate_script() {
|
|||
emit_signal(SNAME("edited_script_changed"));
|
||||
|
||||
Ref<JSON> json_file = edited_res;
|
||||
if (json_file != nullptr) {
|
||||
if (json_file.is_valid()) {
|
||||
CodeEdit *te = code_editor->get_text_editor();
|
||||
|
||||
te->set_line_background_color(code_editor->get_error_pos().x, Color(0, 0, 0, 0));
|
||||
|
|
@ -229,7 +229,7 @@ void TextEditor::_update_bookmark_list() {
|
|||
line = line.substr(0, 50);
|
||||
}
|
||||
|
||||
bookmarks_menu->add_item(String::num((int)bookmark_list[i] + 1) + " - \"" + line + "\"");
|
||||
bookmarks_menu->add_item(String::num_int64(bookmark_list[i] + 1) + " - \"" + line + "\"");
|
||||
bookmarks_menu->set_item_metadata(-1, bookmark_list[i]);
|
||||
}
|
||||
}
|
||||
|
|
@ -244,12 +244,12 @@ void TextEditor::_bookmark_item_pressed(int p_idx) {
|
|||
|
||||
void TextEditor::apply_code() {
|
||||
Ref<TextFile> text_file = edited_res;
|
||||
if (text_file != nullptr) {
|
||||
if (text_file.is_valid()) {
|
||||
text_file->set_text(code_editor->get_text_editor()->get_text());
|
||||
}
|
||||
|
||||
Ref<JSON> json_file = edited_res;
|
||||
if (json_file != nullptr) {
|
||||
if (json_file.is_valid()) {
|
||||
json_file->parse(code_editor->get_text_editor()->get_text(), true);
|
||||
}
|
||||
code_editor->get_text_editor()->get_syntax_highlighter()->update_cache();
|
||||
|
|
@ -302,10 +302,11 @@ void TextEditor::convert_indent() {
|
|||
|
||||
void TextEditor::tag_saved_version() {
|
||||
code_editor->get_text_editor()->tag_saved_version();
|
||||
edited_file_data.last_modified_time = FileAccess::get_modified_time(edited_file_data.path);
|
||||
}
|
||||
|
||||
void TextEditor::goto_line(int p_line, bool p_with_error) {
|
||||
code_editor->goto_line(p_line);
|
||||
void TextEditor::goto_line(int p_line, int p_column) {
|
||||
code_editor->goto_line(p_line, p_column);
|
||||
}
|
||||
|
||||
void TextEditor::goto_line_selection(int p_line, int p_begin, int p_end) {
|
||||
|
|
@ -467,7 +468,7 @@ void TextEditor::_edit_option(int p_op) {
|
|||
emit_signal(SNAME("replace_in_files_requested"), selected_text);
|
||||
} break;
|
||||
case SEARCH_GOTO_LINE: {
|
||||
goto_line_dialog->popup_find_line(tx);
|
||||
goto_line_popup->popup_find_line(code_editor);
|
||||
} break;
|
||||
case BOOKMARK_TOGGLE: {
|
||||
code_editor->toggle_bookmark();
|
||||
|
|
@ -481,6 +482,9 @@ void TextEditor::_edit_option(int p_op) {
|
|||
case BOOKMARK_REMOVE_ALL: {
|
||||
code_editor->remove_all_bookmarks();
|
||||
} break;
|
||||
case EDIT_EMOJI_AND_SYMBOL: {
|
||||
code_editor->get_text_editor()->show_emoji_and_symbol_picker();
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -560,6 +564,10 @@ void TextEditor::_prepare_edit_menu() {
|
|||
|
||||
void TextEditor::_make_context_menu(bool p_selection, bool p_can_fold, bool p_is_folded, Vector2 p_position) {
|
||||
context_menu->clear();
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_EMOJI_AND_SYMBOL_PICKER)) {
|
||||
context_menu->add_item(TTR("Emoji & Symbols"), EDIT_EMOJI_AND_SYMBOL);
|
||||
context_menu->add_separator();
|
||||
}
|
||||
if (p_selection) {
|
||||
context_menu->add_shortcut(ED_GET_SHORTCUT("ui_cut"), EDIT_CUT);
|
||||
context_menu->add_shortcut(ED_GET_SHORTCUT("ui_copy"), EDIT_COPY);
|
||||
|
|
@ -606,6 +614,7 @@ TextEditor::TextEditor() {
|
|||
code_editor->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||
code_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
code_editor->show_toggle_scripts_button();
|
||||
code_editor->set_toggle_list_control(ScriptEditor::get_singleton()->get_left_list_split());
|
||||
|
||||
update_settings();
|
||||
|
||||
|
|
@ -704,8 +713,8 @@ TextEditor::TextEditor() {
|
|||
bookmarks_menu->connect("about_to_popup", callable_mp(this, &TextEditor::_update_bookmark_list));
|
||||
bookmarks_menu->connect("index_pressed", callable_mp(this, &TextEditor::_bookmark_item_pressed));
|
||||
|
||||
goto_line_dialog = memnew(GotoLineDialog);
|
||||
add_child(goto_line_dialog);
|
||||
goto_line_popup = memnew(GotoLinePopup);
|
||||
add_child(goto_line_popup);
|
||||
}
|
||||
|
||||
TextEditor::~TextEditor() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue