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.09k stars 158 forks source link

IPluginList::setState not working #671

Open vasyl-ib opened 5 years ago

vasyl-ib commented 5 years ago

The problem:

following call do not change state of plugin IPluginList* plugList = m_MOInfo->pluginList(); plugList->setState(plugName, IPluginList::STATE_ACTIVE);

To Reproduce:

Create extension and call IPluginList::setState

Environment:

Mod Organizer 2.1.6 Win 10

Details:

Was playing/testing some ideas for MO2 plugin and found IPluginList::setState call is doing nothing.

Link to Mod Organizer logs:

USVFS:

MO Interface:

19:32:06 [D] localization file plugin_python_en not found 19:32:07 [D] localization file preview_base_en not found 19:32:07 [D] localization file FNISPatches_en not found 19:32:07 [D] localization file FNISTool_en not found 19:32:07 [D] localization file pyCfg_en not found 19:32:07 [D] reading save games from C:/Users/user/AppData/Local/ModOrganizer/Test2/profiles/Default/saves 19:32:07 [D] C:\Users\user\AppData\Local\ModOrganizer\Test2\profiles\Default\modlist.txt saved 19:32:07 [D] enable local saves: 1 19:32:07 [D] displaying main window 19:32:07 [D] close C:/Users/user/AppData/Local/ModOrganizer/Test2/profiles/Default/plugins.txt 19:32:07 [D] retrieving credentials 19:53:48 [?] Enabling plugin ele_legendary_lite.esp, current status 8 19:53:48 [?] Disabling plugin hearthfires.esm, current status 3 19:53:48 [?] Disabling plugin MODERN BRAWL BUG FIX.ESP, current status 9 19:53:49 [?] Refresh & Enabling plugin ELE_Legendary_Lite.esp 19:53:49 [D] close C:/Users/user/AppData/Local/ModOrganizer/Test2/profiles/Default/plugins.txt 19:55:30 [D] save C:/Users/user/AppData/Local/ModOrganizer/Test2/webcache/cookies.dat 19:55:30 [D] C:\Users\user\AppData\Local\ModOrganizer\Test2\profiles\Default\initweaks.ini saved 19:55:30 [D] C:\Users\user\AppData\Local\ModOrganizer\Test2\profiles\Default\lockedorder.txt saved 19:55:30 [D] Load Mechanism: Mod Organizer 19:55:30 [D] USVFS DLL Name: usvfs_x86.dll 19:55:31 [D] save C:/Users/user/AppData/Local/ModOrganizer/Test2/webcache/nexus_cookies.dat

LostDragonist commented 5 years ago

pluginStateTest.zip

Did some testing with the above Python plugin. There seem to be two issues regarding this.

First, the plugin list GUI does not normally get updated. The user can update it by moving the mouse over the plugin or having the plugin list in focus. The MO plugin can update it by popping up some sort of dialog that seems to cause a repaint of the parent window at some point. Outside of those, there's no clear way for a plugin to force the repaint.

Second, setting the state of a plugin does not write the state of the plugin to disk. Normally, changing the state of a plugin will trigger updates to plugins.txt, loadorder.txt, and lockedorder.txt. There is no clear way for an MO plugin to cause these to happen as all relevant functions are contained in PluginList and not IPluginList.

LostDragonist commented 5 years ago

Note for future development:

Do not just modify setState to write to disk and cause a refresh/repaint! This function is used all over the place in bulk operations. Doing this would cripple performance in several areas.

Holt59 commented 4 years ago

Do not just modify setState to write to disk and cause a refresh/repaint! This function is used all over the place in bulk operations. Doing this would cripple performance in several areas.

Did something change regarding this in recent commits? I've looked at it and setState seems to be called from nowhere inside the modorganizer project.

Al12rs commented 4 years ago

I don't remember anything specific about pluginList being changed