Agent Skillsjasonkneen/tiny-world-builder › tinyworld-tool-icons-and-modes

tinyworld-tool-icons-and-modes

GitHub

定义 Tiny World Builder 的模式安全机制,涵盖引导、构建/播放、展示及视角切换逻辑。规范各模式下的 UI 状态、工具行为限制及特定场景(如房间进入)下的模式隔离与清理策略。

.codex/skills/tinyworld-tool-icons-and-modes/SKILL.md jasonkneen/tiny-world-builder

Trigger Scenarios

修改 Tiny World 的模式指示器或启动工具选择 调整 Esc 键退出或模式切换行为 实现第一人称/第三人称视角切换逻辑

Install

npx skills add jasonkneen/tiny-world-builder --skill tinyworld-tool-icons-and-modes -g -y
More Options

Non-standard path

npx skills add https://github.com/jasonkneen/tiny-world-builder/tree/main/.codex/skills/tinyworld-tool-icons-and-modes -g -y

Use without installing

npx skills use jasonkneen/tiny-world-builder@tinyworld-tool-icons-and-modes

指定 Agent (Claude Code)

npx skills add jasonkneen/tiny-world-builder --skill tinyworld-tool-icons-and-modes -a claude-code -g -y

安装 repo 全部 skill

npx skills add jasonkneen/tiny-world-builder --all -g -y

预览 repo 内 skill

npx skills add jasonkneen/tiny-world-builder --list

SKILL.md

Frontmatter
{
    "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: bootApp calls selectTool(DEFAULT_TOOL) after loadState(), so a restored world's saved toolId never leaves a fresh session "armed" for building.
  • Build/Play mode is separate from Showcase. #build-play-mode toggles body.tw-play-mode, persists tinyworld:build-play-mode.v1, and exposes window.__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 call mpEditAllowed().
  • First load goes through #welcome-modal: the rounded .launch-modal shows assets/twlogo.png with Tinyverse, Battleworlds, Build, and Play buttons, includes the compact "Created by Jason Kneen" footer with @jasonkneen and @tinyworldsapp links, and hides app chrome via body.welcome-launch-open. Build/Play call window.__tinyworldMode; Tinyverse waits for window.__tinyworldWorlds.open() (or the tinyworld:worlds-ready signal) and opens the Worlds frontend rather than silently falling back to Build. Battleworlds calls window.__tinyworldBattleworlds.open() when present and otherwise falls back to Play. Do not bring back the old farm/vehicle welcome picker for this path, and keep publish.sh copying the assets/ directory into dist/assets/.
  • Showcase mode keeps only a simple top-right circular #showcase-exit X button visible. Do not turn it back into a wide "Exit Showcase Esc" text pill; keep aria-keyshortcuts="Escape" and the existing Escape handler that calls setShowcaseActive(false).
  • #mode-indicator (HUD chip, updated in updateModeIndicator in 19-tools-toolbar.js) names the current mode and colours itself: calm mode-select, amber mode-build, red mode-erase. Keep it pointer-events:none.
  • Esc disarms any build/paint/erase tool back to Select (handler in 20-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 same fp controller in 20-input-place-erase.js; tp shows a chase camera behind the voxel avatar, while fp uses the avatar rig's getEyeWorldPosition() and hides the head via setFirstPerson(true). Keep tp in camera-mode schema/import allowlists when touching saved camera validation.
  • Both walk modes are home-builder only. The fp avatar is added to the shared worldGroup, so it must never coexist with a Tinyverse room's own networked avatar or the player sees two copies of themselves. setCameraMode redirects fp/tp to perspective while window.__tinyworldInWorldRoom is set, and 47-worlds-room.js enterRoom calls window.__tinyworldExitWalkMode (exposed from 20-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 (v key, _sr* in 47), not the builder fp controller.

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 .toolbar is the default. The "Show groups" checkbox in Settings → App (#toolbar-show-groups, persisted as tinyworld:showGroups, default on) switches modes. When off, body.hide-groups hides only the bottom toolbar's block tools/group buttons and a floating, resizable, draggable #tool-palette shows every placeable block (select + all TOOL_GROUPS tools 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 with buildToolButton(t, { flyout: true }), so they keep their colors and are highlighted by the same updateToolActiveStates() loop.
  • Small screens force grouped mode. showGroupsEnabled() returns true on <=700px regardless of the stored pref (isSmallScreenForGroups()), the checkbox is disabled there, and a resize listener 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() calls rebuildToolPaletteIfActive() 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 in renderToolGroupFlyout).
  • The old vertical .controls rail 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-indicator HUD 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 leave icon. The in-world exit that returns to the world picker uses tw-hud-back-worlds, the reply glyph, and worlds.backToWorlds so it is not confused with logging out.

Version History

  • 2ffaf91 Current 2026-07-06 00:20

Same Skill Collection

.agents/skills/lightweight-3d-effects/SKILL.md
.agents/skills/threejs-primitive-reconstructor/SKILL.md
.agents/skills/tinyworld-i18n/SKILL.md
.claude/skills/tinyworld-i18n/SKILL.md
.codex/skills/threejs-primitive-reconstructor/SKILL.md
.codex/skills/tinyworld-25d-template-sprites/SKILL.md
.codex/skills/tinyworld-asset-editing/SKILL.md
.codex/skills/tinyworld-auto-batching/SKILL.md
.codex/skills/tinyworld-block-button-style/SKILL.md
.codex/skills/tinyworld-cctv-truman/SKILL.md
.codex/skills/tinyworld-ghost-world-gen/SKILL.md
.codex/skills/tinyworld-integrations/SKILL.md
.codex/skills/tinyworld-island-and-planes/SKILL.md
.codex/skills/tinyworld-island-viewer/SKILL.md
.codex/skills/tinyworld-lowpoly-stylized-3d/SKILL.md
.codex/skills/tinyworld-lowpoly-world-prompt/SKILL.md
.codex/skills/tinyworld-mesh-terrain/SKILL.md
.codex/skills/tinyworld-opacity-torch/SKILL.md
.codex/skills/tinyworld-render-performance/SKILL.md
.codex/skills/tinyworld-runtime-state/SKILL.md
.codex/skills/tinyworld-settings/SKILL.md
.codex/skills/tinyworld-shader-fx/SKILL.md
.codex/skills/tinyworld-single-file/SKILL.md
.codex/skills/tinyworld-tile-variation/SKILL.md
.codex/skills/tinyworld-tinyverse-collectibles/SKILL.md
.codex/skills/tinyworld-tinyverse-race-track/SKILL.md
.codex/skills/tinyworld-visual-qa/SKILL.md
.codex/skills/tinyworld-webxr/SKILL.md
.agents/skills/3d-modeling/SKILL.md
.agents/skills/fractal/SKILL.md
.agents/skills/poly-pizza-api/SKILL.md

Metadata

Files
0
Version
8afdf00
Hash
ee14204f
Indexed
2026-07-06 00:20

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-05 07:48
浙ICP备14020137号-1 $방문자$