1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 14:02:59 +01:00

Allow more fields to be optional

This commit is contained in:
Ted John
2021-01-25 02:32:18 +00:00
parent 136783270f
commit 2fcaed8165
3 changed files with 29 additions and 20 deletions

View File

@@ -164,12 +164,15 @@ namespace OpenRCT2::Ui::Windows
}
else if (result.Type == "dropdown")
{
auto dukItems = desc["items"].as_array();
for (const auto& dukItem : dukItems)
if (desc["items"].is_array())
{
result.Items.push_back(ProcessString(dukItem));
auto dukItems = desc["items"].as_array();
for (const auto& dukItem : dukItems)
{
result.Items.push_back(ProcessString(dukItem));
}
}
result.SelectedIndex = desc["selectedIndex"].as_int();
result.SelectedIndex = AsOrDefault(desc["selectedIndex"], 0);
result.OnChange = desc["onChange"];
}
else if (result.Type == "groupbox" || result.Type == "label")