feat: updated engine version to 4.4-rc1

This commit is contained in:
Sara 2025-02-23 14:38:14 +01:00
parent ee00efde1f
commit 21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions

View file

@ -40,7 +40,6 @@
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "editor/editor_string_names.h"
#include "editor/filesystem_dock.h"
#include "editor/gui/editor_bottom_panel.h"
#include "editor/themes/editor_scale.h"
#include "editor/window_wrapper.h"
@ -174,6 +173,9 @@ void EditorDockManager::_update_docks_menu() {
docks_menu_docks.clear();
int id = 0;
for (const KeyValue<Control *, DockInfo> &dock : all_docks) {
if (!dock.value.enabled) {
continue;
}
if (dock.value.shortcut.is_valid()) {
docks_menu->add_shortcut(dock.value.shortcut, id);
docks_menu->set_item_text(id, dock.value.title);
@ -184,8 +186,10 @@ void EditorDockManager::_update_docks_menu() {
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);
docks_menu->set_item_tooltip(id, vformat(TTR("Open the %s dock."), dock.value.title));
} else {
docks_menu->set_item_tooltip(id, vformat(TTR("Focus on the %s dock."), dock.value.title));
}
docks_menu->set_item_disabled(id, !dock.value.enabled);
docks_menu_docks.push_back(dock.key);
id++;
}
@ -475,6 +479,8 @@ void EditorDockManager::save_docks_to_config(Ref<ConfigFile> p_layout, const Str
Array bottom_docks_dump;
Array closed_docks_dump;
for (const KeyValue<Control *, DockInfo> &d : all_docks) {
d.key->call(SNAME("_save_layout_to_config"), p_layout, p_section);
if (!d.value.at_bottom && d.value.open && (!d.value.previous_at_bottom || !d.value.dock_window)) {
continue;
}
@ -509,18 +515,16 @@ void EditorDockManager::save_docks_to_config(Ref<ConfigFile> p_layout, const Str
}
for (int i = 0; i < hsplits.size(); i++) {
p_layout->set_value(p_section, "dock_hsplit_" + itos(i + 1), hsplits[i]->get_split_offset());
p_layout->set_value(p_section, "dock_hsplit_" + itos(i + 1), int(hsplits[i]->get_split_offset() / EDSCALE));
}
FileSystemDock::get_singleton()->save_layout_to_config(p_layout, p_section);
}
void EditorDockManager::load_docks_from_config(Ref<ConfigFile> p_layout, const String &p_section) {
void EditorDockManager::load_docks_from_config(Ref<ConfigFile> p_layout, const String &p_section, bool p_first_load) {
Dictionary floating_docks_dump = p_layout->get_value(p_section, "dock_floating", Dictionary());
Array dock_bottom = p_layout->get_value(p_section, "dock_bottom", Array());
Array closed_docks = p_layout->get_value(p_section, "dock_closed", Array());
bool restore_window_on_load = EDITOR_GET("interface/multi_window/restore_windows_on_load");
bool allow_floating_docks = EditorNode::get_singleton()->is_multi_window_enabled() && (!p_first_load || EDITOR_GET("interface/multi_window/restore_windows_on_load"));
// Store the docks by name for easy lookup.
HashMap<String, Control *> dock_map;
@ -543,13 +547,14 @@ void EditorDockManager::load_docks_from_config(Ref<ConfigFile> p_layout, const S
continue;
}
Control *dock = dock_map[name];
dock->call(SNAME("_load_layout_from_config"), p_layout, p_section);
if (!all_docks[dock].enabled) {
// Don't open disabled docks.
continue;
}
bool at_bottom = false;
if (restore_window_on_load && floating_docks_dump.has(name)) {
if (allow_floating_docks && floating_docks_dump.has(name)) {
all_docks[dock].previous_at_bottom = dock_bottom.has(name);
_restore_dock_to_saved_window(dock, floating_docks_dump[name]);
} else if (dock_bottom.has(name)) {
@ -605,11 +610,8 @@ void EditorDockManager::load_docks_from_config(Ref<ConfigFile> p_layout, const S
continue;
}
int ofs = p_layout->get_value(p_section, "dock_hsplit_" + itos(i + 1));
hsplits[i]->set_split_offset(ofs);
hsplits[i]->set_split_offset(ofs * EDSCALE);
}
FileSystemDock::get_singleton()->load_layout_from_config(p_layout, p_section);
_update_docks_menu();
}
@ -712,7 +714,7 @@ void EditorDockManager::focus_dock(Control *p_dock) {
}
if (all_docks[p_dock].at_bottom) {
EditorNode::get_bottom_panel()->make_item_visible(p_dock);
EditorNode::get_bottom_panel()->make_item_visible(p_dock, true, true);
return;
}
@ -852,21 +854,21 @@ void DockContextPopup::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_THEME_CHANGED: {
if (make_float_button) {
make_float_button->set_icon(get_editor_theme_icon(SNAME("MakeFloating")));
make_float_button->set_button_icon(get_editor_theme_icon(SNAME("MakeFloating")));
}
if (is_layout_rtl()) {
tab_move_left_button->set_icon(get_editor_theme_icon(SNAME("Forward")));
tab_move_right_button->set_icon(get_editor_theme_icon(SNAME("Back")));
tab_move_left_button->set_button_icon(get_editor_theme_icon(SNAME("Forward")));
tab_move_right_button->set_button_icon(get_editor_theme_icon(SNAME("Back")));
tab_move_left_button->set_tooltip_text(TTR("Move this dock right one tab."));
tab_move_right_button->set_tooltip_text(TTR("Move this dock left one tab."));
} else {
tab_move_left_button->set_icon(get_editor_theme_icon(SNAME("Back")));
tab_move_right_button->set_icon(get_editor_theme_icon(SNAME("Forward")));
tab_move_left_button->set_button_icon(get_editor_theme_icon(SNAME("Back")));
tab_move_right_button->set_button_icon(get_editor_theme_icon(SNAME("Forward")));
tab_move_left_button->set_tooltip_text(TTR("Move this dock left one tab."));
tab_move_right_button->set_tooltip_text(TTR("Move this dock right one tab."));
}
dock_to_bottom_button->set_icon(get_editor_theme_icon(SNAME("ControlAlignBottomWide")));
close_button->set_icon(get_editor_theme_icon(SNAME("Close")));
dock_to_bottom_button->set_button_icon(get_editor_theme_icon(SNAME("ControlAlignBottomWide")));
close_button->set_button_icon(get_editor_theme_icon(SNAME("Close")));
} break;
}
}