summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
authorThaddeus Crews <repiteo@outlook.com>2024-11-12 09:27:39 -0600
committerThaddeus Crews <repiteo@outlook.com>2024-11-12 09:27:39 -0600
commit04f33894f541953a077504be6719ddfd1be779f4 (patch)
treefdbd78764a89b04ee635d8f4b560a3542b02813f /editor
parentda094b031275555d83d72ccc89a65c2f3fe766e3 (diff)
parentf168d0c80ff912707a1cb15f8791097ef5228350 (diff)
downloadredot-engine-04f33894f541953a077504be6719ddfd1be779f4.tar.gz
Merge pull request #97041 from aXu-AP/script-highlight-scene
Highlight scripts used by current scene
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_settings.cpp1
-rw-r--r--editor/plugins/script_editor_plugin.cpp6
2 files changed, 3 insertions, 4 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 44690f81f0..b0d1c3e6bb 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -715,6 +715,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("text_editor/script_list/sort_members_outline_alphabetically", false, true);
_initial_set("text_editor/script_list/script_temperature_enabled", true);
_initial_set("text_editor/script_list/script_temperature_history_size", 15);
+ _initial_set("text_editor/script_list/highlight_scene_scripts", true);
_initial_set("text_editor/script_list/group_help_pages", true);
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "text_editor/script_list/sort_scripts_by", 0, "Name,Path,None");
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "text_editor/script_list/list_script_names_as", 0, "Name,Parent Directory And Name,Full Path");
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 2edc096382..8c3979918d 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -2185,8 +2185,6 @@ void ScriptEditor::_update_script_colors() {
continue;
}
- script_list->set_item_custom_bg_color(i, Color(0, 0, 0, 0));
-
if (script_temperature_enabled) {
int pass = n->get_meta("__editor_pass", -1);
if (pass < 0) {
@@ -2212,7 +2210,7 @@ void ScriptEditor::_update_script_names() {
HashSet<Ref<Script>> used;
Node *edited = EditorNode::get_singleton()->get_edited_scene();
- if (edited) {
+ if (edited && EDITOR_GET("text_editor/script_list/highlight_scene_scripts")) {
_find_scripts(edited, edited, used);
}
@@ -2382,7 +2380,7 @@ void ScriptEditor::_update_script_names() {
script_list->set_item_tooltip(index, sedata_filtered[i].tooltip);
script_list->set_item_metadata(index, sedata_filtered[i].index); /* Saving as metadata the script's index in the tab container and not the filtered one */
if (sedata_filtered[i].used) {
- script_list->set_item_custom_bg_color(index, Color(88 / 255.0, 88 / 255.0, 60 / 255.0));
+ script_list->set_item_custom_bg_color(index, Color(.5, .5, .5, .125));
}
if (tab_container->get_current_tab() == sedata_filtered[i].index) {
script_list->select(index);