| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <optional> |
| 7 |
#include <string> |
| 8 |
#include <vector> |
| 9 |
|
| 10 |
#include <picojson.h> |
| 11 |
|
| 12 |
#include "VideoCommon/GraphicsModSystem/Config/GraphicsModAsset.h" |
| 13 |
#include "VideoCommon/GraphicsModSystem/Config/GraphicsModFeature.h" |
| 14 |
#include "VideoCommon/GraphicsModSystem/Config/GraphicsTargetGroup.h" |
| 15 |
|
| 16 |
struct GraphicsModConfig |
| 17 |
{ |
| 18 |
std::string m_title; |
| 19 |
std::string m_author; |
| 20 |
std::string m_description; |
| 21 |
bool m_enabled = false; |
| 22 |
u16 m_weight = 0; |
| 23 |
std::string m_relative_path; |
| 24 |
|
| 25 |
enum class Source |
| 26 |
{ |
| 27 |
User, |
| 28 |
System |
| 29 |
}; |
| 30 |
Source m_source = Source::User; |
| 31 |
|
| 32 |
std::vector<GraphicsTargetGroupConfig> m_groups; |
| 33 |
std::vector<GraphicsModFeatureConfig> m_features; |
| 34 |
std::vector<GraphicsModAssetConfig> m_assets; |
| 35 |
|
| 36 |
static std::optional<GraphicsModConfig> Create(const std::string& file, Source source); |
| 37 |
static std::optional<GraphicsModConfig> Create(const picojson::object* obj); |
| 38 |
|
| 39 |
std::string GetAbsolutePath() const; |
| 40 |
|
| 41 |
void SerializeToConfig(picojson::object& json_obj) const; |
| 42 |
bool DeserializeFromConfig(const picojson::value& value); |
| 43 |
|
| 44 |
void SerializeToProfile(picojson::object* value) const; |
| 45 |
void DeserializeFromProfile(const picojson::object& value); |
| 46 |
}; |