Skip to content

Commit 7d5d554

Browse files
committed
Merge pull request #109259 from aaronp64/input_map_collapsing
Keep collapsed state for actions when modifying Input Map
2 parents 8b01729 + f25e6af commit 7d5d554

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

editor/settings/action_map_editor.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,18 @@ void ActionMapEditor::update_action_list(const Vector<ActionInfo> &p_action_info
423423
actions_cache = p_action_infos;
424424
}
425425

426+
HashSet<String> collapsed_actions;
427+
TreeItem *root = action_tree->get_root();
428+
if (root) {
429+
for (TreeItem *child = root->get_first_child(); child; child = child->get_next()) {
430+
if (child->is_collapsed()) {
431+
collapsed_actions.insert(child->get_meta("__name"));
432+
}
433+
}
434+
}
435+
426436
action_tree->clear();
427-
TreeItem *root = action_tree->create_item();
437+
root = action_tree->create_item();
428438

429439
for (const ActionInfo &action_info : actions_cache) {
430440
const Array events = action_info.action["events"];
@@ -444,6 +454,7 @@ void ActionMapEditor::update_action_list(const Vector<ActionInfo> &p_action_info
444454
ERR_FAIL_NULL(action_item);
445455
action_item->set_meta("__action", action_info.action);
446456
action_item->set_meta("__name", action_info.name);
457+
action_item->set_collapsed(collapsed_actions.has(action_info.name));
447458

448459
// First Column - Action Name
449460
action_item->set_auto_translate_mode(0, AUTO_TRANSLATE_MODE_DISABLED);

0 commit comments

Comments
 (0)