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

Hide ESLs when no ESL support #2026

Merged
merged 2 commits into from
May 19, 2024
Merged

Hide ESLs when no ESL support #2026

merged 2 commits into from
May 19, 2024

Conversation

Silarn
Copy link
Member

@Silarn Silarn commented May 17, 2024

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

Need to resolve some issues with the plugin list indices
@Silarn Silarn requested review from Holt59 and Al12rs May 17, 2024 08:38
@Holt59
Copy link
Member

Holt59 commented May 17, 2024

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
Copy link
Member

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:

  • some ESP files for Morrowind being normal ones that go in Morrowind.ini and some being MGE XE grass ones that go in MGE.ini instead Improve UX for MGE XE grass mods #1692.
  • there currently being no way to add OpenMW's new file types (.omwgame, .omwaddon and .omwscripts) that doesn't make MO2 think it can feed them through the normal ESM loader OpenMW files support #1609.
  • there being no way for non-BGS games implemented via the basic_games plugins that have something semantically similar to ESPs to use the built-in GUI to manage them. I'm not sure this is on the tracker.
    Obviously, this doesn't have to happen all in one go or right away, but this PR puts more stuff into the core of MO2 that I don't think should be.

@Silarn
Copy link
Member Author

Silarn commented May 17, 2024

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
Copy link
Member Author

Silarn commented May 17, 2024

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
Copy link
Member Author

Silarn commented May 17, 2024

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
Copy link
Member

Holt59 commented May 17, 2024

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
Copy link
Member Author

Silarn commented May 17, 2024

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
Copy link
Member Author

Silarn commented May 17, 2024

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
Copy link
Member Author

Silarn commented May 17, 2024

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
Copy link
Member

Holt59 commented May 17, 2024

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
Copy link
Member

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
Copy link
Member Author

Silarn commented May 17, 2024

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
Copy link
Member Author

Silarn commented May 17, 2024

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
Copy link
Member Author

Silarn commented May 17, 2024

image
Screenshot 2024-05-17 133426

@Holt59
Copy link
Member

Holt59 commented May 18, 2024

Looks good to me.

@Holt59 Holt59 merged commit 9ee4c5a into master May 19, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants