summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/editor_debugger_plugin.cpp27
-rw-r--r--editor/plugins/editor_debugger_plugin.h12
-rw-r--r--editor/progress_dialog.cpp24
-rw-r--r--editor/progress_dialog.h2
-rw-r--r--editor/themes/editor_theme_manager.cpp14
5 files changed, 73 insertions, 6 deletions
diff --git a/editor/plugins/editor_debugger_plugin.cpp b/editor/plugins/editor_debugger_plugin.cpp
index c96bec6e7f..fbb389ccb4 100644
--- a/editor/plugins/editor_debugger_plugin.cpp
+++ b/editor/plugins/editor_debugger_plugin.cpp
@@ -56,6 +56,7 @@ void EditorDebuggerSession::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_active"), &EditorDebuggerSession::is_active);
ClassDB::bind_method(D_METHOD("add_session_tab", "control"), &EditorDebuggerSession::add_session_tab);
ClassDB::bind_method(D_METHOD("remove_session_tab", "control"), &EditorDebuggerSession::remove_session_tab);
+ ClassDB::bind_method(D_METHOD("set_breakpoint", "path", "line", "enabled"), &EditorDebuggerSession::set_breakpoint);
ADD_SIGNAL(MethodInfo("started"));
ADD_SIGNAL(MethodInfo("stopped"));
@@ -100,6 +101,11 @@ bool EditorDebuggerSession::is_active() {
return debugger->is_session_active();
}
+void EditorDebuggerSession::set_breakpoint(const String &p_path, int p_line, bool p_enabled) {
+ ERR_FAIL_NULL_MSG(debugger, "Plugin is not attached to debugger.");
+ debugger->set_breakpoint(p_path, p_line, p_enabled);
+}
+
void EditorDebuggerSession::detach_debugger() {
if (!debugger) {
return;
@@ -184,10 +190,31 @@ bool EditorDebuggerPlugin::capture(const String &p_message, const Array &p_data,
return false;
}
+void EditorDebuggerPlugin::goto_script_line(const Ref<Script> &p_script, int p_line) {
+ GDVIRTUAL_CALL(_goto_script_line, p_script, p_line);
+}
+
+void EditorDebuggerPlugin::breakpoints_cleared_in_tree() {
+ GDVIRTUAL_CALL(_breakpoints_cleared_in_tree);
+}
+
+void EditorDebuggerPlugin::breakpoint_set_in_tree(const Ref<Script> &p_script, int p_line, bool p_enabled) {
+ GDVIRTUAL_CALL(_breakpoint_set_in_tree, p_script, p_line, p_enabled);
+}
+
void EditorDebuggerPlugin::_bind_methods() {
GDVIRTUAL_BIND(_setup_session, "session_id");
GDVIRTUAL_BIND(_has_capture, "capture");
GDVIRTUAL_BIND(_capture, "message", "data", "session_id");
+ GDVIRTUAL_BIND(_goto_script_line, "script", "line");
+ GDVIRTUAL_BIND(_breakpoints_cleared_in_tree);
+ GDVIRTUAL_BIND(_breakpoint_set_in_tree, "script", "line", "enabled");
ClassDB::bind_method(D_METHOD("get_session", "id"), &EditorDebuggerPlugin::get_session);
ClassDB::bind_method(D_METHOD("get_sessions"), &EditorDebuggerPlugin::get_sessions);
}
+
+EditorDebuggerPlugin::EditorDebuggerPlugin() {
+ EditorDebuggerNode::get_singleton()->connect("goto_script_line", callable_mp(this, &EditorDebuggerPlugin::goto_script_line));
+ EditorDebuggerNode::get_singleton()->connect("breakpoints_cleared_in_tree", callable_mp(this, &EditorDebuggerPlugin::breakpoints_cleared_in_tree));
+ EditorDebuggerNode::get_singleton()->connect("breakpoint_set_in_tree", callable_mp(this, &EditorDebuggerPlugin::breakpoint_set_in_tree));
+}
diff --git a/editor/plugins/editor_debugger_plugin.h b/editor/plugins/editor_debugger_plugin.h
index 41f34f67cf..4f09824d03 100644
--- a/editor/plugins/editor_debugger_plugin.h
+++ b/editor/plugins/editor_debugger_plugin.h
@@ -62,6 +62,8 @@ public:
bool is_debuggable();
bool is_active();
+ void set_breakpoint(const String &p_path, int p_line, bool p_enabled);
+
EditorDebuggerSession(ScriptEditorDebugger *p_debugger);
~EditorDebuggerSession();
};
@@ -90,7 +92,15 @@ public:
GDVIRTUAL1RC(bool, _has_capture, const String &);
GDVIRTUAL1(_setup_session, int);
- EditorDebuggerPlugin() {}
+ virtual void goto_script_line(const Ref<Script> &p_script, int p_line);
+ virtual void breakpoints_cleared_in_tree();
+ virtual void breakpoint_set_in_tree(const Ref<Script> &p_script, int p_line, bool p_enabled);
+
+ GDVIRTUAL2(_goto_script_line, const Ref<Script> &, int);
+ GDVIRTUAL0(_breakpoints_cleared_in_tree);
+ GDVIRTUAL3(_breakpoint_set_in_tree, const Ref<Script> &, int, bool);
+
+ EditorDebuggerPlugin();
~EditorDebuggerPlugin();
};
diff --git a/editor/progress_dialog.cpp b/editor/progress_dialog.cpp
index 406425e9fd..2623079cfe 100644
--- a/editor/progress_dialog.cpp
+++ b/editor/progress_dialog.cpp
@@ -126,6 +126,16 @@ void BackgroundProgress::end_task(const String &p_task) {
ProgressDialog *ProgressDialog::singleton = nullptr;
+void ProgressDialog::_update_ui() {
+ // Run main loop for two frames.
+ if (is_inside_tree()) {
+ DisplayServer::get_singleton()->process_events();
+#ifndef ANDROID_ENABLED
+ Main::iteration();
+#endif
+ }
+}
+
void ProgressDialog::_popup() {
Size2 ms = main->get_combined_minimum_size();
ms.width = MAX(500 * EDSCALE, ms.width);
@@ -138,7 +148,13 @@ void ProgressDialog::_popup() {
main->set_offset(SIDE_TOP, style->get_margin(SIDE_TOP));
main->set_offset(SIDE_BOTTOM, -style->get_margin(SIDE_BOTTOM));
- if (!is_inside_tree()) {
+ if (is_inside_tree()) {
+ Rect2i adjust = _popup_adjust_rect();
+ if (adjust != Rect2i()) {
+ set_position(adjust.position);
+ set_size(adjust.size);
+ }
+ } else {
for (Window *window : host_windows) {
if (window->has_focus()) {
popup_exclusive_centered(window, ms);
@@ -182,6 +198,7 @@ void ProgressDialog::add_task(const String &p_task, const String &p_label, int p
if (p_can_cancel) {
cancel->grab_focus();
}
+ _update_ui();
}
bool ProgressDialog::task_step(const String &p_task, const String &p_state, int p_step, bool p_force_redraw) {
@@ -203,11 +220,8 @@ bool ProgressDialog::task_step(const String &p_task, const String &p_state, int
t.state->set_text(p_state);
last_progress_tick = OS::get_singleton()->get_ticks_usec();
- DisplayServer::get_singleton()->process_events();
+ _update_ui();
-#ifndef ANDROID_ENABLED
- Main::iteration(); // this will not work on a lot of platforms, so it's only meant for the editor
-#endif
return canceled;
}
diff --git a/editor/progress_dialog.h b/editor/progress_dialog.h
index 74196a28df..82d59219da 100644
--- a/editor/progress_dialog.h
+++ b/editor/progress_dialog.h
@@ -85,6 +85,8 @@ class ProgressDialog : public PopupPanel {
void _popup();
void _cancel_pressed();
+
+ void _update_ui();
bool canceled = false;
public:
diff --git a/editor/themes/editor_theme_manager.cpp b/editor/themes/editor_theme_manager.cpp
index 9a0941c75e..10b7c64999 100644
--- a/editor/themes/editor_theme_manager.cpp
+++ b/editor/themes/editor_theme_manager.cpp
@@ -451,6 +451,9 @@ void EditorThemeManager::_create_shared_styles(const Ref<EditorTheme> &p_theme,
p_theme->set_color("success_color", EditorStringName(Editor), p_config.success_color);
p_theme->set_color("warning_color", EditorStringName(Editor), p_config.warning_color);
p_theme->set_color("error_color", EditorStringName(Editor), p_config.error_color);
+#ifndef DISABLE_DEPRECATED // Used before 4.3.
+ p_theme->set_color("disabled_highlight_color", EditorStringName(Editor), p_config.highlight_disabled_color);
+#endif
// Only used when the Draw Extra Borders editor setting is enabled.
p_config.extra_border_color_1 = Color(0.5, 0.5, 0.5);
@@ -480,6 +483,12 @@ void EditorThemeManager::_create_shared_styles(const Ref<EditorTheme> &p_theme,
p_theme->set_color("font_readonly_color", EditorStringName(Editor), p_config.font_readonly_color);
p_theme->set_color("font_placeholder_color", EditorStringName(Editor), p_config.font_placeholder_color);
p_theme->set_color("font_outline_color", EditorStringName(Editor), p_config.font_outline_color);
+#ifndef DISABLE_DEPRECATED // Used before 4.3.
+ p_theme->set_color("readonly_font_color", EditorStringName(Editor), p_config.font_readonly_color);
+ p_theme->set_color("disabled_font_color", EditorStringName(Editor), p_config.font_disabled_color);
+ p_theme->set_color("readonly_color", EditorStringName(Editor), p_config.font_readonly_color);
+ p_theme->set_color("highlighted_font_color", EditorStringName(Editor), p_config.font_hover_color); // Closest equivalent.
+#endif
// Icon colors.
@@ -728,6 +737,8 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_constant("h_separation", "Button", 4 * EDSCALE);
p_theme->set_constant("outline_size", "Button", 0);
+ p_theme->set_constant("align_to_largest_stylebox", "Button", 1); // Enabled.
+
// MenuButton.
p_theme->set_stylebox(CoreStringName(normal), "MenuButton", p_config.panel_container_style);
@@ -2106,6 +2117,9 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
p_theme->set_color("prop_category", EditorStringName(Editor), prop_category_color);
p_theme->set_color("prop_section", EditorStringName(Editor), prop_section_color);
p_theme->set_color("prop_subsection", EditorStringName(Editor), prop_subsection_color);
+#ifndef DISABLE_DEPRECATED // Used before 4.3.
+ p_theme->set_color("property_color", EditorStringName(Editor), prop_category_color);
+#endif
// EditorInspectorCategory.