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

Sort dependencies first in modpacks #4252

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

HebaruSan
Copy link
Member

Motivation

#3499 sorted the relationships in modpacks alphanumerically by identifier (rather than randomly). There have been some problems with this; since the ordering of a changeset matters, sorting alphanumerically means that dependencies might end up later in the changeset than their depending mods, so for instance there might be cases where a user is prompted to choose a mod and is allowed to pick one that will conflict with a dependency of something later in the changeset.

Changes

Now we use a relationship resolver to sort dependencies before depending mods in modpacks. This way when a new modpack is exported, the ordering will better reflect how the mods should be installed.

Ideally we would also give the user some options for manually reordering mods, but I discovered that WinForms's ListView control cannot do that when item groups are in use. It either puts moved ListViewItems in the wrong place or omits them completely, and if we try rebuilding the entire list from scratch, there is no way to restore the scroll position so you can see the mod you just moved. Perhaps something to come back to in the future if we feel like reimplementing the modpack editor with a different underlying control.

Side fixes

To test this, I tried installing the community lifeboat modpack and found that the scrollbars from #4249 flickered quite a bit. Some calls to SuspendLayout and ResumeLayout are added to improve this.

@HebaruSan HebaruSan added Bug Something is not working as intended Enhancement New features or functionality Easy This is easy to fix GUI Issues affecting the interactive GUI Core (ckan.dll) Issues affecting the core part of CKAN labels Nov 7, 2024
@HebaruSan HebaruSan merged commit bd2f866 into KSP-CKAN:master Nov 7, 2024
3 checks passed
@HebaruSan HebaruSan deleted the fix/modpack-ordering branch November 7, 2024 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended Core (ckan.dll) Issues affecting the core part of CKAN Easy This is easy to fix Enhancement New features or functionality GUI Issues affecting the interactive GUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant