feat: v0.12.0 Workbench-Integration

Workbench-Entity bei (350, 380) als Crafting-Context-Erweiterung.
Right-Click oeffnet Workbench-Crafting-Panel + Workbench-Inventory.
Crafting nutzt Multi-Source-Locale {backpack, workbench} mit sink
= workbench; Take-Action verschiebt vom Workbench-Inventory zum
Backpack. C-Key Backpack-Crafting bleibt unveraendert via Bw-
Compat-Shim in crafting v0.2.0.

Deps: crafting 0.1.0 -> 0.2.0, crafting-display 0.1.0 -> 0.2.0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Axel Meyer
2026-06-14 20:04:04 +02:00
parent f16c8954d9
commit 644bfe98fd
3 changed files with 314 additions and 13 deletions

View File

@@ -8,9 +8,9 @@ callback, foot-body-orientation ("tactical twist"), scale-deformation walk
cycle, and inheritance-decoupled foot sprites. End-to-end inventory pickup/drop
demo: pick up a rock into a backpack container, drop it back into the world.
**Version:** 0.11.0
**Version:** 0.12.0
**Module-ID:** vagrant-skeleton
**Requires:** lib-core.input >=0.4.0, lib-core.camera >=0.3.0, lib-core.render >=0.1.0, lib-core.maps >=0.1.2, lib-core.puppet >=0.4.4, lib-core.interaction >=0.1.0, lib-core.composition >=0.3.0, lib-core.actor >=0.1.0, lib-core.inventory-list >=0.1.0, lib-core.panel >=0.1.0, lib-core.inventory-list-display >=0.1.0, lib-core.notify >=0.1.0, lib-core.notify-display >=0.1.0, lib-core.world-overlay >=0.1.0, lib-core.crafting >=0.1.0, lib-core.crafting-display >=0.1.0, lib-asset.prototype-subterrain >=0.1.0
**Requires:** lib-core.input >=0.4.0, lib-core.camera >=0.3.0, lib-core.render >=0.1.0, lib-core.maps >=0.1.2, lib-core.puppet >=0.4.4, lib-core.interaction >=0.1.0, lib-core.composition >=0.3.0, lib-core.actor >=0.1.0, lib-core.inventory-list >=0.1.0, lib-core.panel >=0.1.0, lib-core.inventory-list-display >=0.1.0, lib-core.notify >=0.1.0, lib-core.notify-display >=0.1.0, lib-core.world-overlay >=0.1.0, lib-core.crafting >=0.2.0, lib-core.crafting-display >=0.2.0, lib-asset.prototype-subterrain >=0.1.0
**Tags:** test-chamber, puppet, walking-sim, interaction
## Topology
@@ -26,19 +26,21 @@ demo: pick up a rock into a backpack container, drop it back into the world.
- **E** — interact: if within range of the rock or stick, picks it up into the backpack
- **Q** — quick-drop (LIFO): places the most-recently-added backpack item at player position (+30px right)
- **Tab** — toggle inventory panel (Backpack contents)
- **C** — toggle Crafting panel (lists known recipes; availability dimmed by inventory)
- **Right-Click on item row** (inventory panel): context menu with **Drop** / **Inspect**
- **C** — toggle Backpack-Crafting panel (lists known recipes; availability dimmed by inventory)
- **Right-Click on Workbench** (within range) — opens Workbench-Crafting + Workbench-Inventory panels (Phase D v0.2)
- **Right-Click on item row** (inventory panel): context menu with **Drop** / **Inspect** (Backpack) or **Take** / **Inspect** (Workbench)
- **Right-Click on recipe row** (crafting panel): context menu with **Craft** / **Inspect**
- **L** — toggle game-log (chronological list of all events)
- **Right-Click on item row → Inspect** — opens a modal Item Details panel (instead of console-only output)
- **Pickup (E)** — shows "+1 <name>" floating above the player + toast at top-right + log entry
- **Drop (right-click on item → Drop, or Q for LIFO quick-drop)** — toast at top-right + log entry
- **Craft (right-click on recipe → Craft)** — consumes inputs from backpack, adds output, posts a success/failure toast
- **ESC** — return to launcher
- **Craft (right-click on recipe → Craft)** — consumes inputs from current locale, adds output, posts a success/failure toast
- **Take (right-click on Workbench-item → Take)** — moves item from Workbench → Backpack + toast
- **ESC** — close any open panel; if no panel is open, return to launcher
## Demo Walkthrough
The world contains four notable entities at startup:
The world contains five notable entities at startup:
1. **Player** — spawns at (320, 240), controlled via WASD + mouse.
2. **Backpack** — a visible sprite at (350, 400). Acts as a container (kind="list").
@@ -48,6 +50,9 @@ The world contains four notable entities at startup:
4. **Stick** — a placeholder pickup-item at (190, 400), 160px to the left of the backpack.
Re-uses the `slot_04_straight` blob_rect_stone tile for its visual (Phase C-Q10
pragmatic resolution — echtes Stick-Sprite folgt mit dem ersten atlas-baker-decals-Slice).
5. **Workbench** — a crafting bench at (350, 380), just above the backpack. Container
(kind="list"); placeholder visual re-uses the `slot_07_tee_full` blob_rect_stone tile.
Right-Click within range opens Workbench-Crafting + Workbench-Inventory panels.
**Pickup flow:**
- Walk toward the rock (it sits to the left of the backpack).
@@ -67,6 +72,21 @@ The world contains four notable entities at startup:
**Multiple pickups:** Each E → Q → E cycle moves the same rock in and out.
Only one rock is spawned per session.
**Workbench flow (Phase D v0.2):**
- Pick up rock + stick into the backpack (E on each).
- Walk to the Workbench (just above the Backpack at (350, 380)) and
right-click within 40px range.
- Two panels open simultaneously (Workbench-Crafting + Workbench-Inventory).
Because `lib-core.panel` v0.1 is single-active, only one panel is visible
at a time — closing it (X) reveals the other.
- Right-click on a recipe row (e.g. **Stone Pick**) → context menu with
**Craft** + **Inspect**. Click **Craft** → crafted item lands in
**Workbench-Inventory** (NOT Backpack).
- Open Workbench-Inventory, right-click on the crafted item → **Take** moves
it to the Backpack; a "Took <item>" toast appears.
- Crafting inputs are aggregated from `{backpack, workbench}` (drain order:
backpack first, then workbench).
## Demonstrates
- lib-core.puppet v0.4.3 integration:
@@ -121,6 +141,37 @@ Only one rock is spawned per session.
## CHANGELOG
### v0.12.0 — Workbench
- **New: Workbench entity** in the world at (350, 380) — `composition.define_template`
with `container = {kind="list"}`, tagged `renderable`, `container`, `workbench`,
`interactable`. Placeholder visual re-uses the `slot_07_tee_full`
blob_rect_stone tile (visually distinct from rock/stick/rock_pick/rock_pile).
- **New: Right-Click on Workbench** opens two panels:
- **Workbench Crafting** — recipes are still listed by `lib-core.crafting`,
but availability + craft-action use a **multi-source locale**
`{sources={backpack, workbench}, sink=workbench}` (crafting v0.2.0 API).
Inputs are drained greedy in source-array order (backpack first, then
workbench). Output lands in the Workbench, not the Backpack.
- **Workbench Inventory** — workbench contents with **Take** + **Inspect**
actions on right-click. Take moves the item to the Backpack and fires
a `transfer` event-toast.
- **Still works**: C-key Backpack-Crafting (basic recipes still craftable
with Backpack-only via the bw-compat shim in crafting v0.2.0). The
Phase-C C-key callsite passes `state.backpack` as a bare entity-handle;
crafting v0.2.0's resolve_locale wraps that as `{sources={backpack},
sink=backpack}` transparently.
- **Caveat (panel-lib v0.1 single-active)**: `lib-core.panel` v0.1.1
enforces one active widget. Opening both Workbench panels means only
the second (`workbench_inv`) is visible until the player closes it (X);
closing it reveals `workbench_crafting`. Proper side-by-side stacking
is a future panel-lib slice.
- **Deps**: crafting 0.1.0 → 0.2.0, crafting-display 0.1.0 → 0.2.0.
- **Notify events-Channel**: filter um `"transfer"` erweitert, damit
Take-Action-Toasts im events-channel landen.
- **Input binding**: `"use"` bound to `mouse_right` (mirrors the lib-core.input
v0.3.0 unified key+mouse binding).
### v0.11.0 — crafting integration
- **New: stick pickup-item** neben rock am Boden (Position 190,400 — 160px links