forked from OpenNeo/impress
Fix handling of basic PB items in Item Getting Guide
Okay so, like 30 minutes ago I added fallback behavior for cases where we can't correctly infer the color from a PB item's name… and then I pulled it up in the color and found that, oh, right, there are already 3 PB items that *correctly* return `nil` for `Item#pb_color`: Aisha Collar, Elephante Hat, and Ixi Collar. This is because they're common items that apply to many colors, like the basics, but also many other less-special or older color variants. They are the most likely case where we'll return `nil`. So, I've updated our fallback UI to, instead of talk vaguely about missing data, just assume that we're dealing with basic items. In the rare window of time where a new color is released, and we have PB items for it but no manual color data yet, this can just incorrectly say "Basic Colors" and that's fine.
This commit is contained in:
parent
bd6b6450d9
commit
a3bd841bb8
1 changed files with 5 additions and 2 deletions
|
@ -71,11 +71,14 @@
|
|||
= image_tag pet_type_image_url(@pb_color_pet_types[color], size: :face),
|
||||
srcset: ["#{pet_type_image_url(@pb_color_pet_types[color], size: :face_2x)} 2x"],
|
||||
alt: @pb_color_pet_types[color].human_name
|
||||
- else
|
||||
= image_tag "https://images.neopets.com/items/starter_red_pb.gif",
|
||||
alt: "Item thumbnail for Starter Red Paint Brush"
|
||||
%th
|
||||
- if color
|
||||
#{color.pb_item_name || color.name.humanize}
|
||||
- else
|
||||
??? New color
|
||||
Basic colors
|
||||
(#{pluralize items.size, "item"})
|
||||
%td.actions-cell
|
||||
- if color&.pb_item_name?
|
||||
|
@ -90,7 +93,7 @@
|
|||
Get via Lab Ray, morphing potions, etc.
|
||||
- else
|
||||
.special-color-explanation
|
||||
We don't have info about this color yet.
|
||||
Many colors, like Red, will grant this item.
|
||||
%tbody
|
||||
- items.each do |item|
|
||||
= render "item_list_row", item:
|
||||
|
|
Loading…
Reference in a new issue