Filtering the Items Array #9
Replies: 3 comments 1 reply
-
So, I'm thinking that it could be as simple as a optional field under "type": {
"name": "Attacks",
"type": "object-loop",
"filter": "type",
"header": "show",
"text": "items{starshipweapon} => name - Damage: {b} system.damage {/b}{nl}"
} That's a great world. But it restricts everything to one column each. So in my oh, my, god you are the man world... Would it be at all possible to run multiple object loops in one "text" field? {
"name": "Attacks/Talents",
"type": "object-loop",
"filter": "type",
"header": "show",
"text": "{u}Attacks:{/u}{nl} items{starshipweapon} => name - Damage: {b} system.damage {/b}{nl} || {u}Extra Cargo:{/u}{nl} items{item} => name {nl} || {u}Talents:{/u}{nl} items{talent} => name {nl}"
} I just imagined double pipes as separators, but whatever works... |
Beta Was this translation helpful? Give feedback.
-
Oh, one last thing, and I'm not too concerned about this, but I've had one request (from the guy doing Fallout and Star Trek) that some of these arrays display as a dropdown. So thinking about fallout: {
"name": "Perks",
"type": "object-loop",
"filter": "perk",
"header": "show",
"text": "{dropdown} items{perk} => name {b} system.level {/b}{nl}"
} |
Beta Was this translation helpful? Give feedback.
-
Accordion style might be perfect, but I think that would expand the row while open wouldn't it? Select box wouldn't be as slick, but the dropdown wouldn't need to resize the table. Based on his request, I imagined something like {dropdown:Perks} where Perks would be the title and first entry and show when it's closed, clicking that or the + (if accordion) or down arrow (if selectable), would then show all the character's perks. They wouldn't be selectable to end up with one of the perks showing, just a way to see all the perks without having 10-15 line rows for every character. Accordion is slickest, so if that's possible that would be great... but if makes you say "do you realize what you are asking for?" do select box... |
Beta Was this translation helpful? Give feedback.
-
Ok, you're a genius and I'm a retard. The only way I tested accessing things under system in the items array was to do
items => system
which resulted in:Which is as dumb as doing something as direct and having the text be '"Stuff: system"`.
So anyway, your object-loop already does what's needed to get things out of the system area:
Does this:
Now the issue is, we need to filter by type. And who knows, someone might end up requesting filtering by name, I don't know. Because the way things are in the Star Trek ships, Phasers and Torpedoes are type "starshipweapon", Tractor Beams are type "item", and Talents are type "talent". Only "starshipweapon" types actually have system.damage.
Beta Was this translation helpful? Give feedback.
All reactions