local assets =
{
    Asset("ANIM", "anim/wax_paper.zip"),
}

local function onopen(inst)
	inst.SoundEmitter:PlaySound("dontstarve/wilson/backpack_open", "open")
end

local function onclose(inst)
	inst.SoundEmitter:PlaySound("dontstarve/wilson/backpack_close", "open")
end


local slotpos = {}

for y = 0, 3 do
	table.insert(slotpos, Vector3(-162 +(75/2), -y*75 + 114 ,0))
end

local widgetbuttoninfo = {
    text = "´ò°ü",
    position = Vector3(-125, -40, 0),
    fn = function(inst)


	end
}

local function fn(Sim)
	local inst = CreateEntity()

	inst.entity:AddTransform()
	inst.entity:AddAnimState()
	inst.entity:AddSoundEmitter()
    MakeInventoryPhysics(inst)

    inst.AnimState:SetBuild("wax_paper")
    inst.AnimState:SetBank("wax_paper")
    inst.AnimState:PlayAnimation("idle")

	inst.entity:AddMiniMapEntity()
	inst.MiniMapEntity:SetIcon( "wax_paper.tex" )

    inst:AddComponent("inspectable")

    inst:AddComponent("inventoryitem")
    inst.components.inventoryitem.cangoincontainer = true
    inst.components.inventoryitem.imagename = "wax_paper"
    inst.components.inventoryitem.atlasname = "images/inventoryimages/wax_paper.xml"
    inst.components.inventoryitem.foleysound = "dontstarve/movement/foley/krampuspack"

    inst:AddComponent("container")
    inst.components.container:SetNumSlots(#slotpos_1x4)
    inst.components.container.widgetslotpos = slotpos_1x4
    inst.components.container.widgetanimbank = "ui_thatchpack_1x4"
    inst.components.container.widgetanimbuild = "ui_thatchpack_1x4"
    inst.components.container.widgetpos = Vector3(-5,-70,0)
    inst.components.container.itemtestfn = yuyitest
    inst.components.container.side_widget = true
    inst.components.container.side_align_tip = 160
    inst.components.container.itemtestfn = itemtest
    inst.components.container.widgetbuttoninfo = widgetbuttoninfo
    inst.components.container.canbeopened = true

	inst:AddComponent("characterspecific")
    inst.components.characterspecific:SetOwner("yuyi")

	if not IsDLCEnabled(REIGN_OF_GIANTS) then MakeInventoryFloatable(inst, "idle_water", "anim") end
    inst.components.container.onopenfn = function(inst) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") end
    inst.components.container.onclosefn = function(inst) GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") end

    return inst
end

return Prefab( "common/inventory/waxpaper", fn, assets)