ModOrganizer2 / modorganizer

Mod manager for various PC games. Discord Server: https://discord.gg/ewUVAqyrQX if you would like to be more involved
http://www.nexusmods.com/skyrimspecialedition/mods/6194
GNU General Public License v3.0
2.06k stars 155 forks source link

Hide ESLs when no ESL support #2026

Closed Silarn closed 1 month ago

Silarn commented 1 month ago

This should stop MO2 from displaying ESL files in the plugin list if light plugin support isn't available.

Holt59 commented 1 month ago

I don't really know if I like that idea... I think if we hide the ESL, we should notify the user someway, but maybe I'd prefer something that force disables the ESL when there are no support instead of just hiding them (maybe it's more complicated).

Do you have examples of mods that ship ESL for games that do not support them?

AnyOldName3 commented 1 month ago

Generally, I think it would be a good idea to move more stuff related to plugins to the game plugins as much as possible. If only the plugins that supported ESLs told the MO2 UI that .esl was a valid plugin extension, then they wouldn't show up to need disabling. It'd also be beneficial for other problems, like:

Silarn commented 1 month ago

This would be for something like fallout 4 vr which does not support ESL plugins. This change stops them from being shown in the plug-in list or written to the plugins.txt. Not only does this give the false impression that those plugins are going to load and be in the load order but it will write them to the plugins.txt. I guess fortunately this doesn't really cause an issue except to give a false impression that they will actually do something.

They will still be visible in the file tree but treated like any other file.

Can you give me a good reason to show what is essentially an invalid file in the plug-in list for games that don't support it?

Silarn commented 1 month ago

I generally agree about changing the way we deal with what constitutes a plugin file but that's a much larger change than this and whole project on its own.

Silarn commented 1 month ago

The only other solution I see here apart from completely revamping the plugin list stuff would be to hard disable those plugins and probably add a flag and tooltip explaining the issue.

Holt59 commented 1 month ago

This would be for something like fallout 4 vr which does not support ESL plugins. This change stops them from being shown in the plug-in list or written to the plugins.txt. Not only does this give the false impression that those plugins are going to load and be in the load order but it will write them to the plugins.txt. I guess fortunately this doesn't really cause an issue except to give a false impression that they will actually do something.

They will still be visible in the file tree but treated like any other file.

Can you give me a good reason to show what is essentially an invalid file in the plug-in list for games that don't support it?

It's more about notifying the user, because if someone DL a mod with a .esl, I think it's better to see the .esl disabled in the plugin list with maybe a tooltip saying "this game does not support light plugins", rather than simply removing the plugin from the list.

I'm not really familiar with FO4VR so I don't know how common these are and how often users install them thinking they will work.

Silarn commented 1 month ago

AFAIK there is no FO4VR page so you just have to know they don't work. You still get all your mods from the Fallout 4 game on Nexus. So yes, it happens. This was reported fairly recently.

Silarn commented 1 month ago

You can also just drop an 'ESL' file into any game and MO2 will assume it's a valid plugin file the way it works currently. The only thing that actually changes is that it doesn't segment ESLs into their own category or parse the light flag on ESP/ESM files.

Silarn commented 1 month ago

I will rework this to simply hard disable ESL files. That actually requires fewer changes overall, to be honest.

At some point I suppose I'll work on changing the plugin system in general. It also bothers me that currently MO2 doesn't do any real validation. In practice we should also prevent plugin files with incompatible headers from being enabled for games that don't support those versions.

Holt59 commented 1 month ago

I will rework this to simply hard disable ESL files. That actually requires fewer changes overall, to be honest.

At some point I suppose I'll work on changing the plugin system in general. It also bothers me that currently MO2 doesn't do any real validation. In practice we should also prevent plugin files with incompatible headers from being enabled for games that don't support those versions.

Maybe we could start by adding a isPluginSupported to the GamePlugins feature (where we pass the filepath and maybe a structure (to avoid reading stuff every time?)) and start moving stuff there little by little. That could probably replace the isXXXSupported in the end.

AnyOldName3 commented 1 month ago

In practice we should also prevent plugin files with incompatible headers from being enabled for games that don't support those versions.

Fixing this without also allowing plugins to extend stuff or otherwise doing something clever will break a common workaround where OpenMW users change file extensions for OpenMW-specific files to .esp so MO2 will let them enable them so that the exporter plugin can export them.

Silarn commented 1 month ago

Yes, I was thinking something similar. The stuff that parses plugin file data is already connected to the game plugins, so extending a validator function to this class would make a lot of sense and be generally more useful for multiple games.

So you can change the core code that looks for plugin files to ask for valid extensions or file patterns, load those files, and then ask the game plugin if they're valid as well.

Silarn commented 1 month ago

I'd also note that SSE VR has this issue except that there's an SKSEVR plugin to hack in support. I could do something like Starfield to allow them if we detect that plugin is installed.

Silarn commented 1 month ago

image Screenshot 2024-05-17 133426

Holt59 commented 1 month ago

Looks good to me.