summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/debugger/editor_debugger_node.cpp8
-rw-r--r--editor/debugger/script_editor_debugger.cpp8
-rw-r--r--editor/editor_log.cpp2
-rw-r--r--editor/icons/ErrorWarning.svg1
-rw-r--r--editor/scene_tree_dock.cpp44
-rw-r--r--editor/scene_tree_dock.h4
6 files changed, 37 insertions, 30 deletions
diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp
index 3302b50103..7551214336 100644
--- a/editor/debugger/editor_debugger_node.cpp
+++ b/editor/debugger/editor_debugger_node.cpp
@@ -261,10 +261,12 @@ void EditorDebuggerNode::_notification(int p_what) {
debugger_button->set_icon(Ref<Texture2D>());
} else {
debugger_button->set_text(TTR("Debugger") + " (" + itos(error_count + warning_count) + ")");
- if (error_count == 0) {
- debugger_button->set_icon(get_theme_icon("Warning", "EditorIcons"));
- } else {
+ if (error_count >= 1 && warning_count >= 1) {
+ debugger_button->set_icon(get_theme_icon("ErrorWarning", "EditorIcons"));
+ } else if (error_count >= 1) {
debugger_button->set_icon(get_theme_icon("Error", "EditorIcons"));
+ } else {
+ debugger_button->set_icon(get_theme_icon("Warning", "EditorIcons"));
}
}
last_error_count = error_count;
diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp
index 0fa62253c3..af79de2991 100644
--- a/editor/debugger/script_editor_debugger.cpp
+++ b/editor/debugger/script_editor_debugger.cpp
@@ -131,10 +131,12 @@ void ScriptEditorDebugger::update_tabs() {
tabs->set_tab_icon(errors_tab->get_index(), Ref<Texture2D>());
} else {
errors_tab->set_name(TTR("Errors") + " (" + itos(error_count + warning_count) + ")");
- if (error_count == 0) {
- tabs->set_tab_icon(errors_tab->get_index(), get_theme_icon("Warning", "EditorIcons"));
- } else {
+ if (error_count >= 1 && warning_count >= 1) {
+ tabs->set_tab_icon(errors_tab->get_index(), get_theme_icon("ErrorWarning", "EditorIcons"));
+ } else if (error_count >= 1) {
tabs->set_tab_icon(errors_tab->get_index(), get_theme_icon("Error", "EditorIcons"));
+ } else {
+ tabs->set_tab_icon(errors_tab->get_index(), get_theme_icon("Warning", "EditorIcons"));
}
}
}
diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp
index c89a7bcf23..78aed96363 100644
--- a/editor/editor_log.cpp
+++ b/editor/editor_log.cpp
@@ -63,11 +63,13 @@ void EditorLog::_notification(int p_what) {
//button->set_icon(get_icon("Console","EditorIcons"));
log->add_theme_font_override("normal_font", get_theme_font("output_source", "EditorFonts"));
+ log->add_theme_color_override("selection_color", get_theme_color("accent_color", "Editor") * Color(1, 1, 1, 0.4));
} else if (p_what == NOTIFICATION_THEME_CHANGED) {
Ref<DynamicFont> df_output_code = get_theme_font("output_source", "EditorFonts");
if (df_output_code.is_valid()) {
if (log != nullptr) {
log->add_theme_font_override("normal_font", get_theme_font("output_source", "EditorFonts"));
+ log->add_theme_color_override("selection_color", get_theme_color("accent_color", "Editor") * Color(1, 1, 1, 0.4));
}
}
}
diff --git a/editor/icons/ErrorWarning.svg b/editor/icons/ErrorWarning.svg
new file mode 100644
index 0000000000..72b5037e50
--- /dev/null
+++ b/editor/icons/ErrorWarning.svg
@@ -0,0 +1 @@
+<svg height="8" viewBox="0 0 8 8" width="8" xmlns="http://www.w3.org/2000/svg"><path d="m4 0c-2.216 0-4 1.784-4 4s1.784 4 4 4z" fill="#ff5d5d"/><path d="m4 .00000003c2.216 0 4 1.78399997 4 3.99999997s-1.784 4-4 4z" fill="#ffdd65"/></svg> \ No newline at end of file
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 5ee5fbcf9c..6e00e3c291 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -97,8 +97,8 @@ void SceneTreeDock::_unhandled_key_input(Ref<InputEvent> p_event) {
_tool_selected(TOOL_DUPLICATE);
} else if (ED_IS_SHORTCUT("scene_tree/attach_script", p_event)) {
_tool_selected(TOOL_ATTACH_SCRIPT);
- } else if (ED_IS_SHORTCUT("scene_tree/clear_script", p_event)) {
- _tool_selected(TOOL_CLEAR_SCRIPT);
+ } else if (ED_IS_SHORTCUT("scene_tree/detach_script", p_event)) {
+ _tool_selected(TOOL_DETACH_SCRIPT);
} else if (ED_IS_SHORTCUT("scene_tree/move_up", p_event)) {
_tool_selected(TOOL_MOVE_UP);
} else if (ED_IS_SHORTCUT("scene_tree/move_down", p_event)) {
@@ -426,7 +426,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
case TOOL_ATTACH_SCRIPT: {
attach_script_to_selected(false);
} break;
- case TOOL_CLEAR_SCRIPT: {
+ case TOOL_DETACH_SCRIPT: {
if (!profile_allow_script_editing) {
break;
@@ -437,7 +437,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
if (selection.empty())
return;
- editor_data->get_undo_redo().create_action(TTR("Clear Script"));
+ editor_data->get_undo_redo().create_action(TTR("Detach Script"));
editor_data->get_undo_redo().add_do_method(editor, "push_item", (Script *)nullptr);
for (int i = 0; i < selection.size(); i++) {
@@ -1071,7 +1071,7 @@ void SceneTreeDock::_notification(int p_what) {
button_add->set_icon(get_theme_icon("Add", "EditorIcons"));
button_instance->set_icon(get_theme_icon("Instance", "EditorIcons"));
button_create_script->set_icon(get_theme_icon("ScriptCreate", "EditorIcons"));
- button_clear_script->set_icon(get_theme_icon("ScriptRemove", "EditorIcons"));
+ button_detach_script->set_icon(get_theme_icon("ScriptRemove", "EditorIcons"));
filter->set_right_icon(get_theme_icon("Search", "EditorIcons"));
filter->set_clear_button_enabled(true);
@@ -1148,7 +1148,7 @@ void SceneTreeDock::_notification(int p_what) {
button_add->set_icon(get_theme_icon("Add", "EditorIcons"));
button_instance->set_icon(get_theme_icon("Instance", "EditorIcons"));
button_create_script->set_icon(get_theme_icon("ScriptCreate", "EditorIcons"));
- button_clear_script->set_icon(get_theme_icon("ScriptRemove", "EditorIcons"));
+ button_detach_script->set_icon(get_theme_icon("ScriptRemove", "EditorIcons"));
filter->set_right_icon(get_theme_icon("Search", "EditorIcons"));
filter->set_clear_button_enabled(true);
@@ -1883,18 +1883,18 @@ void SceneTreeDock::_update_script_button() {
if (!profile_allow_script_editing) {
button_create_script->hide();
- button_clear_script->hide();
+ button_detach_script->hide();
} else if (EditorNode::get_singleton()->get_editor_selection()->get_selection().size() == 0) {
button_create_script->hide();
- button_clear_script->hide();
+ button_detach_script->hide();
} else if (EditorNode::get_singleton()->get_editor_selection()->get_selection().size() == 1) {
Node *n = EditorNode::get_singleton()->get_editor_selection()->get_selected_node_list()[0];
if (n->get_script().is_null()) {
button_create_script->show();
- button_clear_script->hide();
+ button_detach_script->hide();
} else {
button_create_script->hide();
- button_clear_script->show();
+ button_detach_script->show();
}
} else {
button_create_script->hide();
@@ -1902,11 +1902,11 @@ void SceneTreeDock::_update_script_button() {
for (int i = 0; i < selection.size(); i++) {
Node *n = Object::cast_to<Node>(selection[i]);
if (!n->get_script().is_null()) {
- button_clear_script->show();
+ button_detach_script->show();
return;
}
}
- button_clear_script->hide();
+ button_detach_script->hide();
}
}
@@ -2458,7 +2458,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
}
if (existing_script.is_valid() && existing_script_removable) {
add_separator = true;
- menu->add_icon_shortcut(get_theme_icon("ScriptRemove", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/clear_script"), TOOL_CLEAR_SCRIPT);
+ menu->add_icon_shortcut(get_theme_icon("ScriptRemove", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/detach_script"), TOOL_DETACH_SCRIPT);
} else if (full_selection.size() > 1) {
bool script_exists = false;
for (List<Node *>::Element *E = full_selection.front(); E; E = E->next()) {
@@ -2470,7 +2470,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
if (script_exists) {
add_separator = true;
- menu->add_icon_shortcut(get_theme_icon("ScriptRemove", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/clear_script"), TOOL_CLEAR_SCRIPT);
+ menu->add_icon_shortcut(get_theme_icon("ScriptRemove", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/detach_script"), TOOL_DETACH_SCRIPT);
}
}
@@ -2816,7 +2816,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel
ED_SHORTCUT("scene_tree/change_node_type", TTR("Change Type"));
ED_SHORTCUT("scene_tree/attach_script", TTR("Attach Script"));
ED_SHORTCUT("scene_tree/extend_script", TTR("Extend Script"));
- ED_SHORTCUT("scene_tree/clear_script", TTR("Clear Script"));
+ ED_SHORTCUT("scene_tree/detach_script", TTR("Detach Script"));
ED_SHORTCUT("scene_tree/move_up", TTR("Move Up"), KEY_MASK_CMD | KEY_UP);
ED_SHORTCUT("scene_tree/move_down", TTR("Move Down"), KEY_MASK_CMD | KEY_DOWN);
ED_SHORTCUT("scene_tree/duplicate", TTR("Duplicate"), KEY_MASK_CMD | KEY_D);
@@ -2851,17 +2851,17 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel
button_create_script = memnew(ToolButton);
button_create_script->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected), make_binds(TOOL_ATTACH_SCRIPT, false));
- button_create_script->set_tooltip(TTR("Attach a new or existing script for the selected node."));
+ button_create_script->set_tooltip(TTR("Attach a new or existing script to the selected node."));
button_create_script->set_shortcut(ED_GET_SHORTCUT("scene_tree/attach_script"));
filter_hbc->add_child(button_create_script);
button_create_script->hide();
- button_clear_script = memnew(ToolButton);
- button_clear_script->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected), make_binds(TOOL_CLEAR_SCRIPT, false));
- button_clear_script->set_tooltip(TTR("Clear a script for the selected node."));
- button_clear_script->set_shortcut(ED_GET_SHORTCUT("scene_tree/clear_script"));
- filter_hbc->add_child(button_clear_script);
- button_clear_script->hide();
+ button_detach_script = memnew(ToolButton);
+ button_detach_script->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected), make_binds(TOOL_DETACH_SCRIPT, false));
+ button_detach_script->set_tooltip(TTR("Detach the script from the selected node."));
+ button_detach_script->set_shortcut(ED_GET_SHORTCUT("scene_tree/detach_script"));
+ filter_hbc->add_child(button_detach_script);
+ button_detach_script->hide();
button_hb = memnew(HBoxContainer);
vbc->add_child(button_hb);
diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h
index 31ef1ce7d0..00b95c9853 100644
--- a/editor/scene_tree_dock.h
+++ b/editor/scene_tree_dock.h
@@ -66,7 +66,7 @@ class SceneTreeDock : public VBoxContainer {
TOOL_REPLACE,
TOOL_EXTEND_SCRIPT,
TOOL_ATTACH_SCRIPT,
- TOOL_CLEAR_SCRIPT,
+ TOOL_DETACH_SCRIPT,
TOOL_MOVE_UP,
TOOL_MOVE_DOWN,
TOOL_DUPLICATE,
@@ -110,7 +110,7 @@ class SceneTreeDock : public VBoxContainer {
ToolButton *button_add;
ToolButton *button_instance;
ToolButton *button_create_script;
- ToolButton *button_clear_script;
+ ToolButton *button_detach_script;
Button *button_3d;