mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2025-01-07 10:18:13 +01:00
Save info is plugin is linked and loaded inside config info
This commit is contained in:
parent
5b4a382856
commit
3ef104d619
@ -1,16 +1,18 @@
|
||||
#pragma once
|
||||
#include "config/WUPSConfig.h"
|
||||
#include "plugin/PluginData.h"
|
||||
#include <memory>
|
||||
|
||||
struct GeneralConfigInformation {
|
||||
std::string name;
|
||||
std::string author;
|
||||
std::string version;
|
||||
std::shared_ptr<PluginData> pluginData;
|
||||
};
|
||||
|
||||
class ConfigDisplayItem {
|
||||
public:
|
||||
ConfigDisplayItem(GeneralConfigInformation &info, std::unique_ptr<WUPSConfigAPIBackend::WUPSConfig> config) : mConfig(std::move(config)), mInfo(std::move(info)) {
|
||||
ConfigDisplayItem(GeneralConfigInformation &info, std::unique_ptr<WUPSConfigAPIBackend::WUPSConfig> config, bool isActive) : mConfig(std::move(config)), mInfo(std::move(info)), mIsActivePlugin(isActive) {
|
||||
assert(mConfig);
|
||||
}
|
||||
[[nodiscard]] const GeneralConfigInformation &getConfigInformation() const {
|
||||
@ -20,7 +22,12 @@ public:
|
||||
return *mConfig;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool isActivePlugin () const {
|
||||
return mIsActivePlugin;
|
||||
|
||||
}
|
||||
private:
|
||||
std::unique_ptr<WUPSConfigAPIBackend::WUPSConfig> mConfig;
|
||||
GeneralConfigInformation mInfo;
|
||||
bool mIsActivePlugin;
|
||||
};
|
@ -76,13 +76,11 @@ void ConfigUtils::displayMenu() {
|
||||
|
||||
std::vector<ConfigDisplayItem> configs;
|
||||
for (const auto &plugin : gLoadedPlugins) {
|
||||
if (!plugin.isLinkedAndLoaded()) {
|
||||
continue;
|
||||
}
|
||||
GeneralConfigInformation info;
|
||||
info.name = plugin.getMetaInformation().getName();
|
||||
info.author = plugin.getMetaInformation().getAuthor();
|
||||
info.version = plugin.getMetaInformation().getVersion();
|
||||
info.name = plugin.getMetaInformation().getName();
|
||||
info.author = plugin.getMetaInformation().getAuthor();
|
||||
info.version = plugin.getMetaInformation().getVersion();
|
||||
info.pluginData = plugin.getPluginDataCopy();
|
||||
|
||||
std::unique_ptr<WUPSConfigAPIBackend::WUPSConfig> config;
|
||||
const auto configData = plugin.getConfigData();
|
||||
@ -125,8 +123,7 @@ void ConfigUtils::displayMenu() {
|
||||
if (!config) {
|
||||
config = make_unique_nothrow<WUPSConfigAPIBackend::WUPSConfig>(info.name);
|
||||
}
|
||||
|
||||
configs.emplace_back(info, std::move(config));
|
||||
configs.emplace_back(info, std::move(config), plugin.isLinkedAndLoaded());
|
||||
}
|
||||
|
||||
// Sort Configs by name
|
||||
|
Loading…
Reference in New Issue
Block a user