name: tinyworld-tool-icons-and-modes description: Use when changing Tiny World Builder's mode indicator, boot tool selection, or Esc-to-Select behaviour.
Tiny World Mode Safety
Mode safety
- Boot always ends on the Select tool:
bootAppcallsselectTool(DEFAULT_TOOL)afterloadState(), so a restored world's savedtoolIdnever leaves a fresh session "armed" for building. - Build/Play mode is separate from Showcase.
#build-play-modetogglesbody.tw-play-mode, persiststinyworld:build-play-mode.v1, and exposeswindow.__tinyworldIsPlayMode()/window.__tinyworldMode. In PLAY mode, build panels and edit radials are hidden, selection/sub-edit state is cleared, and mutation paths should be gated through the same edit checks that callmpEditAllowed(). - First load goes through
#welcome-modal: the rounded.launch-modalshowsassets/twlogo.pngwith Tinyverse, Battleworlds, Build, and Play buttons, includes the compact "Created by Jason Kneen" footer with@jasonkneenand@tinyworldsapplinks, and hides app chrome viabody.welcome-launch-open. Build/Play callwindow.__tinyworldMode; Tinyverse waits forwindow.__tinyworldWorlds.open()(or thetinyworld:worlds-readysignal) and opens the Worlds frontend rather than silently falling back to Build. Battleworlds callswindow.__tinyworldBattleworlds.open()when present and otherwise falls back to Play. Do not bring back the old farm/vehicle welcome picker for this path, and keeppublish.shcopying theassets/directory intodist/assets/. - Showcase mode keeps only a simple top-right circular
#showcase-exitX button visible. Do not turn it back into a wide "Exit Showcase Esc" text pill; keeparia-keyshortcuts="Escape"and the existing Escape handler that callssetShowcaseActive(false). #mode-indicator(HUD chip, updated inupdateModeIndicatorin19-tools-toolbar.js) names the current mode and colours itself: calmmode-select, ambermode-build, redmode-erase. Keep itpointer-events:none.Escdisarms any build/paint/erase tool back to Select (handler in20-input-place-erase.js, skipped in first-person walk mode).- The View modes popup has five modes: top-down, isometric, perspective,
third-person walk (
tp), and first-person walk (fp). Both walk modes are driven by the samefpcontroller in20-input-place-erase.js;tpshows a chase camera behind the voxel avatar, whilefpuses the avatar rig'sgetEyeWorldPosition()and hides the head viasetFirstPerson(true). Keeptpin camera-mode schema/import allowlists when touching saved camera validation. - Both walk modes are home-builder only. The
fpavatar is added to the sharedworldGroup, so it must never coexist with a Tinyverse room's own networked avatar or the player sees two copies of themselves.setCameraModeredirectsfp/tptoperspectivewhilewindow.__tinyworldInWorldRoomis set, and47-worlds-room.jsenterRoomcallswindow.__tinyworldExitWalkMode(exposed from20-input-place-erase.js) to dispose any active walk avatar before spawning the room avatar. The room's own first-person is the surface roam zoom-in (vkey,_sr*in47), not the builderfpcontroller.
Gotcha
npm test (tools/check.js / smoke-static.js) reconstructs the split app
from tiny-world-builder.html plus engine/**/*.js. Update those static guards
when changing boot mode, launcher chrome, or mode persistence.
Bottom toolbar vs floating block palette
- The grouped bottom
.toolbaris the default. The "Show groups" checkbox in Settings → App (#toolbar-show-groups, persisted astinyworld:showGroups, default on) switches modes. When off,body.hide-groupshides only the bottom toolbar's block tools/group buttons and a floating, resizable, draggable#tool-paletteshows every placeable block (select + allTOOL_GROUPStools with house variants expanded + erase). The bottom toolbar itself must stay visible for utility controls such as Build/Play, Home, Shield, View modes, Time/weather, Sound, Layers, Settings, and Account. - The palette is a self-contained module:
engine/world/35-tool-palette.js. Blocks are built withbuildToolButton(t, { flyout: true }), so they keep their colors and are highlighted by the sameupdateToolActiveStates()loop. - Small screens force grouped mode.
showGroupsEnabled()returns true on<=700pxregardless of the stored pref (isSmallScreenForGroups()), the checkbox is disabled there, and aresizelistener re-applies across the breakpoint. The floating palette is unusable on phones, so never let it open there. The phone toolbar is also compacted to icon-only (labels/chevrons hidden, smaller buttons) in the@media (max-width: 700px)block. The grid uses fixed 64px square cells (repeat(auto-fill, 64px)), so resizing the panel reflows blocks to the nearest square.buildToolbar()callsrebuildToolPaletteIfActive()so toolbar rebuilds refresh an open palette. - The group popout flyout (
.flyout.tool-menu) lays its icons out as a 2-row grid block (gridTemplateColumns: repeat(ceil(n/2), auto)set inrenderToolGroupFlyout). - The old vertical
.controlsrail is no longer visible. Keep its element IDs in the DOM as stable wiring targets, but put everyday chrome in the bottom toolbar: Build/Play, Home, Shield, View modes, Time/weather, Settings, and Account. Import/export must remain owner-gated and should not be added to the normal user toolbar. - The old
#mode-indicatorHUD chip has been removed from the DOM;updateModeIndicator()still runs but no-ops on the missing element. - In Tinyverse multiplayer HUD chrome, account sign-out is the only place that
should use the door-arrow
leaveicon. The in-world exit that returns to the world picker usestw-hud-back-worlds, thereplyglyph, andworlds.backToWorldsso it is not confused with logging out.