diff options
Diffstat (limited to 'editor/debugger')
| -rw-r--r-- | editor/debugger/editor_debugger_node.cpp | 33 | ||||
| -rw-r--r-- | editor/debugger/editor_debugger_node.h | 1 | ||||
| -rw-r--r-- | editor/debugger/editor_debugger_tree.cpp | 10 | ||||
| -rw-r--r-- | editor/debugger/editor_performance_profiler.cpp | 9 | ||||
| -rw-r--r-- | editor/debugger/editor_profiler.cpp | 15 | ||||
| -rw-r--r-- | editor/debugger/editor_visual_profiler.cpp | 25 | ||||
| -rw-r--r-- | editor/debugger/script_editor_debugger.cpp | 69 | ||||
| -rw-r--r-- | editor/debugger/script_editor_debugger.h | 1 |
8 files changed, 85 insertions, 78 deletions
diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index 6143f5ac00..a327fd778b 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -36,6 +36,7 @@ #include "editor/editor_log.h" #include "editor/editor_node.h" #include "editor/editor_settings.h" +#include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_run_bar.h" #include "editor/inspector_dock.h" @@ -50,7 +51,7 @@ template <typename Func> void _for_all(TabContainer *p_node, const Func &p_func) { for (int i = 0; i < p_node->get_tab_count(); i++) { ScriptEditorDebugger *dbg = Object::cast_to<ScriptEditorDebugger>(p_node->get_tab_control(i)); - ERR_FAIL_COND(!dbg); + ERR_FAIL_NULL(dbg); p_func(dbg); } } @@ -62,8 +63,8 @@ EditorDebuggerNode::EditorDebuggerNode() { singleton = this; } - add_theme_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_LEFT)); - add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_RIGHT)); + add_theme_constant_override("margin_left", -EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("BottomPanelDebuggerOverride"), EditorStringName(EditorStyles))->get_margin(SIDE_LEFT)); + add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("BottomPanelDebuggerOverride"), EditorStringName(EditorStyles))->get_margin(SIDE_RIGHT)); tabs = memnew(TabContainer); tabs->set_tabs_visible(false); @@ -118,7 +119,7 @@ ScriptEditorDebugger *EditorDebuggerNode::_add_debugger() { if (tabs->get_tab_count() > 1) { node->clear_style(); tabs->set_tabs_visible(true); - tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"))); + tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("DebuggerPanel"), EditorStringName(EditorStyles))); } if (!debugger_plugins.is_empty()) { @@ -132,7 +133,7 @@ ScriptEditorDebugger *EditorDebuggerNode::_add_debugger() { void EditorDebuggerNode::_stack_frame_selected(int p_debugger) { const ScriptEditorDebugger *dbg = get_debugger(p_debugger); - ERR_FAIL_COND(!dbg); + ERR_FAIL_NULL(dbg); if (dbg != get_current_debugger()) { return; } @@ -283,10 +284,10 @@ void EditorDebuggerNode::_notification(int p_what) { switch (p_what) { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { if (tabs->get_tab_count() > 1) { - add_theme_constant_override("margin_left", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_LEFT)); - add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_RIGHT)); + add_theme_constant_override("margin_left", -EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("BottomPanelDebuggerOverride"), EditorStringName(EditorStyles))->get_margin(SIDE_LEFT)); + add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("BottomPanelDebuggerOverride"), EditorStringName(EditorStyles))->get_margin(SIDE_RIGHT)); - tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"))); + tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SNAME("DebuggerPanel"), EditorStringName(EditorStyles))); } } break; @@ -386,15 +387,15 @@ void EditorDebuggerNode::_update_errors() { } else { debugger_button->set_text(TTR("Debugger") + " (" + itos(error_count + warning_count) + ")"); if (error_count >= 1 && warning_count >= 1) { - debugger_button->set_icon(get_theme_icon(SNAME("ErrorWarning"), SNAME("EditorIcons"))); + debugger_button->set_icon(get_editor_theme_icon(SNAME("ErrorWarning"))); // Use error color to represent the highest level of severity reported. - debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor"))); + debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor))); } else if (error_count >= 1) { - debugger_button->set_icon(get_theme_icon(SNAME("Error"), SNAME("EditorIcons"))); - debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor"))); + debugger_button->set_icon(get_editor_theme_icon(SNAME("Error"))); + debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor))); } else { - debugger_button->set_icon(get_theme_icon(SNAME("Warning"), SNAME("EditorIcons"))); - debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor"))); + debugger_button->set_icon(get_editor_theme_icon(SNAME("Warning"))); + debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), EditorStringName(Editor))); } } last_error_count = error_count; @@ -404,7 +405,7 @@ void EditorDebuggerNode::_update_errors() { void EditorDebuggerNode::_debugger_stopped(int p_id) { ScriptEditorDebugger *dbg = get_debugger(p_id); - ERR_FAIL_COND(!dbg); + ERR_FAIL_NULL(dbg); bool found = false; _for_all(tabs, [&](ScriptEditorDebugger *p_debugger) { @@ -602,7 +603,7 @@ void EditorDebuggerNode::_remote_tree_button_pressed(Object *p_item, int p_colum } TreeItem *item = Object::cast_to<TreeItem>(p_item); - ERR_FAIL_COND(!item); + ERR_FAIL_NULL(item); if (p_id == EditorDebuggerTree::BUTTON_SUBSCENE) { remote_scene_tree->emit_signal(SNAME("open"), item->get_meta("scene_file_path")); diff --git a/editor/debugger/editor_debugger_node.h b/editor/debugger/editor_debugger_node.h index e855fa6ee0..8ca709dd9b 100644 --- a/editor/debugger/editor_debugger_node.h +++ b/editor/debugger/editor_debugger_node.h @@ -31,6 +31,7 @@ #ifndef EDITOR_DEBUGGER_NODE_H #define EDITOR_DEBUGGER_NODE_H +#include "core/object/script_language.h" #include "editor/debugger/editor_debugger_server.h" #include "scene/gui/margin_container.h" diff --git a/editor/debugger/editor_debugger_tree.cpp b/editor/debugger/editor_debugger_tree.cpp index 65f8951c30..6305b7435a 100644 --- a/editor/debugger/editor_debugger_tree.cpp +++ b/editor/debugger/editor_debugger_tree.cpp @@ -115,8 +115,8 @@ void EditorDebuggerTree::_scene_tree_rmb_selected(const Vector2 &p_position, Mou item->select(0); item_menu->clear(); - item_menu->add_icon_item(get_theme_icon(SNAME("CreateNewSceneFrom"), SNAME("EditorIcons")), TTR("Save Branch as Scene"), ITEM_MENU_SAVE_REMOTE_NODE); - item_menu->add_icon_item(get_theme_icon(SNAME("CopyNodePath"), SNAME("EditorIcons")), TTR("Copy Node Path"), ITEM_MENU_COPY_NODE_PATH); + item_menu->add_icon_item(get_editor_theme_icon(SNAME("CreateNewSceneFrom")), TTR("Save Branch as Scene"), ITEM_MENU_SAVE_REMOTE_NODE); + item_menu->add_icon_item(get_editor_theme_icon(SNAME("CopyNodePath")), TTR("Copy Node Path"), ITEM_MENU_COPY_NODE_PATH); item_menu->set_position(get_screen_position() + get_local_mouse_position()); item_menu->reset_size(); item_menu->popup(); @@ -198,7 +198,7 @@ void EditorDebuggerTree::update_scene_tree(const SceneDebuggerTree *p_tree, int const Color remote_button_color = Color(1, 1, 1, 0.8); if (!node.scene_file_path.is_empty()) { String node_scene_file_path = node.scene_file_path; - Ref<Texture2D> button_icon = get_theme_icon(SNAME("InstanceOptions"), SNAME("EditorIcons")); + Ref<Texture2D> button_icon = get_editor_theme_icon(SNAME("InstanceOptions")); String tooltip = vformat(TTR("This node has been instantiated from a PackedScene file:\n%s\nClick to open the original file in the Editor."), node_scene_file_path); item->set_meta("scene_file_path", node_scene_file_path); @@ -209,7 +209,7 @@ void EditorDebuggerTree::update_scene_tree(const SceneDebuggerTree *p_tree, int if (node.view_flags & SceneDebuggerTree::RemoteNode::VIEW_HAS_VISIBLE_METHOD) { bool node_visible = node.view_flags & SceneDebuggerTree::RemoteNode::VIEW_VISIBLE; bool node_visible_in_tree = node.view_flags & SceneDebuggerTree::RemoteNode::VIEW_VISIBLE_IN_TREE; - Ref<Texture2D> button_icon = get_theme_icon(node_visible ? SNAME("GuiVisibilityVisible") : SNAME("GuiVisibilityHidden"), SNAME("EditorIcons")); + Ref<Texture2D> button_icon = get_editor_theme_icon(node_visible ? SNAME("GuiVisibilityVisible") : SNAME("GuiVisibilityHidden")); String tooltip = TTR("Toggle Visibility"); item->set_meta("visible", node_visible); @@ -300,7 +300,7 @@ String EditorDebuggerTree::get_selected_path() { } String EditorDebuggerTree::_get_path(TreeItem *p_item) { - ERR_FAIL_COND_V(!p_item, ""); + ERR_FAIL_NULL_V(p_item, ""); if (p_item->get_parent() == nullptr) { return "/root"; diff --git a/editor/debugger/editor_performance_profiler.cpp b/editor/debugger/editor_performance_profiler.cpp index 641c7d3114..e93369179c 100644 --- a/editor/debugger/editor_performance_profiler.cpp +++ b/editor/debugger/editor_performance_profiler.cpp @@ -33,6 +33,7 @@ #include "editor/editor_property_name_processor.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/editor_string_names.h" #include "main/performance.h" EditorPerformanceProfiler::Monitor::Monitor() {} @@ -46,7 +47,7 @@ EditorPerformanceProfiler::Monitor::Monitor(String p_name, String p_base, int p_ } void EditorPerformanceProfiler::Monitor::update_value(float p_value) { - ERR_FAIL_COND(!item); + ERR_FAIL_NULL(item); String label = EditorPerformanceProfiler::_create_label(p_value, type); String tooltip = label; switch (type) { @@ -131,7 +132,7 @@ void EditorPerformanceProfiler::_monitor_draw() { rect.position += graph_style_box->get_offset(); rect.size -= graph_style_box->get_minimum_size(); - Color draw_color = get_theme_color(SNAME("accent_color"), SNAME("Editor")); + Color draw_color = get_theme_color(SNAME("accent_color"), EditorStringName(Editor)); draw_color.set_hsv(Math::fmod(hue_shift * float(current.frame_index), 0.9f), draw_color.get_s() * 0.9f, draw_color.get_v() * value_multiplier, 0.6f); monitor_draw->draw_string(graph_font, rect.position + Point2(0, graph_font->get_ascent(font_size)), current.item->get_text(0), HORIZONTAL_ALIGNMENT_LEFT, rect.size.x, font_size, draw_color); @@ -235,7 +236,7 @@ TreeItem *EditorPerformanceProfiler::_get_monitor_base(const StringName &p_base_ base->set_selectable(0, false); base->set_expand_right(0, true); if (is_inside_tree()) { - base->set_custom_font(0, get_theme_font(SNAME("bold"), SNAME("EditorFonts"))); + base->set_custom_font(0, get_theme_font(SNAME("bold"), EditorStringName(EditorFonts))); } base_map.insert(p_base_name, base); return base; @@ -374,7 +375,7 @@ void EditorPerformanceProfiler::_notification(int p_what) { switch (p_what) { case NOTIFICATION_THEME_CHANGED: { for (KeyValue<StringName, TreeItem *> &E : base_map) { - E.value->set_custom_font(0, get_theme_font(SNAME("bold"), SNAME("EditorFonts"))); + E.value->set_custom_font(0, get_theme_font(SNAME("bold"), EditorStringName(EditorFonts))); } } break; } diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp index e59fc6186a..f72538e3de 100644 --- a/editor/debugger/editor_profiler.cpp +++ b/editor/debugger/editor_profiler.cpp @@ -33,6 +33,7 @@ #include "core/os/os.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/editor_string_names.h" #include "scene/resources/image_texture.h" void EditorProfiler::_make_metric_ptrs(Metric &m) { @@ -140,11 +141,11 @@ String EditorProfiler::_get_time_as_text(const Metric &m, float p_time, int p_ca } Color EditorProfiler::_get_color_from_signature(const StringName &p_signature) const { - Color bc = get_theme_color(SNAME("error_color"), SNAME("Editor")); + Color bc = get_theme_color(SNAME("error_color"), EditorStringName(Editor)); double rot = ABS(double(p_signature.hash()) / double(0x7FFFFFFF)); Color c; c.set_hsv(rot, bc.get_s(), bc.get_v()); - return c.lerp(get_theme_color(SNAME("base_color"), SNAME("Editor")), 0.07); + return c.lerp(get_theme_color(SNAME("base_color"), EditorStringName(Editor)), 0.07); } void EditorProfiler::_item_edited() { @@ -185,7 +186,7 @@ void EditorProfiler::_update_plot() { } uint8_t *wr = graph_image.ptrw(); - const Color background_color = get_theme_color(SNAME("dark_color_2"), SNAME("Editor")); + const Color background_color = get_theme_color(SNAME("dark_color_2"), EditorStringName(Editor)); // Clear the previous frame and set the background color. for (int i = 0; i < desired_len; i += 4) { @@ -379,10 +380,10 @@ void EditorProfiler::_update_frame() { void EditorProfiler::_update_button_text() { if (activate->is_pressed()) { - activate->set_icon(get_theme_icon(SNAME("Stop"), SNAME("EditorIcons"))); + activate->set_icon(get_editor_theme_icon(SNAME("Stop"))); activate->set_text(TTR("Stop")); } else { - activate->set_icon(get_theme_icon(SNAME("Play"), SNAME("EditorIcons"))); + activate->set_icon(get_editor_theme_icon(SNAME("Play"))); activate->set_text(TTR("Start")); } } @@ -409,8 +410,8 @@ void EditorProfiler::_notification(int p_what) { case NOTIFICATION_LAYOUT_DIRECTION_CHANGED: case NOTIFICATION_THEME_CHANGED: case NOTIFICATION_TRANSLATION_CHANGED: { - activate->set_icon(get_theme_icon(SNAME("Play"), SNAME("EditorIcons"))); - clear_button->set_icon(get_theme_icon(SNAME("Clear"), SNAME("EditorIcons"))); + activate->set_icon(get_editor_theme_icon(SNAME("Play"))); + clear_button->set_icon(get_editor_theme_icon(SNAME("Clear"))); } break; } } diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index 984d8e33c5..7df942e288 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -33,6 +33,7 @@ #include "core/os/os.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/editor_string_names.h" #include "scene/resources/image_texture.h" void EditorVisualProfiler::add_frame_metric(const Metric &p_metric) { @@ -124,11 +125,11 @@ String EditorVisualProfiler::_get_time_as_text(float p_time) { } Color EditorVisualProfiler::_get_color_from_signature(const StringName &p_signature) const { - Color bc = get_theme_color(SNAME("error_color"), SNAME("Editor")); + Color bc = get_theme_color(SNAME("error_color"), EditorStringName(Editor)); double rot = ABS(double(p_signature.hash()) / double(0x7FFFFFFF)); Color c; c.set_hsv(rot, bc.get_s(), bc.get_v()); - return c.lerp(get_theme_color(SNAME("base_color"), SNAME("Editor")), 0.07); + return c.lerp(get_theme_color(SNAME("base_color"), EditorStringName(Editor)), 0.07); } void EditorVisualProfiler::_item_selected() { @@ -158,7 +159,7 @@ void EditorVisualProfiler::_update_plot() { } uint8_t *wr = graph_image.ptrw(); - const Color background_color = get_theme_color("dark_color_2", "Editor"); + const Color background_color = get_theme_color("dark_color_2", EditorStringName(Editor)); // Clear the previous frame and set the background color. for (int i = 0; i < desired_len; i += 4) { @@ -318,7 +319,7 @@ void EditorVisualProfiler::_update_plot() { void EditorVisualProfiler::_update_frame(bool p_focus_selected) { int cursor_metric = _get_cursor_index(); - Ref<Texture> track_icon = get_theme_icon(SNAME("TrackColor"), SNAME("EditorIcons")); + Ref<Texture> track_icon = get_editor_theme_icon(SNAME("TrackColor")); ERR_FAIL_INDEX(cursor_metric, frame_metrics.size()); @@ -407,12 +408,12 @@ void EditorVisualProfiler::_update_frame(bool p_focus_selected) { void EditorVisualProfiler::_activate_pressed() { if (activate->is_pressed()) { - activate->set_icon(get_theme_icon(SNAME("Stop"), SNAME("EditorIcons"))); + activate->set_icon(get_editor_theme_icon(SNAME("Stop"))); activate->set_text(TTR("Stop")); _clear_pressed(); //always clear on start clear_button->set_disabled(false); } else { - activate->set_icon(get_theme_icon(SNAME("Play"), SNAME("EditorIcons"))); + activate->set_icon(get_editor_theme_icon(SNAME("Play"))); activate->set_text(TTR("Start")); } emit_signal(SNAME("enable_profiling"), activate->is_pressed()); @@ -431,11 +432,11 @@ void EditorVisualProfiler::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: case NOTIFICATION_TRANSLATION_CHANGED: { if (is_layout_rtl()) { - activate->set_icon(get_theme_icon(SNAME("PlayBackwards"), SNAME("EditorIcons"))); + activate->set_icon(get_editor_theme_icon(SNAME("PlayBackwards"))); } else { - activate->set_icon(get_theme_icon(SNAME("Play"), SNAME("EditorIcons"))); + activate->set_icon(get_editor_theme_icon(SNAME("Play"))); } - clear_button->set_icon(get_theme_icon(SNAME("Clear"), SNAME("EditorIcons"))); + clear_button->set_icon(get_editor_theme_icon(SNAME("Clear"))); } break; } } @@ -447,7 +448,7 @@ void EditorVisualProfiler::_graph_tex_draw() { Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label")); int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label")); - const Color color = get_theme_color(SNAME("font_color"), SNAME("Editor")); + const Color color = get_theme_color(SNAME("font_color"), EditorStringName(Editor)); if (seeking) { int max_frames = frame_metrics.size(); @@ -653,10 +654,10 @@ void EditorVisualProfiler::_bind_methods() { void EditorVisualProfiler::_update_button_text() { if (activate->is_pressed()) { - activate->set_icon(get_theme_icon(SNAME("Stop"), SNAME("EditorIcons"))); + activate->set_icon(get_editor_theme_icon(SNAME("Stop"))); activate->set_text(TTR("Stop")); } else { - activate->set_icon(get_theme_icon(SNAME("Play"), SNAME("EditorIcons"))); + activate->set_icon(get_editor_theme_icon(SNAME("Play"))); activate->set_text(TTR("Start")); } } diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index ff59911159..c55942acef 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -46,6 +46,7 @@ #include "editor/editor_property_name_processor.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/editor_string_names.h" #include "editor/gui/editor_file_dialog.h" #include "editor/inspector_dock.h" #include "editor/plugins/canvas_item_editor_plugin.h" @@ -93,9 +94,9 @@ void ScriptEditorDebugger::debug_copy() { void ScriptEditorDebugger::debug_skip_breakpoints() { skip_breakpoints_value = !skip_breakpoints_value; if (skip_breakpoints_value) { - skip_breakpoints->set_icon(get_theme_icon(SNAME("DebugSkipBreakpointsOn"), SNAME("EditorIcons"))); + skip_breakpoints->set_icon(get_editor_theme_icon(SNAME("DebugSkipBreakpointsOn"))); } else { - skip_breakpoints->set_icon(get_theme_icon(SNAME("DebugSkipBreakpointsOff"), SNAME("EditorIcons"))); + skip_breakpoints->set_icon(get_editor_theme_icon(SNAME("DebugSkipBreakpointsOff"))); } Array msg; @@ -143,11 +144,11 @@ void ScriptEditorDebugger::update_tabs() { } else { errors_tab->set_name(TTR("Errors") + " (" + itos(error_count + warning_count) + ")"); if (error_count >= 1 && warning_count >= 1) { - tabs->set_tab_icon(tabs->get_tab_idx_from_control(errors_tab), get_theme_icon(SNAME("ErrorWarning"), SNAME("EditorIcons"))); + tabs->set_tab_icon(tabs->get_tab_idx_from_control(errors_tab), get_editor_theme_icon(SNAME("ErrorWarning"))); } else if (error_count >= 1) { - tabs->set_tab_icon(tabs->get_tab_idx_from_control(errors_tab), get_theme_icon(SNAME("Error"), SNAME("EditorIcons"))); + tabs->set_tab_icon(tabs->get_tab_idx_from_control(errors_tab), get_editor_theme_icon(SNAME("Error"))); } else { - tabs->set_tab_icon(tabs->get_tab_idx_from_control(errors_tab), get_theme_icon(SNAME("Warning"), SNAME("EditorIcons"))); + tabs->set_tab_icon(tabs->get_tab_idx_from_control(errors_tab), get_editor_theme_icon(SNAME("Warning"))); } } } @@ -420,8 +421,8 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, uint64_t p_thread it->set_text(3, String::humanize_size(bytes)); total += bytes; - if (has_theme_icon(type, SNAME("EditorIcons"))) { - it->set_icon(0, get_theme_icon(type, SNAME("EditorIcons"))); + if (has_theme_icon(type, EditorStringName(EditorIcons))) { + it->set_icon(0, get_editor_theme_icon(type)); } } @@ -560,11 +561,11 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, uint64_t p_thread } error->set_collapsed(true); - error->set_icon(0, get_theme_icon(oe.warning ? SNAME("Warning") : SNAME("Error"), SNAME("EditorIcons"))); + error->set_icon(0, get_editor_theme_icon(oe.warning ? SNAME("Warning") : SNAME("Error"))); error->set_text(0, time); error->set_text_alignment(0, HORIZONTAL_ALIGNMENT_LEFT); - const Color color = get_theme_color(oe.warning ? SNAME("warning_color") : SNAME("error_color"), SNAME("Editor")); + const Color color = get_theme_color(oe.warning ? SNAME("warning_color") : SNAME("error_color"), EditorStringName(Editor)); error->set_custom_color(0, color); error->set_custom_color(1, color); @@ -821,13 +822,13 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, uint64_t p_thread void ScriptEditorDebugger::_set_reason_text(const String &p_reason, MessageType p_type) { switch (p_type) { case MESSAGE_ERROR: - reason->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor"))); + reason->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor))); break; case MESSAGE_WARNING: - reason->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor"))); + reason->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), EditorStringName(Editor))); break; default: - reason->add_theme_color_override("font_color", get_theme_color(SNAME("success_color"), SNAME("Editor"))); + reason->add_theme_color_override("font_color", get_theme_color(SNAME("success_color"), EditorStringName(Editor))); } reason->set_text(p_reason); @@ -853,32 +854,32 @@ void ScriptEditorDebugger::_notification(int p_what) { [[fallthrough]]; } case NOTIFICATION_THEME_CHANGED: { - tabs->add_theme_style_override("panel", get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"))); + tabs->add_theme_style_override("panel", get_theme_stylebox(SNAME("DebuggerPanel"), EditorStringName(EditorStyles))); - skip_breakpoints->set_icon(get_theme_icon(skip_breakpoints_value ? SNAME("DebugSkipBreakpointsOn") : SNAME("DebugSkipBreakpointsOff"), SNAME("EditorIcons"))); - copy->set_icon(get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons"))); - step->set_icon(get_theme_icon(SNAME("DebugStep"), SNAME("EditorIcons"))); - next->set_icon(get_theme_icon(SNAME("DebugNext"), SNAME("EditorIcons"))); - dobreak->set_icon(get_theme_icon(SNAME("Pause"), SNAME("EditorIcons"))); - docontinue->set_icon(get_theme_icon(SNAME("DebugContinue"), SNAME("EditorIcons"))); - vmem_refresh->set_icon(get_theme_icon(SNAME("Reload"), SNAME("EditorIcons"))); - vmem_export->set_icon(get_theme_icon(SNAME("Save"), SNAME("EditorIcons"))); - search->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); + skip_breakpoints->set_icon(get_editor_theme_icon(skip_breakpoints_value ? SNAME("DebugSkipBreakpointsOn") : SNAME("DebugSkipBreakpointsOff"))); + copy->set_icon(get_editor_theme_icon(SNAME("ActionCopy"))); + step->set_icon(get_editor_theme_icon(SNAME("DebugStep"))); + next->set_icon(get_editor_theme_icon(SNAME("DebugNext"))); + dobreak->set_icon(get_editor_theme_icon(SNAME("Pause"))); + docontinue->set_icon(get_editor_theme_icon(SNAME("DebugContinue"))); + vmem_refresh->set_icon(get_editor_theme_icon(SNAME("Reload"))); + vmem_export->set_icon(get_editor_theme_icon(SNAME("Save"))); + search->set_right_icon(get_editor_theme_icon(SNAME("Search"))); - reason->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("Editor"))); + reason->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor))); TreeItem *error_root = error_tree->get_root(); if (error_root) { TreeItem *error = error_root->get_first_child(); while (error) { if (error->has_meta("_is_warning")) { - error->set_icon(0, get_theme_icon(SNAME("Warning"), SNAME("EditorIcons"))); - error->set_custom_color(0, get_theme_color(SNAME("warning_color"), SNAME("Editor"))); - error->set_custom_color(1, get_theme_color(SNAME("warning_color"), SNAME("Editor"))); + error->set_icon(0, get_editor_theme_icon(SNAME("Warning"))); + error->set_custom_color(0, get_theme_color(SNAME("warning_color"), EditorStringName(Editor))); + error->set_custom_color(1, get_theme_color(SNAME("warning_color"), EditorStringName(Editor))); } else if (error->has_meta("_is_error")) { - error->set_icon(0, get_theme_icon(SNAME("Error"), SNAME("EditorIcons"))); - error->set_custom_color(0, get_theme_color(SNAME("error_color"), SNAME("Editor"))); - error->set_custom_color(1, get_theme_color(SNAME("error_color"), SNAME("Editor"))); + error->set_icon(0, get_editor_theme_icon(SNAME("Error"))); + error->set_custom_color(0, get_theme_color(SNAME("error_color"), EditorStringName(Editor))); + error->set_custom_color(1, get_theme_color(SNAME("error_color"), EditorStringName(Editor))); } error = error->get_next(); @@ -1598,11 +1599,11 @@ void ScriptEditorDebugger::_breakpoints_item_rmb_selected(const Vector2 &p_pos, const TreeItem *selected = breakpoints_tree->get_selected(); String file = selected->get_text(0); if (selected->has_meta("line")) { - breakpoints_menu->add_icon_item(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), TTR("Delete Breakpoint"), ACTION_DELETE_BREAKPOINT); + breakpoints_menu->add_icon_item(get_editor_theme_icon(SNAME("Remove")), TTR("Delete Breakpoint"), ACTION_DELETE_BREAKPOINT); file = selected->get_parent()->get_text(0); } - breakpoints_menu->add_icon_item(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), TTR("Delete All Breakpoints in:") + " " + file, ACTION_DELETE_BREAKPOINTS_IN_FILE); - breakpoints_menu->add_icon_item(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), TTR("Delete All Breakpoints"), ACTION_DELETE_ALL_BREAKPOINTS); + breakpoints_menu->add_icon_item(get_editor_theme_icon(SNAME("Remove")), TTR("Delete All Breakpoints in:") + " " + file, ACTION_DELETE_BREAKPOINTS_IN_FILE); + breakpoints_menu->add_icon_item(get_editor_theme_icon(SNAME("Remove")), TTR("Delete All Breakpoints"), ACTION_DELETE_ALL_BREAKPOINTS); breakpoints_menu->set_position(breakpoints_tree->get_global_position() + p_pos); breakpoints_menu->popup(); @@ -1618,8 +1619,8 @@ void ScriptEditorDebugger::_error_tree_item_rmb_selected(const Vector2 &p_pos, M item_menu->reset_size(); if (error_tree->is_anything_selected()) { - item_menu->add_icon_item(get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons")), TTR("Copy Error"), ACTION_COPY_ERROR); - item_menu->add_icon_item(get_theme_icon(SNAME("ExternalLink"), SNAME("EditorIcons")), TTR("Open C++ Source on GitHub"), ACTION_OPEN_SOURCE); + item_menu->add_icon_item(get_editor_theme_icon(SNAME("ActionCopy")), TTR("Copy Error"), ACTION_COPY_ERROR); + item_menu->add_icon_item(get_editor_theme_icon(SNAME("ExternalLink")), TTR("Open C++ Source on GitHub"), ACTION_OPEN_SOURCE); } if (item_menu->get_item_count() > 0) { diff --git a/editor/debugger/script_editor_debugger.h b/editor/debugger/script_editor_debugger.h index 7e9a767273..79224061ff 100644 --- a/editor/debugger/script_editor_debugger.h +++ b/editor/debugger/script_editor_debugger.h @@ -31,6 +31,7 @@ #ifndef SCRIPT_EDITOR_DEBUGGER_H #define SCRIPT_EDITOR_DEBUGGER_H +#include "core/object/script_language.h" #include "core/os/os.h" #include "editor/debugger/editor_debugger_inspector.h" #include "editor/debugger/editor_debugger_node.h" |
