From 83a97f7441ef7fdd48660f610cbaa438f0124458 Mon Sep 17 00:00:00 2001 From: type-two Date: Sun, 2 Aug 2026 10:21:55 +1000 Subject: [PATCH] Fix wire tool: clicking a carrier as source did nothing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The M6 GPU-card refactor set carriers' intrinsic tokRate to 0 and updated sim.wire() to isCompute(), but the pointer handler still gated sources on tokRate — so clicking the PC in wire mode was silently ignored while the cyan outline claimed it was clickable. Sources now accept carriers and switches, every wire-mode click answers with a toast (picked / wrong side / not wireable), and the tutorial spells out click-click, no dragging. Co-Authored-By: Claude Fable 5 --- src/main.ts | 14 +++++++++++--- src/ui/tutorial.ts | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index e1e0664..b694fa8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,7 +2,7 @@ import { BAL } from "./sim/balance"; import { createState, pushEvent } from "./sim/state"; import { step, place, canPlace, wire, sell, grant, raiseRound, clapBack, shipGrade, switchHosting, unlockScrape, buyGpu, sellGpu, extinguishFire, moveRoom, spamBlast } from "./sim/sim"; import { saveState, loadState, clearSave } from "./sim/save"; -import { DEF } from "./sim/catalog"; +import { DEF, isCompute } from "./sim/catalog"; import { Scene } from "./render/scene"; import { Hud, applyTheme, currentTheme } from "./ui/hud"; import { Panels } from "./ui/panels"; @@ -127,9 +127,17 @@ async function boot() { if (wireMode) { const d = deviceAt(t.x, t.y); if (!d) return; + const def = DEF[d.defId]; if (wireSource === null) { - if (DEF[d.defId].tokRate) { wireSource = d.uid; sfx.click(); } - else if (DEF[d.defId].uplinkMbps) pushEvent(state, "pick the PC first, then the router", "info"); + if (isCompute(def) || def.switchMbps) { + wireSource = d.uid; + sfx.click(); + pushEvent(state, `${def.name} picked — now click a router or switch (green)`, "info"); + } else if (def.uplinkMbps) { + pushEvent(state, "that's the internet side — pick the PC/rig first (cyan), then this", "info"); + } else { + pushEvent(state, `${def.name} can't be wired — pick a PC, rig, rack, or switch`, "info"); + } } else { const err = wire(state, wireSource, d.uid); if (err) { pushEvent(state, err, "info"); sfx.error(); } else sfx.wire(); diff --git a/src/ui/tutorial.ts b/src/ui/tutorial.ts index 4245f65..e58f779 100644 --- a/src/ui/tutorial.ts +++ b/src/ui/tutorial.ts @@ -16,7 +16,7 @@ const STEPS: Step[] = [ { id: "wire", title: "Plug in the slop pipe", - body: "Your PC can't sell garbage without internet. Press W (or the 🔌 Wire chip), click the PC, then the router.", + body: "Your PC can't sell garbage without internet. Press W, then just two clicks — no dragging: click the Budget PC (cyan ring), then the Wi-Fi Router (green ring).", done: (s) => s.devices.some((d) => d.wiredTo !== null), highlight: ["#wire-tool"], ringDefs: ["desk_pc", "router"],