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

Method isEnabled

src/plugincontainer.cpp:638–660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

636}
637
638bool PluginContainer::isEnabled(IPlugin* plugin) const
639{
640 // Check if it's a game plugin:
641 if (implementInterface<IPluginGame>(plugin)) {
642 return plugin == m_Organizer->managedGame();
643 }
644
645 // Check the master, if any:
646 auto& requirements = m_Requirements.at(plugin);
647
648 if (requirements.master()) {
649 return isEnabled(requirements.master());
650 }
651
652 // Check if the plugin is enabled:
653 if (!m_Organizer->persistent(plugin->name(), "enabled", plugin->enabledByDefault())
654 .toBool()) {
655 return false;
656 }
657
658 // Check the requirements:
659 return m_Requirements.at(plugin).canEnable();
660}
661
662void PluginContainer::setEnabled(MOBase::IPlugin* plugin, bool enable,
663 bool dependencies)

Callers 1

requiredForMethod · 0.45

Calls 5

masterMethod · 0.80
canEnableMethod · 0.80
managedGameMethod · 0.45
persistentMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected