> For the complete documentation index, see [llms.txt](https://codestudio5m.gitbook.io/codestudio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codestudio5m.gitbook.io/codestudio/our-scripts/radial-menu/setup.md).

# Setup

This is a detailed setup guide for Radial Menu. If you have any questions before making a purchase, you can contact us on Discord

## Configuration

### General

```lua
CodeStudio = {}

CodeStudio.Keybind = 'F1'           --FiveM Keyboard, this is registered keymapping, so you can change in keybindings
CodeStudio.Toggle = true            --Toggle mode. False requires hold of key
CodeStudio.UseWalking = false       --You can use the menu while walking
CodeStudio.Blur = true              --Toggle Blur
CodeStudio.Moving_Background = true    --Toggle Background Moving Circles 
```

### Usage example

{% hint style="success" %}
When looking at the config it can be intimidating but read this format and it will help!
{% endhint %}

```lua
CodeStudio.Menus = { -- this is the main table for the menu
    [1] = { -- index of the menu option, this must be in order numerically
        id = 'mainmenu', -- id of the menu option, this must be unique!
        title = 'Main Menu Option', -- title shown on the menu option
        icon = 'fas fa-user', -- Supports Font Awesome
        submenu = { -- anything in the items table is considered a sub menu!
            {
                id = 'submenu',
                title = 'Sub Menu Option',
                icon = 'fas fa-circle',
                type = '', -- event type to call, client/server/command
                event = '', -- event name to call or command name to call
                shouldClose = true -- enable/disable menu closing on click
            },
            { -- example of adding another sub menu item
                id = 'submenu2',
                title = 'Another Sub Menu',
                icon = 'fas fa-circle',
                submenu = { -- example of adding a sub menu inside a sub menu
                    {
                        id = 'nestedsubmenu',
                        title = 'Nested Sub Menu Option',
                        icon = 'fas fa-circle',
                        type = '', -- event type to call, client/server/command
                        event = '', -- event name, command name
                        shouldClose = true -- enable/disable menu closing on click
                    }
                }
            },
        }
    },
    [2] = { -- example of adding another main menu item
        id = 'mainmenu2',
        title = 'Another main menu item',
        icon = 'bars',
        items = {
            {
                id = 'submenu3',
                title = 'Sub Menu',
                icon = 'fas fa-circle',
                type = '',
                event = '',
                shouldClose = true
            },
        }
    },
    [3] = { -- example of adding job/work menu item
        id = 'mainmenu3',
        title = 'Work Menu',
        workMenu = true,    --Put workMenu = true to whichever menu you want to make work menu
        icon = 'fas fa-circle',
        submenu = true,     --Put this true and Edit CodeStudio.WorkMenu For this
    }
}

```

* Events Triggered When <br>

  <pre class="language-lua" data-title="Openning of Menu"><code class="lang-lua">TriggerEvent('cs_radialmenu:client:onRadialmenuOpen')
  </code></pre>

  <pre class="language-lua" data-title="Closing of Menu" data-full-width="true"><code class="lang-lua">TriggerEvent('cs_radialmenu:client:onRadialmenuClose')
  </code></pre>

* Export To Add & Remove Menu Items\
  *<mark style="color:red;">\[With this, you can add new options to the radial menu from other resources and remove them as needed]</mark>*<br>

  ```lua
  exports['cs_radialmenu']:AddOption({
      id = 'put_up_vehicle',  -- id of the menu option, this must be unique!
      title = 'Park Vehicle', -- title shown on the menu option
      icon = 'fa-image',  -- Supports Font Awesome
      type = 'client', -- event type to call, client/server/command
      event = 'qb-garages:client:ParkVehicle',  -- event name, command name
      shouldClose = true  -- enable/disable menu closing on click
  })

  exports['cs_radialmenu']:RemoveOption('put_up_vehicle')
  ```
