#Condition for adding action to MenuBar
13 messages · Page 1 of 1 (latest)
should be
MenuBar.addAction({
...
condition: () => Format?.id != "image"
}, ...)
Thank you
!close
Channel closed ----------
Do you know if there is some documentation of what the format IDs are? Because I'm trying to make a plugin only become available in a generic model, but apparently generic isn't the ID
I used condition: {features: ['meshes']} - I guess that's the best in my case?
Generic has an id that is called 'free' in code. You can use condition: {formats: ['free']} or condition: () => Format && Format.id == 'free'
..
There is not really a full documentation about conditions, but the best way now is to read the condition handler.
https://github.com/JannisX11/blockbench/blob/master/js/util.js#L30
Channel closed ----------
for future reference you can run js Object.keys(Formats) in the console to list all the IDs