diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/action_map_editor.cpp | 46 | ||||
-rw-r--r-- | editor/action_map_editor.h | 10 | ||||
-rw-r--r-- | editor/editor_log.cpp | 61 | ||||
-rw-r--r-- | editor/editor_log.h | 18 | ||||
-rw-r--r-- | editor/editor_node.cpp | 4 | ||||
-rw-r--r-- | editor/editor_run.cpp | 45 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 1 | ||||
-rw-r--r-- | editor/editor_themes.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/editor_preview_plugins.cpp | 20 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 7 | ||||
-rw-r--r-- | editor/plugins/shader_editor_plugin.cpp | 7 | ||||
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 14 | ||||
-rw-r--r-- | editor/project_settings_editor.cpp | 2 |
13 files changed, 176 insertions, 61 deletions
diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index 9949fd8199..c0d5716c4e 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -730,10 +730,6 @@ void ActionMapEditor::_add_action_pressed() { } void ActionMapEditor::_add_action(const String &p_name) { - if (!allow_editing_actions) { - return; - } - if (p_name == "" || !_is_action_name_valid(p_name)) { show_message(TTR("Invalid action name. it cannot be.is_empty()() nor contain '/', ':', '=', '\\' or '\"'")); return; @@ -744,10 +740,6 @@ void ActionMapEditor::_add_action(const String &p_name) { } void ActionMapEditor::_action_edited() { - if (!allow_editing_actions) { - return; - } - TreeItem *ti = action_tree->get_edited(); if (!ti) { return; @@ -812,10 +804,6 @@ void ActionMapEditor::_tree_button_pressed(Object *p_item, int p_column, int p_i } break; case ActionMapEditor::BUTTON_REMOVE_ACTION: { - if (!allow_editing_actions) { - break; - } - // Send removed action name String name = item->get_meta("__name"); emit_signal("action_removed", name); @@ -848,11 +836,11 @@ void ActionMapEditor::_tree_item_activated() { _tree_button_pressed(item, 2, BUTTON_EDIT_EVENT); } -void ActionMapEditor::set_show_uneditable(bool p_show) { - show_uneditable = p_show; - show_uneditable_actions_checkbox->set_pressed(p_show); +void ActionMapEditor::set_show_builtin_actions(bool p_show) { + show_builtin_actions = p_show; + show_builtin_actions_checkbutton->set_pressed(p_show); - // Prevent unnecessary updates of action list when cache is.is_empty()(). + // Prevent unnecessary updates of action list when cache is empty. if (!actions_cache.is_empty()) { update_action_list(); } @@ -1022,7 +1010,7 @@ void ActionMapEditor::update_action_list(const Vector<ActionInfo> &p_action_info continue; } - if (!action_info.editable && !show_uneditable) { + if (!action_info.editable && !show_builtin_actions) { continue; } @@ -1080,15 +1068,6 @@ void ActionMapEditor::show_message(const String &p_message) { message->popup_centered(Size2(300, 100) * EDSCALE); } -void ActionMapEditor::set_allow_editing_actions(bool p_allow) { - allow_editing_actions = p_allow; - add_hbox->set_visible(p_allow); -} - -void ActionMapEditor::set_toggle_editable_label(const String &p_label) { - show_uneditable_actions_checkbox->set_text(p_label); -} - void ActionMapEditor::use_external_search_box(LineEdit *p_searchbox) { memdelete(action_list_search); action_list_search = p_searchbox; @@ -1096,8 +1075,7 @@ void ActionMapEditor::use_external_search_box(LineEdit *p_searchbox) { } ActionMapEditor::ActionMapEditor() { - allow_editing_actions = true; - show_uneditable = true; + show_builtin_actions = false; // Main Vbox Container VBoxContainer *main_vbox = memnew(VBoxContainer); @@ -1114,11 +1092,11 @@ ActionMapEditor::ActionMapEditor() { action_list_search->connect("text_changed", callable_mp(this, &ActionMapEditor::_search_term_updated)); top_hbox->add_child(action_list_search); - show_uneditable_actions_checkbox = memnew(CheckBox); - show_uneditable_actions_checkbox->set_pressed(false); - show_uneditable_actions_checkbox->set_text(TTR("Show Uneditable Actions")); - show_uneditable_actions_checkbox->connect("toggled", callable_mp(this, &ActionMapEditor::set_show_uneditable)); - top_hbox->add_child(show_uneditable_actions_checkbox); + show_builtin_actions_checkbutton = memnew(CheckButton); + show_builtin_actions_checkbutton->set_pressed(false); + show_builtin_actions_checkbutton->set_text(TTR("Show Built-in Actions")); + show_builtin_actions_checkbutton->connect("toggled", callable_mp(this, &ActionMapEditor::set_show_builtin_actions)); + top_hbox->add_child(show_builtin_actions_checkbutton); // Adding Action line edit + button add_hbox = memnew(HBoxContainer); @@ -1132,7 +1110,7 @@ ActionMapEditor::ActionMapEditor() { add_hbox->add_child(add_edit); Button *add_button = memnew(Button); - add_button->set_text("Add"); + add_button->set_text(TTR("Add")); add_button->connect("pressed", callable_mp(this, &ActionMapEditor::_add_action_pressed)); add_hbox->add_child(add_button); diff --git a/editor/action_map_editor.h b/editor/action_map_editor.h index f1f7bffef4..fb097ddfdd 100644 --- a/editor/action_map_editor.h +++ b/editor/action_map_editor.h @@ -156,11 +156,10 @@ private: // Filtering and Adding actions - bool show_uneditable; - CheckBox *show_uneditable_actions_checkbox; + bool show_builtin_actions; + CheckButton *show_builtin_actions_checkbutton; LineEdit *action_list_search; - bool allow_editing_actions; HBoxContainer *add_hbox; LineEdit *add_edit; @@ -190,10 +189,7 @@ public: void update_action_list(const Vector<ActionInfo> &p_action_infos = Vector<ActionInfo>()); void show_message(const String &p_message); - void set_show_uneditable(bool p_show); - void set_allow_editing_actions(bool p_allow); - - void set_toggle_editable_label(const String &p_label); + void set_show_builtin_actions(bool p_show); void use_external_search_box(LineEdit *p_searchbox); diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 602035634a..7c485d53c5 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -75,6 +75,8 @@ void EditorLog::_notification(int p_what) { collapse_button->set_icon(get_theme_icon("CombineLines", "EditorIcons")); show_search_button->set_icon(get_theme_icon("Search", "EditorIcons")); + _load_state(); + } else if (p_what == NOTIFICATION_THEME_CHANGED) { Ref<Font> df_output_code = get_theme_font("output_source", "EditorFonts"); if (df_output_code.is_valid()) { @@ -89,9 +91,56 @@ void EditorLog::_notification(int p_what) { void EditorLog::_set_collapse(bool p_collapse) { collapse = p_collapse; + _start_state_save_timer(); _rebuild_log(); } +void EditorLog::_start_state_save_timer() { + if (!is_loading_state) { + save_state_timer->start(); + } +} + +void EditorLog::_save_state() { + Ref<ConfigFile> config; + config.instance(); + // Load and amend existing config if it exists. + config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg")); + + const String section = "editor_log"; + for (Map<MessageType, LogFilter *>::Element *E = type_filter_map.front(); E; E = E->next()) { + config->set_value(section, "log_filter_" + itos(E->key()), E->get()->is_active()); + } + + config->set_value(section, "collapse", collapse); + config->set_value(section, "show_search", search_box->is_visible()); + + config->save(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg")); +} + +void EditorLog::_load_state() { + is_loading_state = true; + + Ref<ConfigFile> config; + config.instance(); + Error err = config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg")); + + if (err == OK) { + const String section = "editor_log"; + for (Map<MessageType, LogFilter *>::Element *E = type_filter_map.front(); E; E = E->next()) { + E->get()->set_active(config->get_value(section, "log_filter_" + itos(E->key()), false)); + } + + collapse = config->get_value(section, "collapse", false); + collapse_button->set_pressed(collapse); + bool show_search = config->get_value(section, "show_search", true); + search_box->set_visible(show_search); + show_search_button->set_pressed(show_search); + } + + is_loading_state = false; +} + void EditorLog::_clear_request() { log->clear(); messages.clear(); @@ -175,7 +224,7 @@ void EditorLog::_rebuild_log() { void EditorLog::_add_log_line(LogMessage &p_message, bool p_replace_previous) { // Only add the message to the log if it passes the filters. - bool filter_active = type_filter_map[p_message.type]->active; + bool filter_active = type_filter_map[p_message.type]->is_active(); String search_text = search_box->get_text(); bool search_match = search_text == String() || p_message.text.findn(search_text) > -1; @@ -230,7 +279,8 @@ void EditorLog::_add_log_line(LogMessage &p_message, bool p_replace_previous) { } void EditorLog::_set_filter_active(bool p_active, MessageType p_message_type) { - type_filter_map[p_message_type]->active = p_active; + type_filter_map[p_message_type]->set_active(p_active); + _start_state_save_timer(); _rebuild_log(); } @@ -239,6 +289,7 @@ void EditorLog::_set_search_visible(bool p_visible) { if (p_visible) { search_box->grab_focus(); } + _start_state_save_timer(); } void EditorLog::_search_changed(const String &p_text) { @@ -257,6 +308,12 @@ void EditorLog::_bind_methods() { } EditorLog::EditorLog() { + save_state_timer = memnew(Timer); + save_state_timer->set_wait_time(2); + save_state_timer->set_one_shot(true); + save_state_timer->connect("timeout", callable_mp(this, &EditorLog::_save_state)); + add_child(save_state_timer); + HBoxContainer *hb = this; VBoxContainer *vb_left = memnew(VBoxContainer); diff --git a/editor/editor_log.h b/editor/editor_log.h index 89d00d0fa0..3b6476634a 100644 --- a/editor/editor_log.h +++ b/editor/editor_log.h @@ -72,11 +72,11 @@ private: private: // Force usage of set method since it has functionality built-in. int message_count = 0; + bool active = true; public: MessageType type; Button *toggle_button = nullptr; - bool active = true; void initialize_button(const String &p_tooltip, Callable p_toggled_callback) { toggle_button = memnew(Button); @@ -100,6 +100,15 @@ private: toggle_button->set_text(itos(message_count)); } + bool is_active() { + return active; + } + + void set_active(bool p_active) { + toggle_button->set_pressed(p_active); + active = p_active; + } + LogFilter(MessageType p_type) : type(p_type) { } @@ -124,6 +133,9 @@ private: // Warnings or Errors are encounetered. Button *tool_button; + bool is_loading_state = false; // Used to disable saving requests while loading (some signals from buttons will try trigger a save, which happens during loading). + Timer *save_state_timer; + static void _error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, ErrorHandlerType p_type); ErrorHandlerList eh; @@ -147,6 +159,10 @@ private: void _set_collapse(bool p_collapse); + void _start_state_save_timer(); + void _save_state(); + void _load_state(); + protected: static void _bind_methods(); void _notification(int p_what); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index ed670b1296..6390755656 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4362,6 +4362,8 @@ void EditorNode::_save_docks() { } Ref<ConfigFile> config; config.instance(); + // Load and amend existing config if it exists. + config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg")); _save_docks_to_config(config, "docks"); _save_open_scenes_to_config(config, "EditorNode"); @@ -5877,8 +5879,6 @@ EditorNode::EditorNode() { register_exporters(); - GLOBAL_DEF("editor/run/main_run_args", ""); - ClassDB::set_class_enabled("RootMotionView", true); //defs here, use EDITOR_GET in logic diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp index e46f4eb65a..5e6d2ab69c 100644 --- a/editor/editor_run.cpp +++ b/editor/editor_run.cpp @@ -183,15 +183,50 @@ Error EditorRun::run(const String &p_scene, const String &p_custom_args, const L args.push_back(p_scene); } + String exec = OS::get_singleton()->get_executable_path(); + if (p_custom_args != "") { - Vector<String> cargs = p_custom_args.split(" ", false); - for (int i = 0; i < cargs.size(); i++) { - args.push_back(cargs[i].replace(" ", "%20")); + // Allow the user to specify a command to run, similar to Steam's launch options. + // In this case, Godot will no longer be run directly; it's up to the underlying command + // to run it. For instance, this can be used on Linux to force a running project + // to use Optimus using `prime-run` or similar. + // Example: `prime-run %command% --time-scale 0.5` + const int placeholder_pos = p_custom_args.find("%command%"); + + Vector<String> custom_args; + + if (placeholder_pos != -1) { + // Prepend executable-specific custom arguments. + // If nothing is placed before `%command%`, behave as if no placeholder was specified. + Vector<String> exec_args = p_custom_args.substr(0, placeholder_pos).split(" ", false); + if (exec_args.size() >= 1) { + exec = exec_args[0]; + exec_args.remove(0); + + // Append the Godot executable name before we append executable arguments + // (since the order is reversed when using `push_front()`). + args.push_front(OS::get_singleton()->get_executable_path()); + } + + for (int i = exec_args.size() - 1; i >= 0; i--) { + // Iterate backwards as we're pushing items in the reverse order. + args.push_front(exec_args[i].replace(" ", "%20")); + } + + // Append Godot-specific custom arguments. + custom_args = p_custom_args.substr(placeholder_pos + String("%command%").size()).split(" ", false); + for (int i = 0; i < custom_args.size(); i++) { + args.push_back(custom_args[i].replace(" ", "%20")); + } + } else { + // Append Godot-specific custom arguments. + custom_args = p_custom_args.split(" ", false); + for (int i = 0; i < custom_args.size(); i++) { + args.push_back(custom_args[i].replace(" ", "%20")); + } } } - String exec = OS::get_singleton()->get_executable_path(); - printf("Running: %s", exec.utf8().get_data()); for (List<String>::Element *E = args.front(); E; E = E->next()) { printf(" %s", E->get().utf8().get_data()); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 7e450ed5fc..1bb40c50b8 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -787,6 +787,7 @@ void EditorSettings::_load_default_text_editor_theme() { _initial_set("text_editor/highlighting/symbol_color", Color(0.73, 0.87, 1.0)); _initial_set("text_editor/highlighting/keyword_color", Color(1.0, 1.0, 0.7)); + _initial_set("text_editor/highlighting/control_flow_keyword_color", Color(1.0, 0.85, 0.7)); _initial_set("text_editor/highlighting/base_type_color", Color(0.64, 1.0, 0.83)); _initial_set("text_editor/highlighting/engine_type_color", Color(0.51, 0.83, 1.0)); _initial_set("text_editor/highlighting/user_type_color", Color(0.42, 0.67, 0.93)); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 44b4a9f688..d5ad638436 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -1322,6 +1322,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { const Color symbol_color = Color(0.34, 0.57, 1.0).lerp(mono_color, dark_theme ? 0.5 : 0.3); const Color keyword_color = Color(1.0, 0.44, 0.52); + const Color control_flow_keyword_color = dark_theme ? Color(1.0, 0.55, 0.8) : Color(0.8, 0.4, 0.6); const Color basetype_color = dark_theme ? Color(0.26, 1.0, 0.76) : Color(0.0, 0.76, 0.38); const Color type_color = basetype_color.lerp(mono_color, dark_theme ? 0.4 : 0.3); const Color usertype_color = basetype_color.lerp(mono_color, dark_theme ? 0.7 : 0.5); @@ -1360,6 +1361,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { if (text_editor_color_theme == "Adaptive") { setting->set_initial_value("text_editor/highlighting/symbol_color", symbol_color, true); setting->set_initial_value("text_editor/highlighting/keyword_color", keyword_color, true); + setting->set_initial_value("text_editor/highlighting/control_flow_keyword_color", control_flow_keyword_color, true); setting->set_initial_value("text_editor/highlighting/base_type_color", basetype_color, true); setting->set_initial_value("text_editor/highlighting/engine_type_color", type_color, true); setting->set_initial_value("text_editor/highlighting/user_type_color", usertype_color, true); diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index a319a595c7..18cc5d43fb 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -487,10 +487,15 @@ Ref<Texture2D> EditorScriptPreviewPlugin::generate(const RES &p_from, const Size List<String> kwors; scr->get_language()->get_reserved_words(&kwors); + Set<String> control_flow_keywords; Set<String> keywords; for (List<String>::Element *E = kwors.front(); E; E = E->next()) { - keywords.insert(E->get()); + if (scr->get_language()->is_control_flow_keyword(E->get())) { + control_flow_keywords.insert(E->get()); + } else { + keywords.insert(E->get()); + } } int line = 0; @@ -502,6 +507,7 @@ Ref<Texture2D> EditorScriptPreviewPlugin::generate(const RES &p_from, const Size Color bg_color = EditorSettings::get_singleton()->get("text_editor/highlighting/background_color"); Color keyword_color = EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"); + Color control_flow_keyword_color = EditorSettings::get_singleton()->get("text_editor/highlighting/control_flow_keyword_color"); Color text_color = EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"); Color symbol_color = EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"); Color comment_color = EditorSettings::get_singleton()->get("text_editor/highlighting/comment_color"); @@ -523,6 +529,7 @@ Ref<Texture2D> EditorScriptPreviewPlugin::generate(const RES &p_from, const Size col = x0; bool prev_is_text = false; + bool in_control_flow_keyword = false; bool in_keyword = false; bool in_comment = false; for (int i = 0; i < code.length(); i++) { @@ -541,6 +548,7 @@ Ref<Texture2D> EditorScriptPreviewPlugin::generate(const RES &p_from, const Size if (c != '_' && ((c >= '!' && c <= '/') || (c >= ':' && c <= '@') || (c >= '[' && c <= '`') || (c >= '{' && c <= '~') || c == '\t')) { //make symbol a little visible color = symbol_color; + in_control_flow_keyword = false; in_keyword = false; } else if (!prev_is_text && _is_text_char(c)) { int pos = i; @@ -549,7 +557,9 @@ Ref<Texture2D> EditorScriptPreviewPlugin::generate(const RES &p_from, const Size pos++; } String word = code.substr(i, pos - i); - if (keywords.has(word)) { + if (control_flow_keywords.has(word)) { + in_control_flow_keyword = true; + } else if (keywords.has(word)) { in_keyword = true; } @@ -557,11 +567,12 @@ Ref<Texture2D> EditorScriptPreviewPlugin::generate(const RES &p_from, const Size in_keyword = false; } - if (in_keyword) { + if (in_control_flow_keyword) { + color = control_flow_keyword_color; + } else if (in_keyword) { color = keyword_color; } } - Color ul = color; ul.a *= 0.5; img->set_pixel(col, y0 + line * 2, bg_color.blend(ul)); @@ -572,6 +583,7 @@ Ref<Texture2D> EditorScriptPreviewPlugin::generate(const RES &p_from, const Size col++; } else { prev_is_text = false; + in_control_flow_keyword = false; in_keyword = false; if (c == '\n') { diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index bc33d03d8b..adfeead33b 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -140,10 +140,15 @@ void EditorStandardSyntaxHighlighter::_update_cache() { /* Reserved words. */ const Color keyword_color = EDITOR_GET("text_editor/highlighting/keyword_color"); + const Color control_flow_keyword_color = EDITOR_GET("text_editor/highlighting/control_flow_keyword_color"); List<String> keywords; script->get_language()->get_reserved_words(&keywords); for (List<String>::Element *E = keywords.front(); E; E = E->next()) { - highlighter->add_keyword_color(E->get(), keyword_color); + if (script->get_language()->is_control_flow_keyword(E->get())) { + highlighter->add_keyword_color(E->get(), control_flow_keyword_color); + } else { + highlighter->add_keyword_color(E->get(), keyword_color); + } } /* Member types. */ diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index ed3b746678..3cdba9cf16 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -141,9 +141,14 @@ void ShaderTextEditor::_load_theme_settings() { List<String> keywords; ShaderLanguage::get_keyword_list(&keywords); const Color keyword_color = EDITOR_GET("text_editor/highlighting/keyword_color"); + const Color control_flow_keyword_color = EDITOR_GET("text_editor/highlighting/control_flow_keyword_color"); for (List<String>::Element *E = keywords.front(); E; E = E->next()) { - syntax_highlighter->add_keyword_color(E->get(), keyword_color); + if (ShaderLanguage::is_control_flow_keyword(E->get())) { + syntax_highlighter->add_keyword_color(E->get(), control_flow_keyword_color); + } else { + syntax_highlighter->add_keyword_color(E->get(), keyword_color); + } } // Colorize built-ins like `COLOR` differently to make them easier diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 7d5e72ff8e..1d4c23fee6 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -736,6 +736,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) { Color background_color = EDITOR_GET("text_editor/highlighting/background_color"); Color text_color = EDITOR_GET("text_editor/highlighting/text_color"); Color keyword_color = EDITOR_GET("text_editor/highlighting/keyword_color"); + Color control_flow_keyword_color = EDITOR_GET("text_editor/highlighting/control_flow_keyword_color"); Color comment_color = EDITOR_GET("text_editor/highlighting/comment_color"); Color symbol_color = EDITOR_GET("text_editor/highlighting/symbol_color"); Color function_color = EDITOR_GET("text_editor/highlighting/function_color"); @@ -746,7 +747,11 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) { expression_box->add_theme_color_override("background_color", background_color); for (List<String>::Element *E = VisualShaderEditor::get_singleton()->keyword_list.front(); E; E = E->next()) { - expression_syntax_highlighter->add_keyword_color(E->get(), keyword_color); + if (ShaderLanguage::is_control_flow_keyword(E->get())) { + expression_syntax_highlighter->add_keyword_color(E->get(), control_flow_keyword_color); + } else { + expression_syntax_highlighter->add_keyword_color(E->get(), keyword_color); + } } expression_box->add_theme_font_override("font", VisualShaderEditor::get_singleton()->get_theme_font("expression", "EditorFonts")); @@ -2792,6 +2797,7 @@ void VisualShaderEditor::_notification(int p_what) { Color background_color = EDITOR_GET("text_editor/highlighting/background_color"); Color text_color = EDITOR_GET("text_editor/highlighting/text_color"); Color keyword_color = EDITOR_GET("text_editor/highlighting/keyword_color"); + Color control_flow_keyword_color = EDITOR_GET("text_editor/highlighting/control_flow_keyword_color"); Color comment_color = EDITOR_GET("text_editor/highlighting/comment_color"); Color symbol_color = EDITOR_GET("text_editor/highlighting/symbol_color"); Color function_color = EDITOR_GET("text_editor/highlighting/function_color"); @@ -2801,7 +2807,11 @@ void VisualShaderEditor::_notification(int p_what) { preview_text->add_theme_color_override("background_color", background_color); for (List<String>::Element *E = keyword_list.front(); E; E = E->next()) { - syntax_highlighter->add_keyword_color(E->get(), keyword_color); + if (ShaderLanguage::is_control_flow_keyword(E->get())) { + syntax_highlighter->add_keyword_color(E->get(), control_flow_keyword_color); + } else { + syntax_highlighter->add_keyword_color(E->get(), keyword_color); + } } preview_text->add_theme_font_override("font", get_theme_font("expression", "EditorFonts")); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index faec3355ac..76290b4b62 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -649,8 +649,6 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { action_map->connect("action_removed", callable_mp(this, &ProjectSettingsEditor::_action_removed)); action_map->connect("action_renamed", callable_mp(this, &ProjectSettingsEditor::_action_renamed)); action_map->connect("action_reordered", callable_mp(this, &ProjectSettingsEditor::_action_reordered)); - action_map->set_toggle_editable_label(TTR("Show Built-in Actions")); - action_map->set_show_uneditable(false); tab_container->add_child(action_map); localization_editor = memnew(LocalizationEditor); |