Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Commit

Permalink
oops, forgot to do one last fix (unexpanded node children weren't get…
Browse files Browse the repository at this point in the history
…ting exported) ... but hey, at least the order of your nodes will now be preserved!
  • Loading branch information
yangrobertw committed Aug 31, 2018
1 parent fa8aef0 commit e2a868c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Assets/Merino/Editor/MerinoEditorWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,17 @@ string SaveNodesAsString()
// gather data
ValidateNodeTitles();
var nodeInfo = new List<YarnSpinnerLoader.NodeInfo>();

// grab nodes based on visible order in the hierarchy tree view (sorting)

// first, in order to properly export, we need to expand everything
var previousExpanded = treeView.GetExpanded();
treeView.ExpandAll();
// then grab the nodes
var treeNodes = treeView.GetRows().Select(x => treeView.treeModel.Find(x.id)).ToArray(); // treeData.treeElements; // m_TreeView.treeModel.root.children;
// then set the expanded nodes back to what they were
treeView.SetExpanded(previousExpanded);

// save data to string
foreach (var item in treeNodes)
{
Expand Down

0 comments on commit e2a868c

Please sign in to comment.