Chiv2-Community / UnchainedLauncher

GNU General Public License v3.0
8 stars 1 forks source link

Disabling mods should disable dependencies #23

Open Jacoby6000 opened 1 year ago

Jacoby6000 commented 1 year ago

If you disable a mod that has dependencies and those dependencies aren't used by anything else and they were not explicitly enabled, those dependencies should be disabled.

This will require changing the way enabling mods works so that we can attach some other info to the enablement... If it was because of a dependency, what dependency caused it, if its enabled because its a core mod, etc;.

ARoese commented 1 week ago

I think it'll be more complex than necessary if we keep extra info attached to each mod beyond whether it was explicitly enabled by a user, or needs to be enabled because something depends on it. We can probably solve this pretty simply by running Tri-color marking with mods marked as intentionally enabled as the GC roots. Those mods and their dependencies are then considered to be "reachable" as far as the algorithm is concerned. This way, mods don't need to track what depends on them and we can just use the existing dependency list of the dependent mods.

It's a small problem set, so re-running this entirely whenever there is a change is probably much easier than trying to consistently mutate some existing state.