MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / fixPrimaryPlugins

Method fixPrimaryPlugins

src/pluginlist.cpp:298–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298void PluginList::fixPrimaryPlugins()
299{
300 if (!m_Organizer.settings().game().forceEnableCoreFiles()) {
301 return;
302 }
303
304 // This function ensures that the primary plugins are first and in the correct order
305 QStringList primaryPlugins = m_Organizer.managedGame()->primaryPlugins();
306 int prio = 0;
307 bool somethingChanged = false;
308 for (QString plugin : primaryPlugins) {
309 std::map<QString, int>::iterator iter = m_ESPsByName.find(plugin);
310 // Plugin is present?
311 if (iter != m_ESPsByName.end()) {
312 if (prio != m_ESPs[iter->second].priority) {
313 // Priority is wrong! Fix it!
314 int newPrio = prio;
315 setPluginPriority(iter->second, newPrio, true /* isForced */);
316 somethingChanged = true;
317 }
318 prio++;
319 }
320 }
321
322 if (somethingChanged) {
323 writePluginsList();
324 }
325}
326
327void PluginList::fixPluginRelationships()
328{

Callers

nothing calls this directly

Calls 6

forceEnableCoreFilesMethod · 0.80
gameMethod · 0.80
settingsMethod · 0.45
managedGameMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected