aboutsummaryrefslogtreecommitdiff
path: root/libs/game_bethesda/src/games/starfield/starfieldmoddatacontent.h
blob: d4b801445f6c7732b185ec7c8f0f57b89fdf5551 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef STARFIELD_MODDATACONTENT_H
#define STARFIELD_MODDATACONTENT_H

#include <gamebryomoddatacontent.h>
#include <ifiletree.h>

class StarfieldModDataContent : public GamebryoModDataContent
{
protected:
  enum StarfieldContent
  {
    CONTENT_MATERIAL   = CONTENT_NEXT_VALUE,
    CONTENT_GEOMETRIES = CONTENT_NEXT_VALUE + 1,
    CONTENT_VIDEO      = CONTENT_NEXT_VALUE + 2
  };

public:
  StarfieldModDataContent(MOBase::IGameFeatures const* gameFeatures)
      : GamebryoModDataContent(gameFeatures)
  {
    m_Enabled[CONTENT_SKYPROC] = false;
  }

  std::vector<Content> getAllContents() const override
  {
    static std::vector<Content> STARFIELD_CONTENTS{
        {CONTENT_MATERIAL, QT_TR_NOOP("Materials"), ":/MO/gui/content/material"},
        {CONTENT_GEOMETRIES, QT_TR_NOOP("Geometries"), ":/MO/gui/content/geometries"},
        {CONTENT_VIDEO, QT_TR_NOOP("Video"), ":/MO/gui/content/media"}};
    auto contents = GamebryoModDataContent::getAllContents();
    std::copy(std::begin(STARFIELD_CONTENTS), std::end(STARFIELD_CONTENTS),
              std::back_inserter(contents));
    return contents;
  }

  std::vector<int>
  getContentsFor(std::shared_ptr<const MOBase::IFileTree> fileTree) const override
  {
    auto contents = GamebryoModDataContent::getContentsFor(fileTree);
    for (auto e : *fileTree) {
      if (e->isDir()) {
        if (e->compare("materials") == 0) {
          contents.push_back(CONTENT_MATERIAL);
        } else if (e->compare("geometries") == 0) {
          contents.push_back(CONTENT_GEOMETRIES);
        } else if (e->compare("video") == 0) {
          contents.push_back(CONTENT_VIDEO);
        }
      }
    }
    return contents;
  }
};

#endif  // STARFIELD_MODDATACONTENT_H