EditorSettings: Look for binding while filtering too

This commit is contained in:
Jonas Bernemann 2021-06-04 01:31:55 +02:00
parent ea2a0b5455
commit f0469fddfe

View file

@ -261,10 +261,6 @@ void EditorSettingsDialog::_update_shortcuts() {
for (OrderedHashMap<StringName, InputMap::Action>::Element E = action_map.front(); E; E = E.next()) { for (OrderedHashMap<StringName, InputMap::Action>::Element E = action_map.front(); E; E = E.next()) {
String action_name = E.key(); String action_name = E.key();
if (!shortcut_filter.is_subsequence_ofi(action_name)) {
continue;
}
InputMap::Action action = E.get(); InputMap::Action action = E.get();
Array events; // Need to get the list of events into an array so it can be set as metadata on the item. Array events; // Need to get the list of events into an array so it can be set as metadata on the item.
@ -298,6 +294,10 @@ void EditorSettingsDialog::_update_shortcuts() {
// Join the text of the events with a delimiter so they can all be displayed in one cell. // Join the text of the events with a delimiter so they can all be displayed in one cell.
String events_display_string = event_strings.is_empty() ? "None" : String("; ").join(event_strings); String events_display_string = event_strings.is_empty() ? "None" : String("; ").join(event_strings);
if (!shortcut_filter.is_subsequence_ofi(action_name) && (events_display_string == "None" || !shortcut_filter.is_subsequence_ofi(events_display_string))) {
continue;
}
TreeItem *item = shortcuts->create_item(common_section); TreeItem *item = shortcuts->create_item(common_section);
item->set_text(0, action_name); item->set_text(0, action_name);
item->set_text(1, events_display_string); item->set_text(1, events_display_string);