Open XHXIAIEIN opened 10 months ago
Dictionary has the useful KeyCount
expression, but the JSON object does not have it.
Add JSON.KeyCount(path)
expressions like Object.keys(path).length
. Return the number of keys in Path.
This is very useful for statistics and UI lists. For example, if you want to create objects based on the number of keys in the path. And assign index numbers to these objects
Currently, you have to access the path via JSON: For each and create a local variable outside to count, which is very cumbersome.
We also need Stop Loop
action.
When Loop in this structure, When you find a matching value, need a 'Stop loop' so that it does not traverse the entire file.
[
{"id": "1000", "name": "apple"},
{"id": "1001", "name": "banana"},
{"id": "1002", "name": "carrot"}
]
is Empty
condition can be used to check whether the object at the path is empty.This is still very useful. For example, it is used to detect the quantity of UI, inventory, item, Achievement, Status Entry, etc.
"data": []
"data": {}
"data": ""
Dictionary has the useful GetDefault()
expression, but the JSON object does not have it.
I would appreciate if JSON would also get this functionality as it is very handy.
Return the value stored for a key, but if it is missing, return a different value instead. For example Dictionary.GetDefault("name", "guest") will return the value of the key "name" if it exists, otherwise it will return the string "guest".
order any JSON array or object by their keys and/or by their values (ascending/descending), For example, it is very useful when you want to add sorting functionality to the UI.
for example:
[
{"id": "7001", "name": "banana"},
{"id": "1002", "name": "carrot"},
{"id": "2024", "name": "apple"}
]
Order By "id"
{"id": "1002", "name": "carrot"},
{"id": "2024", "name": "apple"}
{"id": "7001", "name": "banana"},
Order By "id.name"
{"id": "2024", "name": "apple"}
{"id": "7001", "name": "banana"},
{"id": "1002", "name": "carrot"},
I really agree,
Construct should add more attention to this plugin, because this plugin is very important in game development
Reviewed guidelines
Checked for duplicate suggestions
JSON expression: JSON.CurIndex
We need an expression like
loopindex
for use in aFor each
loop of a JSON object.Currently, it is necessary to Add a new local variable externally to record it, which is very cumbersome.
Why is this idea important?
This helps to use data structures better.
When Loop in this structure, it is very inconvenient if you want to know which number it is (for example, used to ID for objects in menu).