# OX Inventory

## Usage

The `xmas_gift` item in your inventory functions as a container. Open it, place items inside, right-click on it, press *Pack* and a input dialog will open where you can enter your nametag. After confirmation, you will receive a wrapped gift.

## Setup

1. Go to `ox_inventory/modules/items/containers.lua`
2. Insert this code at the end of the file, you can change slots count and maxWeight to your needs:

```lua
setContainerProperties('xmas_gift', {
    slots = 5,
    maxWeight = 4000,
    blacklist = { 'xmas_gift', 'xmas_packed_gift' }
})

return containers
```

3. Go to `ox_inventory/data/items.lua`
4. Insert these items:

```lua
    ['xmas_gift'] = {
        label = 'Unpacked Gift',
        weight = 100,
        stack = false,
        close = true,
        consume = 0,
        server = {
            export = 'rcore_xmas.xmas_gift'
        },
        buttons = {
            {
                label = 'Pack',
                action = function(slot)
                    TriggerEvent('rcore_xmas:gifts:nametag', slot)
                end
            }
        }
    },

    ['xmas_packed_gift'] = {
        label = 'Packed Gift',
        weight = 250,
        stack = false,
        close = true,
        consume = 0,
        server = {
            export = 'rcore_xmas.xmas_packed_gift',
        }
    },

    ['xmas_tree'] = {
        label = 'Christmas Tree',
        weight = 350,
        stack = true,
        close = true,
        consume = 0,
        server = {
            export = 'rcore_xmas.xmas_tree'
        }
    },

    ['xmas_star'] = {
        label = 'Christmas Star',
        weight = 50,
        stack = true,
        close = true,
        consume = 0,
        export = 'rcore_xmas.xmas_star'
    },

    ['xmas_decor'] = {
        label = 'Christmas Decor',
        weight = 50,
        stack = true,
        close = true,
        consume = 0,
        export = 'rcore_xmas.xmas_decor'
    }
```

5. Copy images from `rcore_xmas/assets/inventory_images/` to `ox_inventory/web/images/`
6. Go to server console and type `ensure ox_inventory`, `ensure rcore_xmas`
