diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index f6eea296c041..bdfecfff10dc 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -171,6 +171,7 @@ void editor_register_and_generate_icons(Ref p_theme, bool dark_theme = tr } bool force_filter = !(p_thumb_size == 64 && p_thumb_size == 32); // we dont need filter with original resolution + // generate thumb files with the given thumb size if (p_thumb_size >= 64) { float scale = (float)p_thumb_size / 64.0 * EDSCALE; for (int i = 0; i < editor_bg_thumbs_count; i++) { @@ -350,7 +351,8 @@ Ref create_editor_theme(const Ref p_theme) { style_popup->set_default_margin(MARGIN_BOTTOM, default_margin_size * 2); style_popup->set_border_color_all(contrast_color_1); style_popup->set_border_width_all(MAX(EDSCALE, border_width)); - style_popup->set_shadow_color(Color(0, 0, 0, dark_theme ? 0.3 : 0.1)); + const Color shadow_color = Color(0, 0, 0, dark_theme ? 0.3 : 0.1); + style_popup->set_shadow_color(shadow_color); style_popup->set_shadow_size(4 * EDSCALE); Ref style_empty = make_empty_stylebox(default_margin_size, default_margin_size, default_margin_size, default_margin_size); @@ -738,7 +740,9 @@ Ref create_editor_theme(const Ref p_theme) { graphsb->set_border_width(MARGIN_TOP, 22 * EDSCALE + border_width); Ref graphsbselected = make_flat_stylebox(Color(0, 0, 0, 0.4), 16, 24, 16, 5); graphsbselected->set_border_width_all(border_width); - graphsbselected->set_border_color_all(Color(1, 1, 1, 0.9)); + graphsbselected->set_border_color_all(Color(accent_color.r, accent_color.g, accent_color.b, 0.9)); + graphsbselected->set_shadow_size(8 * EDSCALE); + graphsbselected->set_shadow_color(shadow_color); graphsbselected->set_border_width(MARGIN_TOP, 22 * EDSCALE + border_width); Ref graphsbcomment = make_flat_stylebox(Color(0, 0, 0, 0.3), 16, 24, 16, 5); graphsbcomment->set_border_width_all(border_width); diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 696a732d3da5..d415618383b9 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -491,9 +491,8 @@ void VisualScriptEditor::_update_graph(int p_only_id) { gnode->set_overlay(GraphNode::OVERLAY_BREAKPOINT); } - if (EditorSettings::get_singleton()->has("editors/visual_script/color_" + node->get_category())) { - Color c = EditorSettings::get_singleton()->get("editors/visual_script/color_" + node->get_category()); - gnode->set_self_modulate(c); + if (node_styles.has(node->get_category())) { + gnode->add_style_override("frame", node_styles[node->get_category()]); } gnode->set_meta("__vnode", node); @@ -2743,6 +2742,27 @@ void VisualScriptEditor::_notification(int p_what) { node_filter->add_icon_override("right_icon", Control::get_icon("Search", "EditorIcons")); variable_editor->connect("changed", this, "_update_members"); signal_editor->connect("changed", this, "_update_members"); + + List > colors; + colors.push_back(Pair("functions", Color(1, 0.9, 0.9))); + colors.push_back(Pair("data", Color(0.9, 1.0, 0.9))); + colors.push_back(Pair("operators", Color(0.9, 0.9, 1.0))); + colors.push_back(Pair("flow_control", Color(1.0, 1.0, 1.0))); + colors.push_back(Pair("custom", Color(0.8, 1.0, 1.0))); + colors.push_back(Pair("constants", Color(1.0, 0.8, 1.0))); + + for (List >::Element *E = colors.front(); E; E = E->next()) { + print_line(E->get().first); + Ref sb = EditorNode::get_singleton()->get_theme_base()->get_theme()->get_stylebox("frame", "GraphNode"); + if (sb != NULL) { + Ref frame_style = sb->duplicate(); + Color c = sb->get_border_color(MARGIN_TOP); + Color cn = E->get().second; + cn.a = c.a; + frame_style->set_border_color_all(cn); + node_styles[E->get().first] = frame_style; + } + } } if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { left_vsplit->set_visible(is_visible_in_tree()); @@ -3366,12 +3386,6 @@ void VisualScriptEditor::free_clipboard() { static void register_editor_callback() { ScriptEditor::register_create_script_editor_function(create_editor); - EditorSettings::get_singleton()->set("editors/visual_script/color_functions", Color(1, 0.9, 0.9)); - EditorSettings::get_singleton()->set("editors/visual_script/color_data", Color(0.9, 1.0, 0.9)); - EditorSettings::get_singleton()->set("editors/visual_script/color_operators", Color(0.9, 0.9, 1.0)); - EditorSettings::get_singleton()->set("editors/visual_script/color_flow_control", Color(1.0, 1.0, 1.0)); - EditorSettings::get_singleton()->set("editors/visual_script/color_custom", Color(0.8, 1.0, 1.0)); - EditorSettings::get_singleton()->set("editors/visual_script/color_constants", Color(1.0, 0.8, 1.0)); ED_SHORTCUT("visual_script_editor/delete_selected", TTR("Delete Selected")); ED_SHORTCUT("visual_script_editor/toggle_breakpoint", TTR("Toggle Breakpoint"), KEY_F9); diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h index 5b8c3ea74ef3..db54d10300fc 100644 --- a/modules/visual_script/visual_script_editor.h +++ b/modules/visual_script/visual_script_editor.h @@ -136,6 +136,7 @@ class VisualScriptEditor : public ScriptEditorBase { Vector > args; }; + HashMap, StringNameHasher> node_styles; StringName edited_func; void _update_graph_connections();