File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff 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);
You can’t perform that action at this time.
0 commit comments