# C_HousingLayout: 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_HousingLayout

## Functions

### C_HousingLayout.AnyRoomsOnFloor

```lua
anyRooms = C_HousingLayout.AnyRoomsOnFloor(floor)
```

Arguments:
- `floor`: number

Returns:
- `anyRooms`: bool

### C_HousingLayout.CanSetViewedFloor

```lua
canSet = C_HousingLayout.CanSetViewedFloor(floor)
```

Arguments:
- `floor`: number

Returns:
- `canSet`: bool

### C_HousingLayout.CancelActiveLayoutEditing

```lua
C_HousingLayout.CancelActiveLayoutEditing()
```

### C_HousingLayout.ConfirmStairChoice

```lua
C_HousingLayout.ConfirmStairChoice([choice])
```

Arguments:
- `choice`: HousingLayoutStairDirection, may be nil. If not set, the pending stair operation will be cancelled

### C_HousingLayout.DeselectFloorplan

```lua
C_HousingLayout.DeselectFloorplan()
```

### C_HousingLayout.DeselectRoomOrDoor

```lua
C_HousingLayout.DeselectRoomOrDoor()
```

### C_HousingLayout.GetBaseRoomFloor

```lua
floor = C_HousingLayout.GetBaseRoomFloor()
```

Returns:
- `floor`: number

### C_HousingLayout.GetHighestOccupiedFloorIndex

```lua
highestFloorIndex = C_HousingLayout.GetHighestOccupiedFloorIndex()
```

Returns:
- `highestFloorIndex`: number

### C_HousingLayout.GetLowestOccupiedFloorIndex

```lua
lowestFloorIndex = C_HousingLayout.GetLowestOccupiedFloorIndex()
```

Returns:
- `lowestFloorIndex`: number

### C_HousingLayout.GetNumActiveRooms

```lua
numRooms = C_HousingLayout.GetNumActiveRooms()
```

Returns:
- `numRooms`: number

### C_HousingLayout.GetRoomPlacementBudget

```lua
placementBudget = C_HousingLayout.GetRoomPlacementBudget()
```

Returns the max room placement budget for the current owned house's interior; Can be increased via house level

Returns:
- `placementBudget`: number, may be nil. Will be nil if not in an owned House or Plot

### C_HousingLayout.GetRoomPlayerIsIn

```lua
roomGUID = C_HousingLayout.GetRoomPlayerIsIn()
```

Returns the guid of the interior room the player is standing in, or nil if not currently standing in one

May return nothing.

Returns:
- `roomGUID`: WOWGUID

### C_HousingLayout.GetSelectedBlueprintFloorplan

```lua
roomID, shareCode = C_HousingLayout.GetSelectedBlueprintFloorplan()
```

May return nothing.

Returns:
- `roomID`: number
- `shareCode`: cstring

### C_HousingLayout.GetSelectedDoor

```lua
selectedDoorComponentID, roomGUID = C_HousingLayout.GetSelectedDoor()
```

If a door is selected, returns its component id and the guid of the room it belongs to; Otherwise returns nothing

May return nothing.

Returns:
- `selectedDoorComponentID`: number
- `roomGUID`: WOWGUID

### C_HousingLayout.GetSelectedFloorplan

```lua
roomID = C_HousingLayout.GetSelectedFloorplan()
```

Returns:
- `roomID`: number, may be nil

### C_HousingLayout.GetSelectedRoom

```lua
roomGUID = C_HousingLayout.GetSelectedRoom()
```

If a Room is selected, returns the room's guid; Otherwise returns nothing

May return nothing.

Returns:
- `roomGUID`: WOWGUID

### C_HousingLayout.GetSelectedStairwellRoomCount

```lua
stairwellRoomCount = C_HousingLayout.GetSelectedStairwellRoomCount()
```

Returns:
- `stairwellRoomCount`: number

### C_HousingLayout.GetSpentPlacementBudget

```lua
spentPlacementBudget = C_HousingLayout.GetSpentPlacementBudget()
```

Returns how much of the current owned house's room placement budget has been spent; Different kinds of rooms take up different budget amounts, so this value isn't an individual room count, see GetNumActiveRooms for that

Returns:
- `spentPlacementBudget`: number, may be nil. Will be nil if not in an owned House

### C_HousingLayout.GetViewedFloor

```lua
floor = C_HousingLayout.GetViewedFloor()
```

Returns:
- `floor`: number

### C_HousingLayout.HasAnySelections

```lua
hasAnySelections = C_HousingLayout.HasAnySelections()
```

Returns true if any room, door, or floorplan is currently selected or being dragged

Returns:
- `hasAnySelections`: bool

### C_HousingLayout.HasRoomPlacementBudget

```lua
hasBudget = C_HousingLayout.HasRoomPlacementBudget()
```

Returns whether there's a max room placement budget available and active for the current player, in the current house's interior

Returns:
- `hasBudget`: bool

### C_HousingLayout.HasSelectedBlueprintFloorplan

```lua
hasSelectedBlueprintFloorplan = C_HousingLayout.HasSelectedBlueprintFloorplan()
```

Returns:
- `hasSelectedBlueprintFloorplan`: bool

### C_HousingLayout.HasSelectedDoor

```lua
hasSelectedDoor = C_HousingLayout.HasSelectedDoor()
```

Returns true if a door component is currently selected

Returns:
- `hasSelectedDoor`: bool

### C_HousingLayout.HasSelectedFloorplan

```lua
hasSelectedFloorplan = C_HousingLayout.HasSelectedFloorplan()
```

Returns:
- `hasSelectedFloorplan`: bool

### C_HousingLayout.HasSelectedRoom

```lua
hasSelectedRoom = C_HousingLayout.HasSelectedRoom()
```

Returns true if a room is selected, will NOT return true if a door is selected

Returns:
- `hasSelectedRoom`: bool

### C_HousingLayout.HasStairs

```lua
hasStairs = C_HousingLayout.HasStairs(roomRecordID)
```

Arguments:
- `roomRecordID`: number

Returns:
- `hasStairs`: bool

### C_HousingLayout.HasValidConnection

```lua
canPlace = C_HousingLayout.HasValidConnection(roomGUID, componentID, roomId)
```

Arguments:
- `roomGUID`: WOWGUID
- `componentID`: number
- `roomId`: number

Returns:
- `canPlace`: bool

### C_HousingLayout.IsBaseRoom

```lua
isBaseRoom = C_HousingLayout.IsBaseRoom(roomGUID)
```

Arguments:
- `roomGUID`: WOWGUID

Returns:
- `isBaseRoom`: bool

### C_HousingLayout.IsDraggingRoom

```lua
isDragging, isAccessibleDrag = C_HousingLayout.IsDraggingRoom()
```

Returns:
- `isDragging`: bool
- `isAccessibleDrag`: bool

### C_HousingLayout.MoveDraggedRoom

```lua
C_HousingLayout.MoveDraggedRoom(sourceDoorIndex, destRoom, destDoorIndex)
```

Attempt to move the room currently being dragged to a specific connection point on a specific other room

Arguments:
- `sourceDoorIndex`: number
- `destRoom`: WOWGUID
- `destDoorIndex`: number

### C_HousingLayout.MoveLayoutCamera

```lua
C_HousingLayout.MoveLayoutCamera(direction, isPressed)
```

Arguments:
- `direction`: HousingLayoutCameraDirection
- `isPressed`: bool

### C_HousingLayout.RemoveRoom

```lua
C_HousingLayout.RemoveRoom(roomGUID)
```

Attempt to return a previously placed room to the House Chest

Arguments:
- `roomGUID`: WOWGUID

### C_HousingLayout.RoomHasStairs

```lua
hasStairs = C_HousingLayout.RoomHasStairs(roomGUID)
```

Returns true of the provided roomGUID is a stairwell. Returns false if roomGUID is invalid

Arguments:
- `roomGUID`: WOWGUID

Returns:
- `hasStairs`: bool

### C_HousingLayout.RotateFocusedRoom

```lua
C_HousingLayout.RotateFocusedRoom(isLeft)
```

Rotates either the currently dragged or currently selected room, if either exist

Arguments:
- `isLeft`: bool

### C_HousingLayout.RotateRoom

```lua
C_HousingLayout.RotateRoom(roomGUID, isLeft)
```

Attempt to rotate an already placed room

Arguments:
- `roomGUID`: WOWGUID
- `isLeft`: bool

### C_HousingLayout.SelectFloorplan

```lua
C_HousingLayout.SelectFloorplan(roomID)
```

Arguments:
- `roomID`: number

### C_HousingLayout.SetViewedFloor

```lua
C_HousingLayout.SetViewedFloor(floor)
```

Arguments:
- `floor`: number

### C_HousingLayout.StartDrag

```lua
C_HousingLayout.StartDrag()
```

### C_HousingLayout.StopDrag

```lua
C_HousingLayout.StopDrag()
```

### C_HousingLayout.StopDraggingRoom

```lua
C_HousingLayout.StopDraggingRoom()
```

### C_HousingLayout.ZoomLayoutCamera

```lua
zoomChanged = C_HousingLayout.ZoomLayoutCamera(zoomIn)
```

Arguments:
- `zoomIn`: bool

Returns:
- `zoomChanged`: bool

## Events

### HOUSING_LAYOUT_DOOR_SELECTED

Fired when one of the door nodes of an already placed room has been selected

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

### HOUSING_LAYOUT_DOOR_SELECTION_CHANGED

Fired when one of the door nodes of an already placed room has been selected or deselected

Payload, after the event's name:
- `hasSelection`: bool

### HOUSING_LAYOUT_DRAG_TARGET_CHANGED

Fired when an already placed room has either started or stopped being dragged

Payload, after the event's name:
- `isDraggingRoom`: bool

### HOUSING_LAYOUT_FLOORPLAN_SELECTION_CHANGED

Fired when a room option in the House Chest has been selected or deselected

Payload, after the event's name:
- `hasSelection`: bool
- `roomID`: number
- `blueprintShareCode`: cstring, may be nil

### HOUSING_LAYOUT_OCCUPIED_FLOOR_RANGE_CHANGED

Payload, after the event's name:
- `lowestFloor`: number
- `highestFloor`: number

### HOUSING_LAYOUT_PIN_FRAME_ADDED

Payload, after the event's name:
- `pinFrame`: HousingLayoutPinFrame

### HOUSING_LAYOUT_PIN_FRAME_RELEASED

Payload, after the event's name:
- `pinFrame`: HousingLayoutPinFrame

### HOUSING_LAYOUT_PIN_FRAMES_RELEASED

No payload.

### HOUSING_LAYOUT_ROOM_COMPONENT_THEME_SET_CHANGED

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

### HOUSING_LAYOUT_ROOM_MOVE_INVALID

No payload.

### HOUSING_LAYOUT_ROOM_MOVED

Fired when a previously placed room has been moved to a different position or rotation

No payload.

### HOUSING_LAYOUT_ROOM_RECEIVED

Fired when info for a newly placed room has been recieved while in Layout Mode

Payload, after the event's name:
- `playAddedSound`: bool

### HOUSING_LAYOUT_ROOM_REMOVED

Fired when a previously placed room has been removed while in Layout Mode

No payload.

### HOUSING_LAYOUT_ROOM_RETURNED

Fired when a room that was being dragged is let go of without being placed, and is returned to the House Chest

No payload.

### HOUSING_LAYOUT_ROOM_SELECTION_CHANGED

Fired when an already placed room has been selected or deselected

Payload, after the event's name:
- `hasSelection`: bool

### HOUSING_LAYOUT_ROOM_SNAPPED

Fired when a room being dragged has been snapped to a particular door connection

No payload.

### HOUSING_LAYOUT_VIEWED_FLOOR_CHANGED

Payload, after the event's name:
- `floor`: number

### SHOW_STAIR_DIRECTION_CONFIRMATION

No payload.

---
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."
