# C_HousingCustomizeMode: World of Warcraft Forever API

Forever 1.60.1 (70959), Interface 16001, Lua 5.1, from Blizzard's own API documentation. Page: https://wowaddons.gg/forever-api/C_HousingCustomizeMode

## Functions

### C_HousingCustomizeMode.ApplyDyeToSelectedDecor

```lua
C_HousingCustomizeMode.ApplyDyeToSelectedDecor(dyeSlotID, [dyeColorID])
```

If a dyeable decor is selected, applies a specific dye color in a specific slot as a preview; See CommitDyesForSelectedDecor to actually save applied dye changes

Arguments:
- `dyeSlotID`: number
- `dyeColorID`: number, may be nil. If not provided, clears the dye from the specified dye slot, returning that part of the decor asset to its default color

### C_HousingCustomizeMode.ApplyPetToSelectedDecor

```lua
C_HousingCustomizeMode.ApplyPetToSelectedDecor([petID], petBehavior)
```

If a decor is selected that supports pets, applies a specific petID to be shown on that decor

Arguments:
- `petID`: WOWGUID, may be nil
- `petBehavior`: HousingPetBehaviorType

### C_HousingCustomizeMode.ApplyThemeToRoom

```lua
C_HousingCustomizeMode.ApplyThemeToRoom(themeSetID)
```

Attempt to apply a specific theme set (aka style) to all applicable room components in the current room

Arguments:
- `themeSetID`: number

### C_HousingCustomizeMode.ApplyThemeToSelectedRoomComponent

```lua
C_HousingCustomizeMode.ApplyThemeToSelectedRoomComponent(themeSetID)
```

Attempt to apply a specific theme set (aka style) to the currently selected room component only

Arguments:
- `themeSetID`: number

### C_HousingCustomizeMode.ApplyWallpaperToAllWalls

```lua
C_HousingCustomizeMode.ApplyWallpaperToAllWalls(roomComponentTextureRecID)
```

Attempt to apply a specific wallpaper (aka material/texture) to all applicable room components in the current room

Arguments:
- `roomComponentTextureRecID`: number

### C_HousingCustomizeMode.ApplyWallpaperToSelectedRoomComponent

```lua
C_HousingCustomizeMode.ApplyWallpaperToSelectedRoomComponent(roomComponentTextureRecID)
```

Attempt to apply a specific wallpaper (aka material/texture) to the currently selected room component only

Arguments:
- `roomComponentTextureRecID`: number

### C_HousingCustomizeMode.CancelActiveEditing

```lua
C_HousingCustomizeMode.CancelActiveEditing()
```

Cancels all in-progress editing of the selected target, which will reset any unapplied customization changes and deselect the active target

### C_HousingCustomizeMode.ClearDyesForSelectedDecor

```lua
C_HousingCustomizeMode.ClearDyesForSelectedDecor()
```

Clears all previewed dye changes on the selected decor; Does not clear any already saved dyes that were previously applied

### C_HousingCustomizeMode.ClearTargetRoomComponent

```lua
C_HousingCustomizeMode.ClearTargetRoomComponent()
```

Deselect the currently selected room component, if there is one

### C_HousingCustomizeMode.CommitDyesForSelectedDecor

```lua
hasChanges = C_HousingCustomizeMode.CommitDyesForSelectedDecor()
```

Attempt to save all previewed dye changes made to the selected decor

Returns:
- `hasChanges`: bool. True if there were any changes to save

### C_HousingCustomizeMode.GetHoveredDecorInfo

```lua
info = C_HousingCustomizeMode.GetHoveredDecorInfo()
```

Returns info for the placed decor instance currently being hovered, if there is one

Returns:
- `info`: HousingDecorInstanceInfo, may be nil

### C_HousingCustomizeMode.GetHoveredRoomComponentInfo

```lua
info = C_HousingCustomizeMode.GetHoveredRoomComponentInfo()
```

Returns info for the room component currently being hovered, if there is one

Returns:
- `info`: HousingRoomComponentInstanceInfo, may be nil

### C_HousingCustomizeMode.GetNumDyesToRemoveOnSelectedDecor

```lua
numDyesToRemove = C_HousingCustomizeMode.GetNumDyesToRemoveOnSelectedDecor()
```

If a dyeable decor instance is selected, returns how many dye slots would be cleared on applying all currently previewed dye changes

Returns:
- `numDyesToRemove`: number

### C_HousingCustomizeMode.GetNumDyesToSpendOnSelectedDecor

```lua
numDyesToSpend = C_HousingCustomizeMode.GetNumDyesToSpendOnSelectedDecor()
```

If a dyeable decor instance is selected, returns how many dye items would be spent on applying all currently previewed dye changes

Returns:
- `numDyesToSpend`: number

### C_HousingCustomizeMode.GetPreviewDyesOnSelectedDecor

```lua
previewDyes = C_HousingCustomizeMode.GetPreviewDyesOnSelectedDecor()
```

If a dyeable decor instance is selected, returns info structs for each new/changed dye currently being previewed

Returns:
- `previewDyes`: PreviewDyeSlotInfo[]

### C_HousingCustomizeMode.GetRecentlyUsedDyes

```lua
recentDyes = C_HousingCustomizeMode.GetRecentlyUsedDyes()
```

Returns a list of ids for the dyes most recently applied by the player, if any

Returns:
- `recentDyes`: number[]

### C_HousingCustomizeMode.GetRecentlyUsedThemeSets

```lua
recentThemeSets = C_HousingCustomizeMode.GetRecentlyUsedThemeSets()
```

Returns a list of ids for the theme sets (aka styles) most recently applied by the player, if any

Returns:
- `recentThemeSets`: number[]

### C_HousingCustomizeMode.GetRecentlyUsedWallpapers

```lua
recentWallpapers = C_HousingCustomizeMode.GetRecentlyUsedWallpapers()
```

Returns a list of ids for the wallpapers most recently applied by the player, if any

Returns:
- `recentWallpapers`: number[]

### C_HousingCustomizeMode.GetSelectedDecorInfo

```lua
info = C_HousingCustomizeMode.GetSelectedDecorInfo()
```

Returns info for the decor instance that's currently selected, if there is one

Returns:
- `info`: HousingDecorInstanceInfo, may be nil

### C_HousingCustomizeMode.GetSelectedDecorPetInfo

```lua
petID, petBehavior = C_HousingCustomizeMode.GetSelectedDecorPetInfo()
```

If a decor is selected that supports pets, gets petID and behavior type from decor

Returns:
- `petID`: WOWGUID, may be nil
- `petBehavior`: HousingPetBehaviorType

### C_HousingCustomizeMode.GetSelectedRoomComponentInfo

```lua
info = C_HousingCustomizeMode.GetSelectedRoomComponentInfo()
```

Returns info for the currently selected room component, if there is one

Returns:
- `info`: HousingRoomComponentInstanceInfo, may be nil

### C_HousingCustomizeMode.GetThemeSetInfo

```lua
name = C_HousingCustomizeMode.GetThemeSetInfo(themeSetID)
```

Returns the name of the specified theme set (aka style) if it exists

Arguments:
- `themeSetID`: number

Returns:
- `name`: string, may be nil

### C_HousingCustomizeMode.GetWallpapersForRoomComponentType

```lua
availableWallpapers = C_HousingCustomizeMode.GetWallpapersForRoomComponentType(type)
```

Get all wallpapers (aka materials/textures) available for the selected room component type, if any

Arguments:
- `type`: HousingRoomComponentType

Returns:
- `availableWallpapers`: RoomComponentWallpaper[]

### C_HousingCustomizeMode.IsDecorSelected

```lua
hasSelectedDecor = C_HousingCustomizeMode.IsDecorSelected()
```

Returns true if a decor instance is currently selected for customization

Returns:
- `hasSelectedDecor`: bool

### C_HousingCustomizeMode.IsHouseExteriorDoorHovered

```lua
isHouseExteriorDoorHovered = C_HousingCustomizeMode.IsHouseExteriorDoorHovered()
```

Returns true if the entry door of the house's exterior is currently being hovered

Returns:
- `isHouseExteriorDoorHovered`: bool

### C_HousingCustomizeMode.IsHoveringDecor

```lua
isHoveringDecor = C_HousingCustomizeMode.IsHoveringDecor()
```

Returns true if a placed decor instance is currently being hovered

Returns:
- `isHoveringDecor`: bool

### C_HousingCustomizeMode.IsHoveringRoomComponent

```lua
isHovering = C_HousingCustomizeMode.IsHoveringRoomComponent()
```

Returns true if a room component is currently being hovered

Returns:
- `isHovering`: bool

### C_HousingCustomizeMode.IsRoomComponentSelected

```lua
hasSelectedComponent = C_HousingCustomizeMode.IsRoomComponentSelected()
```

Returns true if a room component is currently selected for customization

Returns:
- `hasSelectedComponent`: bool

### C_HousingCustomizeMode.RoomComponentSupportsVariant

```lua
variantSupported = C_HousingCustomizeMode.RoomComponentSupportsVariant(componentID, variant)
```

Check whether a specific room component supports a particular variant; What kind of id or enum 'variant' equates to is complicated, as it depends on the component type

Arguments:
- `componentID`: number
- `variant`: number

Returns:
- `variantSupported`: bool

### C_HousingCustomizeMode.RoomConnectionSupportsDoorType

```lua
doorTypeSupported = C_HousingCustomizeMode.RoomConnectionSupportsDoorType(roomGUID, componentID, newDoortype)
```

Check whether a specific room component, within a specific room, supports a particular doorType

Arguments:
- `roomGUID`: WOWGUID
- `componentID`: number
- `newDoortype`: HousingRoomComponentDoorType

Returns:
- `doorTypeSupported`: bool

### C_HousingCustomizeMode.SetRoomComponentCeilingType

```lua
C_HousingCustomizeMode.SetRoomComponentCeilingType(roomGUID, componentID, ceilingType)
```

Attempt to set a specific ceiling component, within a specific room, to a specific new ceiling type

Arguments:
- `roomGUID`: WOWGUID
- `componentID`: number
- `ceilingType`: HousingRoomComponentCeilingType

### C_HousingCustomizeMode.SetRoomComponentDoorType

```lua
C_HousingCustomizeMode.SetRoomComponentDoorType(roomGUID, componentID, newDoortype)
```

Attempt to set a specific door component, within a specific room, to a specific new door type

Arguments:
- `roomGUID`: WOWGUID
- `componentID`: number
- `newDoortype`: HousingRoomComponentDoorType

## Events

### HOUSING_CUSTOMIZE_MODE_HOVERED_TARGET_CHANGED

Payload, after the event's name:
- `hasHoveredTarget`: bool
- `targetType`: HousingCustomizeModeTargetType

### HOUSING_CUSTOMIZE_MODE_SELECTED_TARGET_CHANGED

Payload, after the event's name:
- `hasSelectedTarget`: bool
- `targetType`: HousingCustomizeModeTargetType

### HOUSING_DECOR_CUSTOMIZATION_CHANGED

Payload, after the event's name:
- `decorGUID`: WOWGUID

### HOUSING_DECOR_DYE_FAILURE

Payload, after the event's name:
- `decorGUID`: WOWGUID
- `housingResult`: HousingResult

### HOUSING_ROOM_COMPONENT_CUSTOMIZATION_CHANGE_FAILED

Payload, after the event's name:
- `roomGUID`: WOWGUID
- `componentID`: number
- `housingResult`: HousingResult

### HOUSING_ROOM_COMPONENT_CUSTOMIZATION_CHANGED

Payload, after the event's name:
- `roomGUID`: WOWGUID
- `componentID`: number

## Tables

### Enum.HousingCustomizeModeTargetType (enumeration)

- `None` = 0
- `Decor` = 1
- `RoomComponent` = 2
- `ExteriorHouse` = 3

### HousingRoomComponentInstanceInfo (structure)

- `roomGUID`: WOWGUID
- `type`: HousingRoomComponentType
- `componentID`: number
- `canBeCustomized`: bool
- `currentThemeSet`: number, may be nil
- `availableThemeSets`: number[]
- `currentWallpaper`: number, may be nil
- `currentRoomComponentTextureRecID`: number, may be nil
- `ceilingType`: HousingRoomComponentCeilingType
- `doorType`: HousingRoomComponentDoorType

### PreviewDyeSlotInfo (structure)

- `dyeColorID`: number
- `dyeSlotID`: number

### RoomComponentWallpaper (structure)

- `name`: cstring
- `roomComponentTextureRecID`: number

---
Make an addon with your AI: tell it "Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it."
