Improve support for item variants
These vests don't appear in the search:
SWAT ballistic vest security stab vest police ballistic vest
Ah, right, the guide doesn't support the variants syntax: https://github.com/CleverRaven/Cataclysm-DDA/blob/072a7a3054179f23a924134a5e6e2ef381aeb69f/data/json/items/armor/ballistic_armor.json#L12-L28
yep, we should fix this!
this is somewhat addressed by ea14459. variant items are now searchable by their names and ids, and will show up the "base" item in results. alternative names will be shown on the item screen.
i don't think i want to treat each variant item as a unique separate item in the results as that will unnecessarily blow up the search results. but i think this could use more work to be better:
- it should be possible to see the variant descriptions and ascii art, if present. perhaps some sort of selector that lets you choose between the different variants?
- ~when searching, if one of the variant names matches the query "better" than the base name, we should show that result instead.~ [done] (and maybe auto-select the searched-for variant when clicking the result?)
- probably links to the variant item id of the form /item/<variant_id> should work. maybe that's how the variant selector works, by changing the url?
Updated the title of the issue to reflect the remaining work.