Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leave out children already shown in ancestor node #2258

Merged
merged 1 commit into from
Jan 26, 2018

Conversation

HebaruSan
Copy link
Member

Problem

Many mod relationships are mutual/circular, so mod X conflicts with Y, and Y also conflicts with X.

In the 1.24 pre-release version of the GUI relationships tab, this means you can expand them in an infinite chain if you want to, back and forth forever. This causes visual clutter and is a bit silly looking. Example from #2257:

image

Changes

Now we omit the children of nodes that already have their children shown as part of their own ancestry. The user will have seen them already when they expanded the identical ancestor node.

image

This is done by walking the tree via TreeNode.Parent up to the root and comparing the CkanModule objects located in the .Tag property.

Fixes #2257.

@HebaruSan HebaruSan added GUI Issues affecting the interactive GUI Pull request labels Jan 17, 2018
@politas
Copy link
Member

politas commented Jan 22, 2018

Would it not make sense to just check whether a mod already appears as an expanded treenode and refuse to expand it (showing an "Already expanded" fake node as the only child)? That would prevent loops of three or more mods as well.

@HebaruSan
Copy link
Member Author

This solution handles loops of three or more mods. It checks all of the ancestor nodes.

"already appears as an expanded treenode" sounds like it would be path-dependent; whether or not you see a relationship would depend on what other nodes you've expanded previously. I think it's better to use something consistent.

@politas
Copy link
Member

politas commented Jan 26, 2018

Ah, ok, I must have misread your description.

As for the path-dependant expansion; it's how a tool I have at work handles expansion of related objects. It's not important.

@politas politas merged commit ee6d4cd into KSP-CKAN:master Jan 26, 2018
@HebaruSan HebaruSan deleted the fix/infinite-dep-tree branch January 26, 2018 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI Issues affecting the interactive GUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants