#<https://raw.tools.bpbin.com>
1 messages · Page 1 of 1 (latest)
Oh. This looks cool. A few things that would make this much more useful:
- Search by attribute values. Otherwise it's difficult to even find an entity by its known name.
- Ability to copy one of the elements as JSON.
- Show actual prototype types (https://lua-api.factorio.com/latest/auxiliary/json-docs-prototype.html) instead of generic
Object.
I made a json search prototype a while back since there are just no existing solutions to parse through the insanely large dumps we have with factorio. It did work decently, just have not come around to integrating it here.
Copying individual entries as JSON is a neat idea, not sure how that interaction would work nicely tho since clicking things is already taken by collapsing/unfolding..
Showing the real types is something I had on my list but not thought about how to go about it just yet, guess I'll have to reuse my machine readable docs parser and integrate it into the json viewer decending through things
lmao at the 3km dropdown menu 
yeah thats also a bit suboptimal
but it works and has native "search" by just pressing the starting keys of the mod you want
Key*
To start, I'd probably just add a button that would copy the json to clipboard. Could look something like this:
Real types will likely be a real pain for the cases of union types.
ok yeah such a button could work
that could also let me get rid of the download button, thats so hacky anyways
pressing it doubles the memory consumption of the page 🫠
for the types I'll not detect what exact type something is based on values, I'd just write the expected type based on the tree
For cases like https://lua-api.factorio.com/latest/types/AnimationVariations.html you'll need to detect which of the cases you are dealing with so that you can continue assigning the types to the child fields recursively.
hmm its tricky for arrays tho
oh that is fair yeah
tho still doable, as long as there is no union with array[A] array[B]
There are cases of array[A|B], but for those there's an explicit resolution method. See e.g. https://lua-api.factorio.com/latest/types/Trigger.html
but that is also A | array[A]
This looks very handy. ❤️
have fun copying graphics definitions into your tool :D