Axel Meyer 96b5fe2bae deps(command): bump lib-core.input dep 0.3.0 → 0.4.0 (P.3.10 cascade)
No behavioral change. input v0.4.0 adds was_action_released;
command does not use it. Bumping because only 0.4.0 is now available.
2026-05-15 22:14:10 +02:00

lib-core.command — v0.1.0

Move-Commands für registrierte Units. RTS-Style Click-to-Move (RMB → bewegt selected Units).

Quick Setup

local command   = require("lib-core.command")
local input     = require("lib-core.input")
local selection = require("lib-core.selection")   -- target-provider source

input.bind("rmb", { "mouse_right" })

command.bind_move_action("rmb")
command.bind_target_provider(function() return selection.list() end)

-- Register each movable unit (read+write callbacks + speed):
local handle = command.register(
    function() return { x = unit.x, y = unit.y } end,
    function(nx, ny) unit.x = nx; unit.y = ny end,
    100   -- px/s
)

-- per-frame:
function update(ctx, dt)
    command.update(dt)
end

API

  • Registry: register(get_pos_fn, set_pos_fn, speed) → handle, unregister(h), count_registered()
  • Speed: set_speed(h, n) / speed(h) → n
  • Issue (programmatic): move_to(handles, x, y), cancel(h), cancel_all()
  • State-Query: current(h) → {type, target_x, target_y}|nil, is_moving(h) → bool
  • Bindings: bind_move_action(name), bind_target_provider(fn)
  • Settings: set_arrive_threshold(n) / arrive_threshold(), set_enabled(b) / enabled()
  • Per-Frame: update(dt)

See meta/docs/superpowers/specs/2026-05-14-p3-7-lib-command-design.md for full design.

Description
P.3.7 lib-core.command v0.1.0 � Move-Commands + Per-Frame-Execution
Readme 33 KiB
Languages
Lua 94.2%
Shell 5.8%