2022-02-26 06:19:38 +00:00
|
|
|
// Copyright 2022 Dolphin Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <optional>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <picojson.h>
|
|
|
|
|
2023-07-11 03:23:32 +00:00
|
|
|
#include "VideoCommon/GraphicsModSystem/Config/GraphicsModAsset.h"
|
2022-02-26 06:19:38 +00:00
|
|
|
#include "VideoCommon/GraphicsModSystem/Config/GraphicsModFeature.h"
|
|
|
|
#include "VideoCommon/GraphicsModSystem/Config/GraphicsTargetGroup.h"
|
|
|
|
|
|
|
|
struct GraphicsModConfig
|
|
|
|
{
|
|
|
|
std::string m_title;
|
|
|
|
std::string m_author;
|
|
|
|
std::string m_description;
|
|
|
|
bool m_enabled = false;
|
|
|
|
u16 m_weight = 0;
|
|
|
|
std::string m_relative_path;
|
|
|
|
|
|
|
|
enum class Source
|
|
|
|
{
|
|
|
|
User,
|
|
|
|
System
|
|
|
|
};
|
|
|
|
Source m_source = Source::User;
|
|
|
|
|
|
|
|
std::vector<GraphicsTargetGroupConfig> m_groups;
|
|
|
|
std::vector<GraphicsModFeatureConfig> m_features;
|
2023-07-11 03:23:32 +00:00
|
|
|
std::vector<GraphicsModAssetConfig> m_assets;
|
2022-02-26 06:19:38 +00:00
|
|
|
|
|
|
|
static std::optional<GraphicsModConfig> Create(const std::string& file, Source source);
|
|
|
|
static std::optional<GraphicsModConfig> Create(const picojson::object* obj);
|
|
|
|
|
|
|
|
std::string GetAbsolutePath() const;
|
|
|
|
|
|
|
|
bool DeserializeFromConfig(const picojson::value& value);
|
|
|
|
|
|
|
|
void SerializeToProfile(picojson::object* value) const;
|
|
|
|
void DeserializeFromProfile(const picojson::object& value);
|
|
|
|
|
|
|
|
bool operator<(const GraphicsModConfig& other) const;
|
|
|
|
};
|