A little question about stockpiles and lua.
As I can see in stockflow.lua - stockpile is a bunch of tiles with special flags.
So, if I want to get all items in selected stockpile - I must flow through all "df.global.world.items.all" and compare their position/on_ground with coords of my stockpile' tiles?
There's no easiest way?
There are more optimized ways than the method stockflow uses, but I haven't found an easier one. Granted, stockflow is also interested in how many spaces are available for new items; most stockpile applications would be happy with a simple list of stored items.
For example, autotrade.cpp goes through a list of IN_PLAY items and checks each one against a list of stockpiles it cares about. But that check involves comparing the item's coordinates with the stockpile's extents. It also omits checking the stockpile settings, where stockflow makes a token attempt to ignore stone at the very least.
It should also be possible to to speed things up even more by checking the items vector of each overlapping 16x16 map block, but that requires some calculations. It may well be worthwhile to add a function that does so to DFHack, where it can become the obvious way to check stockpile contents. Doing so as
an iterator would be ideal, but requires a bit more C++ hackery than I'm familiar with.
There is an unnamed vmethod in df.buildings.xml, and several in df.items.xml; perhaps one of them might be helpful. Unfortunately, there are also vmethods that sound related, but aren't: stockpile.getFreeCapacity, stockpile.canStoreItem, item.getStockpile, item.isAssignedToStockpile, item.isAssignedToThisStockpile, item.getStockpile2, and probably others.
No, you're right, the layout changed. In .34, the Done line was always on line 23, and the links started some number of lines from the bottom and worked their way up. Yes, that means that even the default interface had collisions for certain screen sizes, and stockflow was well positioned up near the main menu.
Now in .40, the Done line is always near the bottom, and the links start just below the main menu and work their way down, paging before they would hit the Done line. Nicer overall, but subtle enough that you don't notice the difference unless something else is being drawn on top.
... which means it is overwritten by dfhack now:
j: no job selected
overwrites the second link
Yes, that's exactly what pull request #290 fixes. I'm hoping to see it in the next DFHack release, which might be a bit due to the new fields in 0.40.09 making alignment tricky again.
Until then, feel free to
disable stockflow when you need to see the overwritten link(s).