| 123 | } |
| 124 | |
| 125 | void PluginManager::loadAllPlugins() |
| 126 | { |
| 127 | CpuTimer timer; |
| 128 | timer.update(); |
| 129 | |
| 130 | std::ifstream ifs(getRuntimeDirectory() / "plugins" / "plugins.json"); |
| 131 | auto json = nlohmann::json::parse(ifs); |
| 132 | size_t loadedCount = 0; |
| 133 | for (const auto& name : json) |
| 134 | { |
| 135 | if (loadPluginByName(name.get<std::string>())) |
| 136 | loadedCount++; |
| 137 | } |
| 138 | |
| 139 | timer.update(); |
| 140 | if (loadedCount > 0) |
| 141 | logInfo("Loaded {} plugin(s) in {:.3}s", loadedCount, timer.delta()); |
| 142 | } |
| 143 | |
| 144 | void PluginManager::releaseAllPlugins() |
| 145 | { |