summaryrefslogtreecommitdiffstats
path: root/editor/debugger/script_editor_debugger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/debugger/script_editor_debugger.cpp')
-rw-r--r--editor/debugger/script_editor_debugger.cpp55
1 files changed, 35 insertions, 20 deletions
diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp
index 304beec681..f805a4aecd 100644
--- a/editor/debugger/script_editor_debugger.cpp
+++ b/editor/debugger/script_editor_debugger.cpp
@@ -41,6 +41,7 @@
#include "editor/debugger/editor_profiler.h"
#include "editor/debugger/editor_visual_profiler.h"
#include "editor/editor_file_dialog.h"
+#include "editor/editor_file_system.h"
#include "editor/editor_log.h"
#include "editor/editor_node.h"
#include "editor/editor_property_name_processor.h"
@@ -509,6 +510,11 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
String tooltip = oe.warning ? TTR("Warning:") : TTR("Error:");
TreeItem *error = error_tree->create_item(r);
+ if (oe.warning) {
+ error->set_meta("_is_warning", true);
+ } else {
+ error->set_meta("_is_error", true);
+ }
error->set_collapsed(true);
error->set_icon(0, get_theme_icon(oe.warning ? SNAME("Warning") : SNAME("Error"), SNAME("EditorIcons")));
@@ -752,6 +758,12 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
}
performance_profiler->update_monitors(monitors);
+ } else if (p_msg == "filesystem:update_file") {
+ ERR_FAIL_COND(p_data.size() < 1);
+ if (EditorFileSystem::get_singleton()) {
+ EditorFileSystem::get_singleton()->update_file(p_data[0]);
+ }
+
} else {
int colon_index = p_msg.find_char(':');
ERR_FAIL_COND_MSG(colon_index < 1, "Invalid message received");
@@ -798,6 +810,8 @@ void ScriptEditorDebugger::_notification(int p_what) {
[[fallthrough]];
}
case NOTIFICATION_THEME_CHANGED: {
+ tabs->add_theme_style_override("panel", get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("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")));
@@ -809,6 +823,24 @@ void ScriptEditorDebugger::_notification(int p_what) {
search->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
reason->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), SNAME("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")));
+ } 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 = error->get_next();
+ }
+ }
} break;
case NOTIFICATION_PROCESS: {
@@ -871,21 +903,6 @@ void ScriptEditorDebugger::_notification(int p_what) {
break;
};
} break;
-
- case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
- if (tabs->has_theme_stylebox_override("panel")) {
- tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles")));
- }
-
- 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")));
- } break;
}
}
@@ -1557,9 +1574,9 @@ void ScriptEditorDebugger::_item_menu_id_pressed(int p_option) {
String type;
- if (ti->get_icon(0) == get_theme_icon(SNAME("Warning"), SNAME("EditorIcons"))) {
+ if (ti->has_meta("_is_warning")) {
type = "W ";
- } else if (ti->get_icon(0) == get_theme_icon(SNAME("Error"), SNAME("EditorIcons"))) {
+ } else if (ti->has_meta("_is_error")) {
type = "E ";
}
@@ -1700,10 +1717,8 @@ void ScriptEditorDebugger::toggle_profiler(const String &p_profiler, bool p_enab
ScriptEditorDebugger::ScriptEditorDebugger() {
tabs = memnew(TabContainer);
- tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles")));
- tabs->connect("tab_changed", callable_mp(this, &ScriptEditorDebugger::_tab_changed));
-
add_child(tabs);
+ tabs->connect("tab_changed", callable_mp(this, &ScriptEditorDebugger::_tab_changed));
InspectorDock::get_inspector_singleton()->connect("object_id_selected", callable_mp(this, &ScriptEditorDebugger::_remote_object_selected));