| 107 | } |
| 108 | |
| 109 | Collectable CollectionDatabase::parseItemCollectable(String const& name, Json const& config) const { |
| 110 | Collectable collectable = parseGenericCollectable(name, config); |
| 111 | auto itemDatabase = Root::singleton().itemDatabase(); |
| 112 | auto item = itemDatabase->itemShared(ItemDescriptor(config.getString("item"))); |
| 113 | |
| 114 | collectable.title = item->friendlyName(); |
| 115 | collectable.description = item->description(); |
| 116 | |
| 117 | if (config.contains("icon")) { |
| 118 | collectable.icon = config.getString("icon"); |
| 119 | } else { |
| 120 | auto inventoryIcon = item->instanceValue("inventoryIcon", ""); |
| 121 | if (inventoryIcon.isType(Json::Type::String)) |
| 122 | collectable.icon = AssetPath::relativeTo(itemDatabase->itemConfig(item->name(), JsonObject()).directory, inventoryIcon.toString()); |
| 123 | } |
| 124 | |
| 125 | return collectable; |
| 126 | } |
| 127 | |
| 128 | } |
nothing calls this directly
no test coverage detected