cdda-guide icon indicating copy to clipboard operation
cdda-guide copied to clipboard

Improve support for item variants

Open ggttttggggtt opened this issue 3 years ago • 3 comments

These vests don't appear in the search:

SWAT ballistic vest security stab vest police ballistic vest

ggttttggggtt avatar Aug 04 '22 21:08 ggttttggggtt

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!

nornagon avatar Aug 05 '22 00:08 nornagon

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:

  1. 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?
  2. ~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?)
  3. 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?

nornagon avatar Aug 05 '22 04:08 nornagon

Updated the title of the issue to reflect the remaining work.

nornagon avatar Jun 12 '23 20:06 nornagon