Fix wire tool: clicking a carrier as source did nothing

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 <noreply@anthropic.com>
This commit is contained in:
type-two 2026-08-02 10:21:55 +10:00
parent 3b5e965ae7
commit 83a97f7441
2 changed files with 12 additions and 4 deletions

View File

@ -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();

View File

@ -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 <b>W</b> (or the 🔌 Wire chip), click the <b>PC</b>, then the <b>router</b>.",
body: "Your PC can't sell garbage without internet. Press <b>W</b>, then just two clicks — no dragging: click the <b>Budget PC</b> (cyan ring), then the <b>Wi-Fi Router</b> (green ring).",
done: (s) => s.devices.some((d) => d.wiredTo !== null),
highlight: ["#wire-tool"],
ringDefs: ["desk_pc", "router"],