diff options
Diffstat (limited to 'libs/installer_fomod_plus/installer/integration')
| -rw-r--r-- | libs/installer_fomod_plus/installer/integration/FomodDataContent.cpp | 50 | ||||
| -rw-r--r-- | libs/installer_fomod_plus/installer/integration/FomodDataContent.h | 21 |
2 files changed, 0 insertions, 71 deletions
diff --git a/libs/installer_fomod_plus/installer/integration/FomodDataContent.cpp b/libs/installer_fomod_plus/installer/integration/FomodDataContent.cpp deleted file mode 100644 index ac4508d..0000000 --- a/libs/installer_fomod_plus/installer/integration/FomodDataContent.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "FomodDataContent.h" - -#include <ifiletree.h> - -#include "stringutil.h" - -#include <iplugingame.h> - -FomodDataContent::FomodDataContent(MOBase::IOrganizer* organizer) : mOrganizer(organizer) -{ -} - -std::vector<MOBase::ModDataContent::Content> FomodDataContent::getAllContents() const -{ - static const std::vector<Content> contents = { - {FomodDataContentConstants::FOMOD_CONTENT_ID, "FOMOD", ":/fomod/hat", false} - }; - - return contents; -} - -// Confirmed working, no need to update -std::vector<int> FomodDataContent::getContentsFor(const std::shared_ptr<const MOBase::IFileTree> fileTree) const -{ - std::vector<int> contents; - if (!mOrganizer || !fileTree) { - return contents; - } - - const auto modList = mOrganizer->modList(); - if (!modList) { - return contents; - } - - const auto mod = modList->getMod(fileTree->name()); - if (modHasFomodContent(mod)) { - contents.emplace_back(FomodDataContentConstants::FOMOD_CONTENT_ID); - } - return contents; -} - -bool FomodDataContent::modHasFomodContent(const MOBase::IModInterface* mod) -{ - if (!mod) { - return false; - } - const auto pluginName = QString::fromStdString(StringConstants::Plugin::NAME.data()); - const auto fomodMeta = mod->pluginSetting(pluginName, "fomod", 0); - return fomodMeta != 0; -} diff --git a/libs/installer_fomod_plus/installer/integration/FomodDataContent.h b/libs/installer_fomod_plus/installer/integration/FomodDataContent.h deleted file mode 100644 index 4ffa3d7..0000000 --- a/libs/installer_fomod_plus/installer/integration/FomodDataContent.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include <imoinfo.h> -#include <moddatacontent.h> - -namespace FomodDataContentConstants { -constexpr int FOMOD_CONTENT_ID = 400400; -} - -class FomodDataContent final : public MOBase::ModDataContent { -public: - explicit FomodDataContent(MOBase::IOrganizer* organizer); - - [[nodiscard]] std::vector<Content> getAllContents() const override; - - [[nodiscard]] std::vector<int> getContentsFor(std::shared_ptr<const MOBase::IFileTree> fileTree) const override; - -private: - MOBase::IOrganizer* mOrganizer; - static bool modHasFomodContent(const MOBase::IModInterface* mod); -}; |
