# :tophat: Clothes Wheel
Documentation relating to the jo_radial_clotheswheel.

:::: tabs
::: tab BUY
[Buy the script](https://jumpon-studios.com/redm/clothes-wheel)
:::

::: tab PREVIEW
<iframe width="560" height="315" src="https://www.youtube.com/embed/DfbGIS4tGo8?si=G71Vam6KQBNYn-Bh" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
:::
::::

## 1. Installation

::: warning
[Radial menu script](radial-menu) is required to use this add-on
:::

To install `jo_radial_clotheswheel`:

- Drag and drop the resource in your resources folder
  - jo_radial_clotheswheel
- Add this ensure in your server.cfg after `ensure jo_radial`
  - `ensure jo_radial_clotheswheel`
- Congratulation, the Clothes Wheel script is ready to be used !

## 2. Usage

`jo_radial_clotheswheel` is an **addon for [jo_radial](radial-menu)** — it does not open a wheel on its own. It exposes a single export, `getMenu()`, that builds and returns a list of clothing items ready to be displayed by `jo_radial`. The wheel is rebuilt every time it is opened, so it always reflects the player's current wardrobe and what they are wearing at that moment.

Only clothes the player **owns** appear in the wheel. Each item shows at full opacity when currently worn, and dimmed when owned but not equipped. For supported clothing types (neckwear, shirts, boots, vests, loadouts), a sub-ring appears with extra state options such as rolling up a sleeve, opening a collar, or switching boots over or under the pants.

::: tip
To display the wheel, you need to call `exports.jo_radial_clotheswheel:getMenu()` from inside your `jo_radial` configuration. Two approaches are available depending on your setup.
:::

### Option A : As a submenu inside your radial menu

Use this option if you already have a `jo_radial` menu and want to add the clothes wheel as one entry among others. The `items` function is evaluated fresh each time the player opens that submenu.

```lua
-- In your jo_radial config file (e.g. config/menus.lua)
Config.radialMenuItems = {
  -- ... your other items ...
  {
    label = "Clothes",
    icon = "nui://jo_libs/nui/menu/assets/images/icons/myclothes.png",
    submenu = {
      type = "submenu",
      items = function()
        return exports.jo_radial_clotheswheel:getMenu()
      end
    }
  },
}
```

### Option B : As the only radial menu

Use this option if the clothes wheel should be the entire content of your radial menu. Setting `Config.radialMenuItems` to a function makes `jo_radial` call it on every open, so the wheel is always up to date.

```lua
-- In your jo_radial config file (e.g. config/menus.lua)
Config.radialMenuItems = function()
  return exports.jo_radial_clotheswheel:getMenu()
end
```

## 3. Configuration
The configuration files are located in the `config` folder within the resource. This folder contains two subfolders:

- **`_default.lock/`** - Contains the default configuration files. **Do not edit these files directly** as they may be overwritten during updates.
- **`custom/`** - This is where you place your custom configuration files to override the defaults.

### How to customize the configuration

1. Navigate to `jo_radial_clotheswheel/config/_default.lock/`
2. Copy the file you want to modify (e.g., `prices.lua`)
3. Paste it into `jo_radial_clotheswheel/config/custom/`
4. Edit the copied file in the `custom` folder

The script automatically loads files from `custom/` first, and only uses `_default.lock/` as a fallback. This system ensures your customizations are preserved when updating the script.

### Default configuration files

`jo_radial_clotheswheel/config/_default.lock/animations.lua`

```lua
Config.playAnimation = true -- Play an equip/unequip animation when toggling a clothing item

-- Named animation definitions — reused across categories.
-- Each entry supports: dict, anim, flag, timer, offset
-- Optional `equip` / `unequip` sub-tables override specific fields for each direction.
Config.animationDefs = {
    adjust_belt = {
        dict  = "script_respawn@one_shot@fullbody@generic@unarmed@stand_adjust_belt@a",
        flag  = 24,
        anim  = "respawn_action",
        timer = 1000,
    },
    gloves = {
        dict  = "mech_loco_m@character@arthur@fidgets@item_selection@gloves",
        flag  = 24,
        anim  = "gloves_b",
        timer = 500,
    },
    hat = {
        dict   = "mech_respawn@nap_grnd",
        anim   = "getup_v1_player",
        offset = 0.6,
        timer  = 900,
        flag   = 24,
        equip  = { timer = 800 },
    },
    boots = {
        dict  = "script_respawn@one_shot@fullbody@generic@unarmed@stand_boot_clean@a",
        anim  = "respawn_action",
        timer = 500,
    },
    bandana = {
        dict    = "mech_inventory@clothing@bandana",
        flag    = 24,
        equip   = { anim = "neck_2_satchel", timer = 1000 },
        unequip = { anim = "satchel_2_neck", timer = 2000 },
    },
    mask = {
        dict    = "mech_inventory@clothing@mask",
        flag    = 24,
        equip   = { anim = "face_2_satchel", timer = 1000 },
        unequip = { anim = "satchel_2_face", timer = 2000 },
    },
    eyewear = {
        dict  = "amb_wander@code_human_wander@male@generic",
        flag  = 24,
        anim  = "wipe_eyes_02",
        timer = 1000,
    },
}

-- Per-category animation mapping — values must be keys of Config.animationDefs.
Config.animations = {
    -- Belt / Holsters / Loadout → adjust_belt
    gunbelts                = "adjust_belt",
    gunbelt_accs            = "adjust_belt",
    belts                   = "adjust_belt",
    belt_buckles            = "adjust_belt",
    holsters_left           = "adjust_belt",
    holsters_right          = "adjust_belt",
    holsters_center         = "adjust_belt",
    holsters_crossdraw      = "adjust_belt",
    holsters_knife          = "adjust_belt",
    holsters_quivers        = "adjust_belt",
    loadouts                = "adjust_belt",
    outfits                 = "adjust_belt",
    suspenders              = "adjust_belt",

    -- Upper body → adjust_belt
    shirts_full             = "adjust_belt",
    shirts_full_overpants   = "adjust_belt",
    chemises                = "adjust_belt",
    unionsuit_legs          = "adjust_belt",
    unionsuits_full         = "adjust_belt",
    coats                   = "adjust_belt",
    coats_closed            = "adjust_belt",
    coat_accessories        = "adjust_belt",
    coats_heavy             = "adjust_belt",
    vests                   = "adjust_belt",
    vest_accessories        = "adjust_belt",
    corsets                 = "adjust_belt",
    dresses                 = "adjust_belt",
    knickers                = "adjust_belt",
    shawls                  = "adjust_belt",
    aprons                  = "adjust_belt",
    overalls_full           = "adjust_belt",
    overalls_modular_uppers = "adjust_belt",
    ponchos                 = "adjust_belt",
    cloaks                  = "adjust_belt",
    armor                   = "adjust_belt",

    -- Bags / Accessories → adjust_belt
    satchels                = "adjust_belt",
    satchel_straps          = "adjust_belt",
    accessories             = "adjust_belt",
    badges                  = "adjust_belt",

    -- Lower body / Feet → boots
    pants                   = "boots",
    pants_accessories       = "boots",
    skirts                  = "boots",
    overalls_modular_lowers = "boots",
    chaps                   = "boots",
    spats                   = "boots",
    boots                   = "boots",
    boot_accessories        = "boots",
    ankle_bindings          = "boots",

    -- Hands / Arms → gloves
    gloves                  = "gloves",
    gauntlets               = "gloves",
    wrist_bindings          = "gloves",
    jewelry_rings           = "gloves",
    jewelry_rings_left      = "gloves",
    jewelry_rings_right     = "gloves",
    jewelry_bracelets       = "gloves",

    -- Head → hat
    hats                    = "hat",
    hat_accessories         = "hat",
    headwear                = "hat",
    hair_accessories        = "hat",
    jewelry_earrings        = "hat",

    -- Neck → bandana
    neckwear                = "bandana",
    neckties                = "bandana",
    jewelry_necklaces       = "bandana",
    neckerchiefs            = "bandana",

    -- Face → mask
    masks                   = "mask",
    masks_large             = "mask",

    -- Eyes → eyewear
    eyewear                 = "eyewear",
}
```

`jo_radial_clotheswheel/config/_default.lock/global.lua`

```lua
Config.showLabel = true   -- Show the category name beneath each icon on the wheel
Config.keepOpen = false   -- Keep the radial open after using a clothes action

Config.allowedClothes = { -- Set a category to false to hide it from the wheel entirely
    -- Virtual meta-item
    ["outfit"]                  = true,

    -- Torso / upper
    ["shirts_full"]             = true,
    ["shirts_full_overpants"]   = true,
    ["chemises"]                = true,
    ["unionsuit_legs"]          = true,
    ["unionsuits_full"]         = true,
    ["coats"]                   = true,
    ["coats_closed"]            = true,
    ["coat_accessories"]        = true,
    ["coats_heavy"]             = true,
    ["vests"]                   = true,
    ["vest_accessories"]        = true,
    ["corsets"]                 = true,
    ["dresses"]                 = true,
    ["knickers"]                = true,
    ["shawls"]                  = true,
    ["aprons"]                  = true,
    ["overalls_full"]           = true,
    ["overalls_modular_uppers"] = true,

    -- Lower
    ["pants"]                   = true,
    ["pants_accessories"]       = true,
    ["skirts"]                  = true,
    ["overalls_modular_lowers"] = true,
    ["chaps"]                   = true,
    ["spats"]                   = true,

    -- Outerwear
    ["ponchos"]                 = true,
    ["cloaks"]                  = true,

    -- Feet
    ["boots"]                   = true,
    ["boot_accessories"]        = true,
    ["ankle_bindings"]          = true,

    -- Hands / Arms
    ["gloves"]                  = true,
    ["gauntlets"]               = true,
    ["wrist_bindings"]          = true,

    -- Belt / Holsters / Loadout
    ["belts"]                   = true,
    ["belt_buckles"]            = true,
    ["gunbelts"]                = true,
    ["gunbelt_accs"]            = true,
    ["holsters_left"]           = true,
    ["holsters_right"]          = true,
    ["holsters_center"]         = true,
    ["holsters_crossdraw"]      = true,
    ["holsters_knife"]          = true,
    ["holsters_quivers"]        = true,
    ["loadouts"]                = true,
    ["outfits"]                 = true,

    -- Bags / Accessories
    ["satchels"]                = true,
    ["satchel_straps"]          = true,
    ["accessories"]             = true,
    ["suspenders"]              = true,
    ["badges"]                  = true,

    -- Neck / Face
    ["neckwear"]                = true,
    ["neckties"]                = true,
    ["neckerchiefs"]            = true,
    ["masks"]                   = true,
    ["masks_large"]             = true,
    ["eyewear"]                 = true,

    -- Head
    ["hats"]                    = true,
    ["hat_accessories"]         = true,
    ["headwear"]                = true,
    ["hair_accessories"]        = true,

    -- Jewelry
    ["jewelry_rings"]           = true,
    ["jewelry_rings_left"]      = true,
    ["jewelry_rings_right"]     = true,
    ["jewelry_bracelets"]       = true,
    ["jewelry_earrings"]        = true,
    ["jewelry_necklaces"]       = true,

    -- Armor
    ["armor"]                   = true,
}
```

`jo_radial_clotheswheel/config/_default.lock/lang.lua`

```lua
-- * ======================================
-- *  GENERAL
-- * ======================================

-- Subitem action labels — each describes what clicking will do (not the current state)
Lang.Off              = "Off"
Lang.On               = "On"
Lang.Up               = "Up" -- neckwear: move bandana up
Lang.Down             = "Down" -- neckwear: move bandana down / sleeve: unroll
Lang.Open             = "Open" -- shirt collar
Lang.Close            = "Close" -- shirt collar
Lang.Over             = "Over" -- boots/vests: wear over pants
Lang.Under            = "Under" -- boots/vests: wear under pants
Lang.Left             = "Left" -- loadout side
Lang.Right            = "Right" -- loadout side
Lang.notAllowedToOpen = "You're not allowed to open the clothes wheel"

-- * ======================================
-- *  CLOTHES CATEGORIES
-- * ======================================

Lang.outfit = "Outfit"
-- Native clothes
Lang.accessories = "Accessories"
Lang.armor = "Armor"
Lang.badges = "Badges"
Lang.belt_buckles = "Gunbelt Buckles"
Lang.belts = "Belts"
Lang.boot_accessories = "Boot accessories"
Lang.boots = "Boots"
Lang.chaps = "Chaps"
Lang.cloaks = "Cloaks"
Lang.coats = "Coats"
Lang.coats_closed = "Coats closed"
Lang.dresses = "Dresses"
Lang.eyewear = "Eyewear"
Lang.gauntlets = "Gauntlets"
Lang.gloves = "Gloves"
Lang.gunbelt_accs = "Gunbelt Accessories"
Lang.gunbelts = "Gunbelts"
Lang.hats = "Hats"
Lang.holsters_left = "Holsters left"
Lang.jewelry_bracelets = "Jewelry Bracelets"
Lang.jewelry_rings_left = "Rings left"
Lang.jewelry_rings_right = "Rings right"
Lang.loadouts = "Loadouts"
Lang.masks = "Masks"
Lang.masks_large = "Large Masks"
Lang.neckerchiefs = "Neckerchiefs"
Lang.neckties = "Neckties"
Lang.neckwear = "Neckwear"
Lang.outfit = "Outfit"
Lang.pants = "Pants"
Lang.ponchos = "Ponchos"
Lang.satchels = "Satchels"
Lang.shirts_full = "Shirts"
Lang.skirts = "Skirts"
Lang.spats = "Spats"
Lang.suspenders = "Suspenders"
Lang.vests = "Vests"
-- NPC Clothes
Lang.ankle_bindings = "Ankle Bindings"
Lang.aprons = "Aprons"
Lang.chemises = "Chemises"
Lang.coat_accessories = "Coat Accessories"
Lang.coats_heavy = "Heavy Coats"
Lang.corsets = "Corsets"
Lang.hat_accessories = "Hat Accessories"
Lang.headwear = "Headwear"
Lang.holsters_center = "Holsters Center"
Lang.holsters_crossdraw = "Holsters Crossdraw"
Lang.holsters_knife = "Knife Holsters"
Lang.holsters_quivers = "Quivers"
Lang.holsters_right = "Right Holsters"
Lang.jewelry_earrings = "Earrings"
Lang.jewelry_necklaces = "Necklaces"
Lang.jewelry_rings = "Rings"
Lang.knickers = "Knickers"
Lang.masks_large = "Large Masks"
Lang.outfits = "Outfits"
Lang.overalls_full = "Full Overalls"
Lang.overalls_modular_lowers = "Modular Overalls (Lowers)"
Lang.overalls_modular_uppers = "Modular Overalls (Uppers)"
Lang.pants_accessories = "Pants Accessories"
Lang.satchel_straps = "Satchel Straps"
Lang.shawls = "Shawls"
Lang.shirts_full_overpants = "Shirts (Over Pants)"
Lang.unionsuit_legs = "Union Suit Legs"
Lang.unionsuits_full = "Full Union Suits"
Lang.vest_accessories = "Vest Accessories"
Lang.wrist_bindings = "Wrist Bindings"
```

## 4. For developers

### Filters

[Filters](/DeveloperResources/filters) allow you to modify data or permissions synchronously at specific points in the script. Below is the complete list of `jo_radial_clotheswheel` filters and how to use them.

#### `[Client]` canOpenWheel
Fired before open the clothes wheel
```lua
-- @param canAccess - boolean
exports.jo_radial_clotheswheel:registerFilter('canOpenWheel', function(canAccess)
  --return false to disable the access of the wheel
  return canAccess
end)

```
