Outfit Switcher (1.2.3)
# Outfit Switcher
*by @Kreksar5 and Claude.ai*
> **AI-ASSISTED ADDON.** Written with Claude.ai and has not yet been
> independently validated in-game for correctness or performance. This
> notice will be removed once the addon has seen real play-testing.
A tiny ESO addon that lets you swap between your unlocked outfit slots with a
single slash command.
## Usage
“`
/outfit
“`
– `/outfit 1` switches to outfit slot 1.
– If you type a slot number higher than what your account has unlocked, the
addon tells you how many slots you actually have and does nothing else.
– If you type anything that isn’t a positive whole number (letters, decimals,
`0`, negative numbers, empty input, etc.), the addon tells you what’s wrong
instead of erroring or silently failing.
– Works identically in keyboard and gamepad mode. Feedback is both printed to
chat and raised as an on-screen alert, so you’ll see it even if your chat
window is closed (common in gamepad play).
## Requirements
– The Outfit System (Update 17 / “Homestead”, 2017) must be available it
is on all live accounts today.
– No dependencies, no SavedVariables, no settings menu. Nothing to configure.
## How it works
| Step | Function used |
|—|—|
| Check how many outfit slots are unlocked | `GetNumUnlockedOutfits()` |
| Swap to a given slot | `EquipOutfit(GAMEPLAY_ACTOR_CATEGORY_PLAYER, outfitIndex)` |
| Confirm what actually happened | `EVENT_OUTFIT_EQUIP_RESPONSE` (`EquipOutfitResult`) |
| Show feedback in both keyboard and gamepad mode | `ZO_Alert(category, soundId, message)` |
`ZO_Alert` automatically routes to the gamepad or keyboard alert-text system
depending on which UI mode is currently active, so there’s no need for
separate gamepad/keyboard code paths in an addon this small.
`EquipOutfit` doesn’t succeed or fail synchronously the game confirms the
result asynchronously via `EVENT_OUTFIT_EQUIP_RESPONSE`. The addon tracks
which slot it just requested and reports the confirmed outcome once that
event fires: success, already-equipped, invalid slot, locked slot, or outfit
switching being unavailable right now (e.g. certain restricted situations).
## Verification notes
Per the usual standard for this addon family: every API call below was
confirmed against the ESOUI wiki, the Update 17 API patch notes, and/or the
`esoui/esoui` GitHub source before being used nothing here is guessed.
– `GetNumUnlockedOutfits()` confirmed via Update 17 API patch notes.
– `EquipOutfit(actorCategory, outfitIndex)` confirmed via ESOUI wiki API page.
– `GAMEPLAY_ACTOR_CATEGORY_PLAYER` confirmed via `esoui/esoui` source
(`interactwindow_shared.lua`).
– `ZO_Alert`, `UI_ALERT_CATEGORY_ERROR`, `UI_ALERT_CATEGORY_ALERT` confirmed
via `esoui/esoui` source (`interactwindow_shared.lua`,
`tradinghouse_keyboard.lua`).
– `SOUNDS.NEGATIVE_CLICK`, `SOUNDS.POSITIVE_CLICK` confirmed via ESOUI
wiki Sounds page.
– `zo_strtrim` confirmed via `esoui/esoui` source (`localization.lua`).
– `EVENT_OUTFIT_EQUIP_RESPONSE` and the `EquipOutfitResult` enum values
(`EQUIP_OUTFIT_RESULT_SUCCESS`, `_OUTFIT_ALREADY_EQUIPPED`, `_OUTFIT_INVALID`,
`_OUTFIT_LOCKED`, `_OUTFIT_SWITCHING_UNAVAILABLE`) confirmed via ESOUI
wiki Events page and `esoui/esoui`’s `ESOUIDocumentation.txt`.
## Known limitations
– `EVENT_OUTFIT_EQUIP_RESPONSE` doesn’t report which outfit index it’s
responding to, so the addon tracks the last-requested slot itself and
assumes the response belongs to it. If something else in the game or
another addon triggers its own outfit equip in the brief window before the
response arrives, the reported slot number in the message could be wrong
(the success/failure state itself would still be accurate).
## Changelog
### 1.2.3
– **Standardized the author credit** to `@Kreksar5 and Claude.ai` in the
`## Author` manifest field and this README’s byline, and named Claude.ai
specifically (rather than generic “AI assistance”) in the manifest
description and the AI-assistance disclosure above, matching the crediting
convention used across this addon’s companion libraries.
### 1.2.2
– **Added the required AI-assistance disclosure** to the manifest description
and this README, per ESOUI’s addon release rules.
### 1.2.1
– **Full API audit against the official ESOUI API 101050 documentation.**
Every function call, method call, and constant referenced in the addon
was cross-checked against the API doc and, where the doc didn’t cover it
(manager singletons, `ZO_` helpers), against the live ESOUI source. No
invalid or deprecated API usage found `EVENT_OUTFIT_EQUIP_RESPONSE`,
`ZO_Alert`, `zo_strtrim`, and `SOUNDS.POSITIVE_CLICK`/`NEGATIVE_CLICK` are
all legitimate and correctly used. No code changes required.
### 1.2.0
– Hooked `EVENT_OUTFIT_EQUIP_RESPONSE` so feedback now reflects the game’s
actual confirmed result instead of assuming `EquipOutfit` succeeded.
Distinct messages are shown for success, already-equipped, invalid slot,
locked slot, and outfit-switching-unavailable.
– Merged the changelog into this README.
### 1.1.0
– Added gamepad support: feedback messages now also raise a `ZO_Alert`
on-screen notification (via `UI_ALERT_CATEGORY_ALERT` / `_ERROR` and
`SOUNDS.POSITIVE_CLICK` / `NEGATIVE_CLICK`) alongside the existing chat
print, so the addon is fully usable when playing in gamepad mode with
the chat window closed. No separate gamepad/keyboard code path was
needed `ZO_Alert` handles that routing internally.
– Hardened `/outfit` argument parsing:
– Input is trimmed with `zo_strtrim` before validation.
– Only plain, optionally-signed integers are accepted
(`^?%d+$`); decimals, hex, exponents, and stray characters are
rejected with an explicit message instead of being silently floored
or misparsed.
– `0` and negative numbers are rejected with a dedicated message
(“Slot number must be 1 or higher”) rather than falling through to
the generic “not enough slots” message.
– Empty input (`/outfit` with no argument) now shows a usage message.
– Added README and changelog (changelog later merged into this file in 1.2.0).
### 1.0.0
– Initial release.
– `/outfit ` slash command switches to the given outfit slot via
`EquipOutfit(GAMEPLAY_ACTOR_CATEGORY_PLAYER, outfitIndex)`.
– Checks unlocked slot count via `GetNumUnlockedOutfits()` and refuses to
switch to a slot beyond what’s unlocked.
– Basic non-numeric input handling (via `tonumber`).

