| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <optional> |
| 7 |
#include <string> |
| 8 |
#include <string_view> |
| 9 |
#include <vector> |
| 10 |
|
| 11 |
#include "Common/CommonTypes.h" |
| 12 |
|
| 13 |
namespace DiscIO |
| 14 |
{ |
| 15 |
struct GameModDescriptorRiivolutionPatchOption |
| 16 |
{ |
| 17 |
std::string section_name; |
| 18 |
std::string option_id; |
| 19 |
std::string option_name; |
| 20 |
u32 choice = 0; |
| 21 |
}; |
| 22 |
|
| 23 |
struct GameModDescriptorRiivolutionPatch |
| 24 |
{ |
| 25 |
std::string xml; |
| 26 |
std::string root; |
| 27 |
std::vector<GameModDescriptorRiivolutionPatchOption> options; |
| 28 |
}; |
| 29 |
|
| 30 |
struct GameModDescriptorRiivolution |
| 31 |
{ |
| 32 |
std::vector<GameModDescriptorRiivolutionPatch> patches; |
| 33 |
}; |
| 34 |
|
| 35 |
struct GameModDescriptor |
| 36 |
{ |
| 37 |
std::string base_file; |
| 38 |
std::string display_name; |
| 39 |
std::string maker; |
| 40 |
std::string banner; |
| 41 |
std::optional<GameModDescriptorRiivolution> riivolution = std::nullopt; |
| 42 |
}; |
| 43 |
|
| 44 |
std::optional<GameModDescriptor> ParseGameModDescriptorFile(const std::string& filename); |
| 45 |
std::optional<GameModDescriptor> ParseGameModDescriptorString(std::string_view json, |
| 46 |
std::string_view json_path); |
| 47 |
std::string WriteGameModDescriptorString(const GameModDescriptor& descriptor, bool pretty); |
| 48 |
bool WriteGameModDescriptorFile(const std::string& filename, const GameModDescriptor& descriptor, |
| 49 |
bool pretty); |
| 50 |
} |