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

@ -158,17 +158,20 @@ void EditorDockManager::_update_layout() {
return;
}
dock_context_popup->docks_updated();
_update_docks_menu();
update_docks_menu();
EditorNode::get_singleton()->save_editor_layout_delayed();
}
void EditorDockManager::_update_docks_menu() {
void EditorDockManager::update_docks_menu() {
docks_menu->clear();
docks_menu->reset_size();
const Ref<Texture2D> default_icon = docks_menu->get_editor_theme_icon(SNAME("Window"));
const Color closed_icon_color_mod = Color(1, 1, 1, 0.5);
bool global_menu = !bool(EDITOR_GET("interface/editor/use_embedded_menu")) && NativeMenu::get_singleton()->has_feature(NativeMenu::FEATURE_GLOBAL_MENU);
bool dark_mode = DisplayServer::get_singleton()->is_dark_mode_supported() && DisplayServer::get_singleton()->is_dark_mode();
// Add docks.
docks_menu_docks.clear();
int id = 0;
@ -182,7 +185,7 @@ void EditorDockManager::_update_docks_menu() {
} else {
docks_menu->add_item(dock.value.title, id);
}
const Ref<Texture2D> icon = dock.value.icon_name ? docks_menu->get_editor_theme_icon(dock.value.icon_name) : dock.value.icon;
const Ref<Texture2D> icon = dock.value.icon_name ? docks_menu->get_editor_theme_native_menu_icon(dock.value.icon_name, global_menu, dark_mode) : dock.value.icon;
docks_menu->set_item_icon(id, icon.is_valid() ? icon : default_icon);
if (!dock.value.open) {
docks_menu->set_item_icon_modulate(id, closed_icon_color_mod);
@ -613,7 +616,7 @@ void EditorDockManager::load_docks_from_config(Ref<ConfigFile> p_layout, const S
int ofs = p_layout->get_value(p_section, "dock_hsplit_" + itos(i + 1));
hsplits[i]->set_split_offset(ofs * EDSCALE);
}
_update_docks_menu();
update_docks_menu();
}
void EditorDockManager::bottom_dock_show_placement_popup(const Rect2i &p_position, Control *p_dock) {
@ -848,11 +851,13 @@ EditorDockManager::EditorDockManager() {
docks_menu = memnew(PopupMenu);
docks_menu->set_hide_on_item_selection(false);
docks_menu->connect(SceneStringName(id_pressed), callable_mp(this, &EditorDockManager::_docks_menu_option));
EditorNode::get_singleton()->get_gui_base()->connect(SceneStringName(theme_changed), callable_mp(this, &EditorDockManager::_update_docks_menu));
EditorNode::get_singleton()->get_gui_base()->connect(SceneStringName(theme_changed), callable_mp(this, &EditorDockManager::update_docks_menu));
}
void DockContextPopup::_notification(int p_what) {
switch (p_what) {
case Control::NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
case NOTIFICATION_TRANSLATION_CHANGED:
case NOTIFICATION_THEME_CHANGED: {
if (make_float_button) {
make_float_button->set_button_icon(get_editor_theme_icon(SNAME("MakeFloating")));
@ -1087,6 +1092,7 @@ DockContextPopup::DockContextPopup() {
HBoxContainer *header_hb = memnew(HBoxContainer);
tab_move_left_button = memnew(Button);
tab_move_left_button->set_accessibility_name(TTRC("Move Tab Left"));
tab_move_left_button->set_flat(true);
tab_move_left_button->set_focus_mode(Control::FOCUS_NONE);
tab_move_left_button->connect(SceneStringName(pressed), callable_mp(this, &DockContextPopup::_tab_move_left));
@ -1099,6 +1105,7 @@ DockContextPopup::DockContextPopup() {
header_hb->add_child(position_label);
tab_move_right_button = memnew(Button);
tab_move_right_button->set_accessibility_name(TTRC("Move Tab Right"));
tab_move_right_button->set_flat(true);
tab_move_right_button->set_focus_mode(Control::FOCUS_NONE);
tab_move_right_button->connect(SceneStringName(pressed), callable_mp(this, &DockContextPopup::_tab_move_right));