mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-26 08:14:38 +01:00
* Feature #11817: Show authors field in object selection - authors field in JSON shows as last line in bottom right on object selection - authors field added to Object class - ObjectFileIndex version bump as authors is serialised * fix sign comparison warning * Start object selection corner text higher to avoid overlap * Use references to reduce unneccessary copies * make GetAuthors const * Clip drawing of authors string so it doesn't cross widgets At max length the leftmost aligns exactly with description left * Add a changelog message * make SetAuthors use an rvalue reference * remove unnecessary nullptr check
This commit is contained in:
@@ -442,6 +442,26 @@ namespace ObjectFactory
|
||||
{
|
||||
throw std::runtime_error("Object has errors");
|
||||
}
|
||||
|
||||
auto authors = json_object_get(jRoot, "authors");
|
||||
if (json_is_array(authors))
|
||||
{
|
||||
std::vector<std::string> authorVector;
|
||||
for (size_t j = 0; j < json_array_size(authors); j++)
|
||||
{
|
||||
json_t* tryString = json_array_get(authors, j);
|
||||
if (json_is_string(tryString))
|
||||
{
|
||||
authorVector.emplace_back(json_string_value(tryString));
|
||||
}
|
||||
}
|
||||
result->SetAuthors(std::move(authorVector));
|
||||
}
|
||||
else if (json_is_string(authors))
|
||||
{
|
||||
result->SetAuthors({ json_string_value(authors) });
|
||||
}
|
||||
|
||||
auto sourceGames = json_object_get(jRoot, "sourceGame");
|
||||
if (json_is_array(sourceGames))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user