local transportAppliance = {}

transportAppliance["fixtures_bathroom_01_28"] = {"ATA2.TransportMedicine",}
transportAppliance["fixtures_bathroom_01_29"] = {"ATA2.TransportMedicine",}
transportAppliance["fixtures_bathroom_01_28"] = {"ATA2.TransportMedicine",}
transportAppliance["fixtures_bathroom_01_37"] = {"ATA2.TransportMedicine",}
transportAppliance["fixtures_bathroom_01_38"] = {"TransportMedicine",}

transportAppliance["appliances_cooking_01_0"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_1"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_2"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_3"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_4"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_5"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_6"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_7"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_8"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_9"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_10"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_11"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_12"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_13"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_14"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_15"] = {"ATA2.TransportOven",}

transportAppliance["appliances_cooking_01_20"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_21"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_22"] = {"ATA2.TransportOven",}
transportAppliance["appliances_cooking_01_23"] = {"ATA2.TransportOven",}

transportAppliance["appliances_cooking_01_24"] = {"ATA2.TransportMicrowave",}
transportAppliance["appliances_cooking_01_25"] = {"ATA2.TransportMicrowave",}
transportAppliance["appliances_cooking_01_26"] = {"ATA2.TransportMicrowave",}
transportAppliance["appliances_cooking_01_27"] = {"ATA2.TransportMicrowave",}
transportAppliance["appliances_cooking_01_28"] = {"ATA2.TransportMicrowave",}
transportAppliance["appliances_cooking_01_29"] = {"ATA2.TransportMicrowave",}
transportAppliance["appliances_cooking_01_30"] = {"ATA2.TransportMicrowave",}
transportAppliance["appliances_cooking_01_31"] = {"ATA2.TransportMicrowave",}


transportAppliance["appliances_refrigeration_01_0"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_1"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_2"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_3"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_4"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_5"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_6"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_7"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_8"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_9"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_10"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_11"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_12"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_13"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_14"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_15"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}

transportAppliance["appliances_refrigeration_01_22"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_23"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_24"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_25"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_26"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_27"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_28"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_29"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_30"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_31"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_32"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_33"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_34"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_35"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_36"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_37"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}

transportAppliance["appliances_refrigeration_01_40"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_41"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_42"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}
transportAppliance["appliances_refrigeration_01_43"] = {"ATA2.TransportFridge", "ATA2.TransportFreezer"}


ISInventoryMenuElements = ISInventoryMenuElements or {};

function ISInventoryMenuElements.TCContextMovable()
    local self 					= ISMenuElement.new();
    self.invMenu			    = ISContextManager.getInstance().getInventoryMenu();

    function self.init()
    end

    function self.createMenu( _item )
        if instanceof(_item, "Moveable") then
            if _item:getContainer() ~= self.invMenu.inventory then
                return;
            end
            if self.invMenu.player:getPrimaryHandItem() ~= _item and self.invMenu.player:getSecondaryHandItem() ~= _item then
				if transportAppliance[_item:getWorldSprite()] then
                    for _, newItemName in ipairs(transportAppliance[_item:getWorldSprite()]) do
                        local scriptItem = getItem(newItemName);
                        if scriptItem then
                            self.invMenu.context:addOption(getText("ContextMenu_TCConvertAppliance", scriptItem:getDisplayName()), self.invMenu, self.createTransportItem, _item, newItemName);
                        else
                            print('tsarLib ERROR item type not recognized '..tostring(newItemName))
                        end
                    end
                end                
            end
        end
    end

    function self.createTransportItem( _p, _item, newItemName )
        ISTimedActionQueue.add(TCISConvertAppliance:new(_p.player, _item, newItemName))
    end
    return self;
end

