Skip to content

Commit

Permalink
Fix not all cities being shown in TreeView on Tab keypress
Browse files Browse the repository at this point in the history
  • Loading branch information
falko17 committed Jan 25, 2024
1 parent 347fa6d commit c816270
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Assets/SEE/Controls/Actions/ContextMenuAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private static IEnumerable<PopupMenuAction> GetCommonOptions(GraphElement graphE

if (gameObject != null)
{
actions.Add(new("Highlight", Highlight, Icons.LightBulb));
actions.Add(new("Show in City", Highlight, Icons.LightBulb));
}

if (graphElement.Filename() != null)
Expand Down
14 changes: 7 additions & 7 deletions Assets/SEE/Controls/Actions/ShowTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class ShowTree : MonoBehaviour
/// <summary>
/// Displays the tree view window for each code city.
/// </summary>
private void ShowCodeView()
private void ShowTreeView()
{
GameObject[] cities = GameObject.FindGameObjectsWithTag(Tags.CodeCity);
if (cities.Length == 0)
Expand All @@ -47,9 +47,9 @@ private void ShowCodeView()
{
continue;
}
if (!gameObject.TryGetComponent(out TreeWindow window))
if (!cityObject.TryGetComponent(out TreeWindow window))
{
window = gameObject.AddComponent<TreeWindow>();
window = cityObject.AddComponent<TreeWindow>();
window.Graph = city.LoadedGraph;
}
treeWindows.Add(city.name, window);
Expand Down Expand Up @@ -80,7 +80,7 @@ async UniTaskVoid SetupManager()
/// Close all tree view windows.
/// It is assumed that this method is called from a toggle action.
/// </summary>
private void HideCodeView()
private void HideTreeView()
{
// If none of the windows were actually closed, we should instead open them.
bool anyClosed = false;
Expand All @@ -91,7 +91,7 @@ private void HideCodeView()
treeWindows.Clear();
if (!anyClosed)
{
ShowCodeView();
ShowTreeView();
}
}

Expand All @@ -101,11 +101,11 @@ private void Update()
{
if (treeWindows.Count == 0)
{
ShowCodeView();
ShowTreeView();
}
else
{
HideCodeView();
HideTreeView();
}
}
}
Expand Down

0 comments on commit c816270

Please sign in to comment.