Skip to content

Commit

Permalink
Core: Add a Maker field for GameModDescriptors.
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiralCurtiss committed Jan 2, 2022
1 parent 85d2ea0 commit 2906889
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/Core/DiscIO/GameModDescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ std::optional<GameModDescriptor> ParseGameModDescriptorString(std::string_view j
{
descriptor.display_name = value.get<std::string>();
}
else if (key == "maker" && value.is<std::string>())
{
descriptor.maker = value.get<std::string>();
}
else if (key == "banner" && value.is<std::string>())
{
descriptor.banner = MakeAbsolute(json_directory, value.get<std::string>());
Expand Down Expand Up @@ -195,6 +199,8 @@ std::string WriteGameModDescriptorString(const GameModDescriptor& descriptor, bo
json_root["base-file"] = picojson::value(descriptor.base_file);
if (!descriptor.display_name.empty())
json_root["display-name"] = picojson::value(descriptor.display_name);
if (!descriptor.maker.empty())
json_root["maker"] = picojson::value(descriptor.maker);
if (!descriptor.banner.empty())
json_root["banner"] = picojson::value(descriptor.banner);
if (descriptor.riivolution)
Expand Down
1 change: 1 addition & 0 deletions Source/Core/DiscIO/GameModDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ struct GameModDescriptor
{
std::string base_file;
std::string display_name;
std::string maker;
std::string banner;
std::optional<GameModDescriptorRiivolution> riivolution = std::nullopt;
};
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/UICommon/GameFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ GameFile::GameFile(std::string path) : m_file_path(std::move(path))
m_valid = true;
m_file_size = File::GetSize(m_file_path);
m_long_names.emplace(DiscIO::Language::English, std::move(descriptor->display_name));
if (!descriptor->maker.empty())
m_long_makers.emplace(DiscIO::Language::English, std::move(descriptor->maker));
m_internal_name = proxy.GetInternalName();
m_game_id = proxy.GetGameID();
m_gametdb_id = proxy.GetGameTDBID();
Expand Down
3 changes: 3 additions & 0 deletions docs/game-mod-descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"display-name": {
"type": "string"
},
"maker": {
"type": "string"
},
"banner": {
"type": "string"
},
Expand Down

0 comments on commit 2906889

Please sign in to comment.