require 'ui/uiHelpers' TakeInventoryActionOptions = {}; TakeInventoryActionOptions.ui = { render = function(elementData, element) element:DrawTextRight("Item to grab:", 110, 7, 1,1,1,1); end, itemAData = {}, onPlaceItemPrimary = function(elementData, item) print("Setting primary option to "..item:getFullType()); elementData.parentData.action.itemPrimary = InventoryItemFactory.CreateItem(item:getFullType()); end, doCreation = function(self) self.itemA = VirtualItemSlot.new("TakeInventoryActionPrimary", 130, 0, "ItemBackground_Blue", getPlayer()); self.itemAData.parentData = self; self.itemAData.onPlaceItem = self.onPlaceItemPrimary; self.itemA:setTable(self.itemAData); self.javaObject:AddChild(self.itemA); end, x = 5, y = 32, width = 200, height = 130; };