From b19057b9d833ff4b103fa687390c0c9703f58675 Mon Sep 17 00:00:00 2001 From: "Fabian @ Blax Software" Date: Wed, 21 Oct 2026 14:13:24 +0200 Subject: [PATCH] =?UTF-8?q?A=20cable=20straight=20off=20a=20component's=20?= =?UTF-8?q?pins:=20from=20its=20outputs=20or=20into=20its=20inputs,=20in?= =?UTF-8?q?=20groups=20like=20S0=E2=80=93S3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Right click a component (or its settings): "Cable from outputs" / "Cable into inputs" with the pin groups it has (A0–A3, B0–B3, S0–S3) or all of them - The cable end plugs onto those pins, the other end waits a few squares away with their names; drop it on the next part's pins and it plugs in there - Also for input panels (rows out) and hex displays Co-Authored-By: Claude Opus 5.5 (1M context) --- app/assets/css/main.css | 13 ++++ app/components/editor/Help.vue | 1 + app/components/editor/NodeSettings.vue | 15 ++++ app/composables/useEditor.ts | 51 +++++++++++- app/composables/useMenu.ts | 16 ++++ app/lib/logic/cables.ts | 103 +++++++++++++++++++++++++ tests/plugs.test.ts | 62 ++++++++++++++- 7 files changed, 259 insertions(+), 2 deletions(-) diff --git a/app/assets/css/main.css b/app/assets/css/main.css index e2503c4..b8afe5f 100644 --- a/app/assets/css/main.css +++ b/app/assets/css/main.css @@ -878,6 +878,19 @@ kbd { fill: var(--muted); } +.cable-choices .cable-row { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 4px; + margin-bottom: 4px; +} + +.cable-choices .cable-row .hint { + width: 84px; + margin: 0; +} + .invert-pins { display: flex; flex-wrap: wrap; diff --git a/app/components/editor/Help.vue b/app/components/editor/Help.vue index ee99466..a2eb93a 100644 --- a/app/components/editor/Help.vue +++ b/app/components/editor/Help.vue @@ -23,6 +23,7 @@ const SHORTCUTS: [string, string][] = [ ['Mouse wheel', 'Zoom'], ['N, I, O, L, B, C, H, T, P, X', 'Place NAND, input, output, lamp, button, clock, hex display, note, input panel, pixel'], ['Select wires, Ctrl+G', 'Bundle them into one cable; an end whose wires all meet one part plugs straight into it'], + ['Right click a component, Cable from outputs', 'A cable plugged onto S0–S3 (or any group); drop its free end on the next part\'s pins'], ['Drag a plugged cable end away', 'Pull it out; drop its pins on a part\'s pins to plug it in again'], ['Drag a part onto a pin', 'Connects there when dropped (a green ring shows where); hold Alt to just place it'], ['Drag a wire by its end', 'Moves that end to another pin (grab it near the pin, or by the small circle)'], diff --git a/app/components/editor/NodeSettings.vue b/app/components/editor/NodeSettings.vue index b967c66..bc461bf 100644 --- a/app/components/editor/NodeSettings.vue +++ b/app/components/editor/NodeSettings.vue @@ -148,6 +148,9 @@ const widens = computed(() => { }) const inputs = computed(() => inputCount(n.value, ed.getDef.value)) +/** Groups of pins a new cable can plug onto. */ +const cables = computed(() => ed.cableChoices(n.value)) + /** Inputs that can carry a bubble, with their names. */ const invertible = computed(() => { if (!INVERTIBLE.has(n.value.kind)) return [] @@ -407,6 +410,18 @@ function setRowHz(row: PanelRow, e: Event) {

Kept inside: in a component the switches stay as set here, buttons read 0.

+
+ Plug a cable onto its pins +
+ From outputs + +
+
+ Into inputs + +
+
+