Log inGet started
World

Raise the Roof: Build Mode, Snapping and Base Pieces Kit

README.md

buildPlaceKit.menus

Every on-screen part of build mode: the piece hotbar (category tabs, number keys, paging), the radial wheel (categories inside, pieces outside, centre readout), the catalogue (category tabs, piece cards with art, detail pane with price/refund/footprint, Frontier/Outpost style switch, snap-mode switch, wallet), plus the status panel (piece, style, snap, ghost, a green "Click to place" line with its price or the red reason), the demolish banner, control hints for keyboard/gamepad, message toasts that slide in and fade (refused ones shake red), big thumb buttons for touch (Build, Place, Rotate, Demolish, Menu, Snap, Exit) and the small "B Build" chip. Rustic pieces get warm amber panels and sci-fi pieces get cyan, following state.style.

The build controller calls Menus.render(state, actions) every frame. A screen is rebuilt only when what it shows changes. Clicks and finger taps call actions.select/setCategory/setStyle/setSnap/closeMenus/page/place/rotate/toggleDemolish/toggleBuild/openMenu/cycleSnap. Menus.isPointerOverMenu(x, y) tells whether a window point (device pixels) is on a menu, so a click on a menu does not also place a piece. Menus.radialLayout(state), Menus.radialPick(state), Menus.radialIndexAt(n, ax, ay) and Menus.hotbarLayout(state) let the controller map stick/keys to pieces. Menus.hide() and Menus.unregister() take everything down. Menus._sampleState(menu, device) builds a preview state, and state.viewport = { width, height, safe } lays the UI out as a phone would on a desktop screen. Piece pictures come from buildPlaceKit.art (Art.icon) when present, or from Menus.setIconSource(fn), with a drawn category glyph as the fallback.