Properly selecting items from the quickbar via mod
Posted: Thu Nov 30, 2017 8:41 am
I'm working on a mod to add a keybinding to quickly swap between related items (e.g. transport belt -> splitter -> underground belt, or transport belt -> fast transport belt -> express transport belt). It's my first foray into Factorio modding, but I have some (outdated) Lua knowledge and a solid software development background.
I've figured out how to change what's under the cursor (via LuaControl.cursor_stack.swap_item, for instance) and how to clear it, but I haven't found the appropriate functionality to properly select an item from the quickbar (in such a way that "Q" returns it to that slot of the quickbar and it shows with the hand over it).
Is this possible at all under the current modding API? If so, how might I accomplish it?
I've figured out how to change what's under the cursor (via LuaControl.cursor_stack.swap_item, for instance) and how to clear it, but I haven't found the appropriate functionality to properly select an item from the quickbar (in such a way that "Q" returns it to that slot of the quickbar and it shows with the hand over it).
Is this possible at all under the current modding API? If so, how might I accomplish it?