feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -38,6 +38,7 @@
#include "editor/editor_string_names.h"
#include "editor/themes/editor_scale.h"
#include "editor/themes/editor_theme_manager.h"
#include "scene/gui/separator.h"
#include "scene/gui/split_container.h"
#include "servers/rendering/shader_preprocessor.h"
#include "servers/rendering/shader_types.h"
@ -727,7 +728,7 @@ void TextShaderEditor::_menu_option(int p_option) {
code_editor->remove_all_bookmarks();
} break;
case HELP_DOCS: {
OS::get_singleton()->shell_open(vformat("%s/tutorials/shaders/shader_reference/index.html", VERSION_DOCS_URL));
OS::get_singleton()->shell_open(vformat("%s/tutorials/shaders/shader_reference/index.html", GODOT_VERSION_DOCS_URL));
} break;
case EDIT_EMOJI_AND_SYMBOL: {
code_editor->get_text_editor()->show_emoji_and_symbol_picker();
@ -749,8 +750,7 @@ void TextShaderEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE:
case NOTIFICATION_THEME_CHANGED: {
PopupMenu *popup = help_menu->get_popup();
popup->set_item_icon(popup->get_item_index(HELP_DOCS), get_editor_theme_icon(SNAME("ExternalLink")));
site_search->set_button_icon(get_editor_theme_icon(SNAME("ExternalLink")));
} break;
case NOTIFICATION_APPLICATION_FOCUS_IN: {
@ -976,6 +976,10 @@ void TextShaderEditor::validate_script() {
code_editor->_validate_script();
}
Control *TextShaderEditor::get_top_bar() {
return hbc;
}
bool TextShaderEditor::is_unsaved() const {
return code_editor->get_text_editor()->get_saved_version() != code_editor->get_text_editor()->get_version();
}
@ -1062,7 +1066,7 @@ void TextShaderEditor::_update_bookmark_list() {
bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_bookmark"), BOOKMARK_GOTO_PREV);
PackedInt32Array bookmark_list = code_editor->get_text_editor()->get_bookmarked_lines();
if (bookmark_list.size() == 0) {
if (bookmark_list.is_empty()) {
return;
}
@ -1149,7 +1153,7 @@ TextShaderEditor::TextShaderEditor() {
VBoxContainer *main_container = memnew(VBoxContainer);
main_container->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
HBoxContainer *hbc = memnew(HBoxContainer);
hbc = memnew(HBoxContainer);
edit_menu = memnew(MenuButton);
edit_menu->set_shortcut_context(this);
@ -1205,18 +1209,20 @@ TextShaderEditor::TextShaderEditor() {
bookmarks_menu->connect("about_to_popup", callable_mp(this, &TextShaderEditor::_update_bookmark_list));
bookmarks_menu->connect("index_pressed", callable_mp(this, &TextShaderEditor::_bookmark_item_pressed));
help_menu = memnew(MenuButton);
help_menu->set_text(TTR("Help"));
help_menu->set_switch_on_hover(true);
help_menu->get_popup()->add_item(TTR("Online Docs"), HELP_DOCS);
help_menu->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &TextShaderEditor::_menu_option));
add_child(main_container);
main_container->add_child(hbc);
hbc->add_child(search_menu);
hbc->add_child(edit_menu);
hbc->add_child(search_menu);
hbc->add_child(goto_menu);
hbc->add_child(help_menu);
hbc->add_spacer();
site_search = memnew(Button);
site_search->set_flat(true);
site_search->connect(SceneStringName(pressed), callable_mp(this, &TextShaderEditor::_menu_option).bind(HELP_DOCS));
site_search->set_text(TTR("Online Docs"));
site_search->set_tooltip_text(TTR("Open Godot online documentation."));
hbc->add_child(site_search);
hbc->add_child(memnew(VSeparator));
hbc->add_theme_style_override(SceneStringName(panel), EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("ScriptEditorPanel"), EditorStringName(EditorStyles)));
VSplitContainer *editor_box = memnew(VSplitContainer);
@ -1263,5 +1269,5 @@ TextShaderEditor::TextShaderEditor() {
add_child(disk_changed);
_editor_settings_changed();
code_editor->show_toggle_scripts_button(); // TODO: Disabled for now, because it doesn't work properly.
code_editor->show_toggle_files_button(); // TODO: Disabled for now, because it doesn't work properly.
}