Kezyma / ModOrganizer-Plugins

Plugins for Mod Organizer 2.
55 stars 18 forks source link

reinstaller: add "no copy" option #34

Open loicreynier opened 3 months ago

loicreynier commented 3 months ago

Add a "no copy" option for reinstaller which use a text file (MO2Plugins/Data/Reinstaller/installers.txt) that list the installers instead of copying the files to the plugin data folder.

I believe this could be useful for users as myself that prefer to keep all the downloaded files (for Wabbajack purposes for example).

This is implemented by adding no_copy setting to the plugin. If set to true (default behavior) the plugin keeps its original behavior. If set to false, the plugin uses a subclass of Reinstaller and ReinstallerPaths that implements the use of the text files. The drawback of this implementation is that because the plugin is already loaded when the setting is changed, MO2 must be restarted to apply the new behavior. However, this is standard practice for MO2 plugins, so it shouldn't pose a significant issue.

Marking this PR as a draft for now because I have not yet tested the behavior of the quick install and quick delete menus. So far, I have only implemented and tested the full reinstaller menu.

Also, I left the changes made by my linter, Ruff, to the files I touched, but I can remove them if necessary.

loicreynier commented 3 months ago

Second commit add the "no copy" behavior to the quick delete menu. The quick install menu uses only functions from the Reinstaller class so it doesn't require any changes.