diff options
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r-- | editor/editor_node.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 2dfad8f05a..2126a7b8be 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -70,6 +70,7 @@ #include "servers/rendering/rendering_device.h" #include "editor/audio_stream_preview.h" +#include "editor/debugger/debug_adapter/debug_adapter_server.h" #include "editor/debugger/editor_debugger_node.h" #include "editor/dependency_editor.h" #include "editor/editor_about.h" @@ -735,11 +736,26 @@ void EditorNode::_notification(int p_what) { void EditorNode::_update_update_spinner() { update_spinner->set_visible(EditorSettings::get_singleton()->get("interface/editor/show_update_spinner")); - bool update_continuously = EditorSettings::get_singleton()->get("interface/editor/update_continuously"); + const bool update_continuously = EditorSettings::get_singleton()->get("interface/editor/update_continuously"); PopupMenu *update_popup = update_spinner->get_popup(); update_popup->set_item_checked(update_popup->get_item_index(SETTINGS_UPDATE_CONTINUOUSLY), update_continuously); update_popup->set_item_checked(update_popup->get_item_index(SETTINGS_UPDATE_WHEN_CHANGED), !update_continuously); + if (update_continuously) { + update_spinner->set_tooltip(TTR("Spins when the editor window redraws.\nUpdate Continuously is enabled, which can increase power usage. Click to disable it.")); + + // Use a different color for the update spinner when Update Continuously is enabled, + // as this feature should only be enabled for troubleshooting purposes. + // Make the icon modulate color overbright because icons are not completely white on a dark theme. + // On a light theme, icons are dark, so we need to modulate them with an even brighter color. + const bool dark_theme = EditorSettings::get_singleton()->is_dark_theme(); + update_spinner->set_self_modulate( + gui_base->get_theme_color("error_color", "Editor") * (dark_theme ? Color(1.1, 1.1, 1.1) : Color(4.25, 4.25, 4.25))); + } else { + update_spinner->set_tooltip(TTR("Spins when the editor window redraws.")); + update_spinner->set_self_modulate(Color(1, 1, 1)); + } + OS::get_singleton()->set_low_processor_usage_mode(!update_continuously); } @@ -3797,6 +3813,8 @@ void EditorNode::unregister_editor_types() { if (EditorPaths::get_singleton()) { EditorPaths::free(); } + + EditorResourcePicker::clear_caches(); } void EditorNode::stop_child_process(OS::ProcessID p_pid) { @@ -4926,6 +4944,16 @@ void EditorNode::_scene_tab_input(const Ref<InputEvent> &p_input) { scene_tabs_context_menu->set_position(mb->get_global_position()); scene_tabs_context_menu->popup(); } + if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_UP && mb->is_pressed()) { + int previous_tab = editor_data.get_edited_scene() - 1; + previous_tab = previous_tab >= 0 ? previous_tab : editor_data.get_edited_scene_count() - 1; + _scene_tab_changed(previous_tab); + } + if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_DOWN && mb->is_pressed()) { + int next_tab = editor_data.get_edited_scene() + 1; + next_tab %= editor_data.get_edited_scene_count(); + _scene_tab_changed(next_tab); + } } } @@ -6508,7 +6536,6 @@ EditorNode::EditorNode() { layout_dialog->connect("name_confirmed", callable_mp(this, &EditorNode::_dialog_action)); update_spinner = memnew(MenuButton); - update_spinner->set_tooltip(TTR("Spins when the editor window redraws.")); right_menu_hb->add_child(update_spinner); update_spinner->set_icon(gui_base->get_theme_icon(SNAME("Progress1"), SNAME("EditorIcons"))); update_spinner->get_popup()->connect("id_pressed", callable_mp(this, &EditorNode::_menu_option)); @@ -6739,6 +6766,7 @@ EditorNode::EditorNode() { //plugin stuff add_editor_plugin(memnew(DebuggerEditorPlugin(this, debug_menu))); + add_editor_plugin(memnew(DebugAdapterServer())); disk_changed = memnew(ConfirmationDialog); { |