feat: v0.2.0 locale_factory replaces single container
M.create now accepts either a function (locale_factory, called per frame to resolve the current crafting locale) or a bare entity-handle (wrapped internally as a constant factory for v0.1 bw-compat). The factory's return value is forwarded to crafting.can_craft as the new multi-source / single-sink locale, enabling dynamic topologies (adjacent-container sets that change as the actor moves) without recreating the widget. Action callbacks now receive ctx_inner with both `locale` (the currently-resolved locale, either the Form-2 table or the Form-1 bare handle) and `container` as a bw-compat alias pointing at locale.sink (Form-2) or the handle itself (Form-1). Existing v0.1 callers using ctx.container keep working unchanged. New backdoor _test_get_locale exposes the locale_factory's current return value. README documents both Form-1 and Form-2 with examples plus the updated callback contract. Depends on lib-core.crafting v0.2.0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1 +1 @@
|
||||
{"id":"lib-core.crafting-display","version":"0.1.0","api_min":"0.1","deps":[{"id":"lib-core.crafting","version":"0.1.0"},{"id":"lib-core.panel","version":"0.1.1"},{"id":"lib-core.inventory-list","version":"0.1.0"},{"id":"lib-core.composition","version":"0.3.0"}]}
|
||||
{"id":"lib-core.crafting-display","version":"0.2.0","api_min":"0.1","deps":[{"id":"lib-core.crafting","version":"0.2.0"},{"id":"lib-core.panel","version":"0.1.1"},{"id":"lib-core.inventory-list","version":"0.1.0"},{"id":"lib-core.composition","version":"0.3.0"}]}
|
||||
|
||||
Reference in New Issue
Block a user