add pin feature for production lines#441
Conversation
# Conflicts: # changelog.txt
| local model, block, recipe = self:getParameterObjects() | ||
|
|
||
| if block == nil then return end | ||
| if block == nil and (event.item3 ~= nil and event.item3:find("^block_")) then |
There was a problem hiding this comment.
Can you please explain to me what this is doing and why?
There was a problem hiding this comment.
If there is no Block given, the pin function could be called from production line view. It checks if that pin-button contained information in item3 about the needed information to find the correct production line.
Would need to debug now, to see what exactly is saved in blocks. Can do that on Monday. Should have added comments, I guess it's because I added block _id's to the buttons. There was a good reason why I did that, just can't remember now.
There was a problem hiding this comment.
If the pin-panel is opened without a block selected, but with the whole production line the block will always be nil.
So when for example using the pipet function, the block needs to be set. Item3 holds the block id which I double check, because when opening the pin-panel, block needs to be nil and item3 has a different string (if i remember correctly)
Pin-Button is displayed when production-line is selected.
When clicked, all blocks are added to the pin-gui.