Page 1 of 1

LuaInventory::set_selected_index()

Posted: Mon Oct 15, 2018 5:21 am
by dewiniaid
Per an older request, LuaInventory::get_selected_index() was implemented in order to determine which item (if any) was selected on the quickbar.

It would be useful to have a counterpart LuaInventory::set_selected_index(), which should for all intents and purposes function the same as pressing one of the keybindings to store something on the quickbar.

Simply assigning the item in question to the cursor stack has slightly different semantics -- namely when the item is dropped later. An item selected from an (unfiltered) quickbar slot returns to that slot (since it never technically left it), whereas an item that was simply moved to the cursor stack returns to the first available quickbar slot or the inventory.