diff --git a/docs/DESIGN.md b/docs/DESIGN.md index f8f434b..38fa730 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -43,7 +43,7 @@ decides something new, add it under "Decisions" with the date. ## The core loop 1. Dig with the resonance drill. Rock shatters into loose grains: rubble, ore, coal, clay, sand. -2. Vacuum up what you want (mark materials with ⬇ to take only those), and blow it out where you need it. +2. Vacuum up what you want (mark materials in the vacuum menu, F, to take only those), and blow it out where you need it. 3. Build a furnace from wall blocks, with a grate floor over a mold. Charge it with ore and coal, light it, and let the molten metal run into the mold. 4. Bars drop out of the bottom of the mold; collect them and sell them at the trade dock, or fill buyers' orders, which pay more. @@ -127,8 +127,8 @@ above, including: - **Holding Ctrl** while placing replaces what is built there (moved to G on 2026-10-23). - **Fans melt like copper (1085°C).** Put the fan outside the furnace, blowing in through a grate. The game warns when a fan gets close to melting. -- **The vacuum takes only marked materials** in Only marked mode, even if the drag starts on - something else. The t6 controls below replace the shared ticks. +- **The vacuum takes only marked materials** once any are marked, even if the drag starts on + something else. The t6 controls below replace the shared ticks; t16 replaces t6's modes. - **The Refiner** grinds stone, granite and basalt rubble, gravel, sand and dirt for trace ore, roughly halving the waste. Ore and anything else it cannot grind drop straight through. - **Pipes, pumps and outlets** move liquids up to 500°C, one liquid per line. A line is stored as @@ -225,6 +225,11 @@ above, including: As built: T or the chip cycles What I click → Only marked → Everything; adding a mark switches to Only marked and removing the last goes back to What I click. A bag name or Q/E blows one material; ⬆ marks build an even mix (bars are never mixed). +- **The vacuum menu replaces the modes (t16, 2026-10-24).** Pick-up has no mode: nothing marked + takes everything, anything marked takes only those, Shift takes everything for one click. F with + the Vacuum (when nothing in reach can be used) or a click on the card opens a menu with ⬇ Pick up + and ⬆ Blow toggles per material; the bag rows lose their buttons. T no longer does anything for + the vacuum. The owner found t6's version had too many modes. ## Ideas not built yet diff --git a/docs/PROJECT_MAP.md b/docs/PROJECT_MAP.md index 00f5691..c280d91 100644 --- a/docs/PROJECT_MAP.md +++ b/docs/PROJECT_MAP.md @@ -366,7 +366,7 @@ Audio: chiptune effects and generative music that changes with depth. Everything - functions: auInit, auVolumes, rateOk, tone, noiseBurst, sfxPlace, playSfx, auAmbient, mtof, zoneForDepth, scaleNote, musicScheduler - variables: AU, SFX, SFX_NEAR, SFX_FAR, ZONES -### src/ui/state.js (69 lines) +### src/ui/state.js (67 lines) Game shell (src/ui/): browser only. This file: settings, the GAME state object, DOM helpers, toasts and the status line. - functions: loadSettings, saveSettings, loadCollect, el, esc, rgbOf, fmtT, toast, setStatus - variables: SET_DEFAULT, SET, TOOLS, ICONS, BAG_ORDER, GAME, keys, hudDirty, $ @@ -404,10 +404,10 @@ The build menu along the bottom: categories, piece tiles and their icons. - functions: pieceIcon, catOf, selectBuildCat, cycleBuildCat, buildVariantChips, renderBuildBar, setupBuildBar - variables: BUILD_CATS, BUILD_ORDER, PIECE_ICONS, lastBuildKey, lastBuildMenu -### src/ui/selection.js (263 lines) +### src/ui/selection.js (270 lines) The selected tool and piece: R / Q / E, drill width, filter picker, the selection card, the bag panel. -- functions: pieceUsesWall, setDrillWidth, tuneUnderCursor, cycleItem, cycleWall, rotate, setPickMode, cyclePickMode, toggleCollect, toggleBlow, pickFilterUnderCursor, toggleFilterMat, toggleCollectUnderCursor, setBrush, pieceV, pieceExtra, filterChoices, matList, filterParts, filterSentence, applyFilterRun, openFilterPicker, openWallPicker, filterBlockAt, chipCost, pieceCostNow, renderSelCard, renderBag -- variables: PICK_MODES, PICK_LABELS, lastBagKey +- functions: pieceUsesWall, setDrillWidth, tuneUnderCursor, cycleItem, cycleWall, rotate, toggleCollect, toggleBlow, pickFilterUnderCursor, toggleFilterMat, toggleCollectUnderCursor, setBrush, pieceV, pieceExtra, filterChoices, matList, filterParts, filterSentence, applyFilterRun, openFilterPicker, openVacuumMenu, openWallPicker, filterBlockAt, chipCost, pieceCostNow, renderSelCard, renderBag +- variables: lastBagKey ### src/ui/info.js (171 lines) Discovery cards, hover info (I) and the cursor label. @@ -418,7 +418,7 @@ Keyboard and mouse listeners. - functions: isTyping - variables: canvas -### src/ui/actions.js (239 lines) +### src/ui/actions.js (233 lines) What input does: overlays, F, pick, copy / cut / paste, undo, building and tool use each frame. Which overlays are on, shown as a coloured frame round the screen and a named badge - functions: updateOverlayUI, toggleLens, doInteract, pickUnderCursor, aimBlock, stampOrigin, selModeHeld, startPaste, stopSelectAndPaste, plural, piecesIn, doUndo, endRmbRecord, dragDirFor, blockLabel, primaryPress, primaryRelease, secondaryPress, toolTick - variables: ovShown diff --git a/docs/agent-log.md b/docs/agent-log.md index 46b0aad..c250451 100644 --- a/docs/agent-log.md +++ b/docs/agent-log.md @@ -4,6 +4,21 @@ What agents have done, newest first. Add an entry for every piece of work: the d note or request it was for, what changed, the files touched, the tests run, and anything left open or not verified. Keep each entry short; the git history has the details. +## 2026-10-24: t16 Vacuum tool rework, again (Claude Code, Codex) + +- The owner: too many modes; chose an F menu with two pick-up states. +- `src/ui/selection.js`: `openVacuumMenu()` (a tile per material with ⬇ Pick up / ⬆ Blow, plus + Pick up everything and Blow one at a time); `GAME.pickMode`, `setPickMode`, `cyclePickMode`, + `GAME.vacLocked` and the 'first' locking removed. Bag rows lose ⬇/⬆ buttons (a ⬇ tag shows + marks). `actions.js`: pick-up is everything unless marked; F with the vacuum opens the menu + when nothing in reach can be used. Card chips open the menu (`build-menu.js`). T and gamepad B + no longer change vacuum modes. Text in `notebook.js`, `progress.js`, `session.js` (Welcome), + `previews.js`; CSS `.vpick`. +- `test/play.py`: mode checks replaced (no marks takes everything, marks, Shift, menu toggles, + F order, card chip, no bag buttons, menu screenshots at 1280 and 900); `test/t_basics.js` name. +- Tests: `run_all.py --browser` all pass (208 `play.py` checks). Codex ran out of credits before + its final test run; Claude fixed one check (it mutated a mold's kind) and the suction line. + ## 2026-10-24: t6 Rework the vacuum/blower tool, with t15 (Claude Code, Codex) - The owner folded t15 (a material menu for the vacuum) into t6's chosen design. diff --git a/src/sim/progress.js b/src/sim/progress.js index 4526f2e..9ef324b 100644 --- a/src/sim/progress.js +++ b/src/sim/progress.js @@ -22,12 +22,12 @@ const STARTER_DESIGNS = [ // ---------- Milestones ---------- const MILESTONES = [ - { id: 'dig', title: 'Break ground', msg: 'Broken material falls loose. The Vacuum (2) picks up only what you click on.', hint: 'Hold the left mouse button with the Drill (1): it sends pulses at the cursor that shake rock until it shatters. It falls as rubble, ore and coal.' }, + { id: 'dig', title: 'Break ground', msg: 'Broken material falls loose. The Vacuum (2) picks up everything, or only what you mark in its menu (F).', hint: 'Hold the left mouse button with the Drill (1): it sends pulses at the cursor that shake rock until it shatters. It falls as rubble, ore and coal.' }, { id: 'fire', title: 'First fire', hint: 'Vacuum up coal or wood chunks, blow a pile out with right click, then hold the Igniter (4) on it. Fuel only burns where it touches open air.', reward: 'Thermal lens unlocked. Press H to see heat.' }, { id: 'brick', title: 'Fired brick', hint: 'Clay turns into brick after a while above about 900°C, hotter than an open wood fire gets. Blow clay lumps into a coal fire, best walled in like a furnace, and vacuum up the brick rubble. Brick rubble builds brick blocks.', reward: 'Brick insulates far better than stone and survives 1750°C.' }, { id: 'charcoal', title: 'Charcoal', hint: 'Wood that gets hot without air turns into charcoal instead of burning. Bury a burning pile of wood chunks under dirt, or heat a sealed box of wood chunks from outside.', reward: 'A fuel you can grow: nearly as hot as coal.' }, { id: 'grow', title: 'Plant a tree', msg: 'Wood is renewable. Plant rows of acorns on dirt to farm it.', hint: 'Cutting down a tree drops acorns. Leave one on dirt or grass under open sky and it sprouts, then grows into a tree in about a minute and a half.' }, - { id: 'copper', title: 'Molten copper', msg: 'Molten copper sinks to the bottom of the charge. Get it into a mold before it sets.', hint: 'Copper ore melts at 1085°C. An open fire loses too much heat, so wall coal and ore in with blocks and leave a small vent at the top for smoke. Mix ore and coal about half and half: click coal in your bag, then mark copper ore with ⬆. Right click blows an even mix.' }, + { id: 'copper', title: 'Molten copper', msg: 'Molten copper sinks to the bottom of the charge. Get it into a mold before it sets.', hint: 'Copper ore melts at 1085°C. An open fire loses too much heat, so wall coal and ore in with blocks and leave a small vent at the top for smoke. Mix ore and coal about half and half: in the vacuum menu (F), mark coal and copper ore with ⬆. Right click blows an even mix.' }, { id: 'bars', title: 'Copper bars', msg: 'Bars sell for far more than the ore in them, and make metal wall blocks.', hint: 'Build an Ingot mold (Build, 3) right under the furnace with a floor of clay Grates between them: molten copper drips through, while the charge and the thick slag stay up. When the bars set, they drop out of the bottom of the mold onto whatever is under it; a belt carries them off. Leave space below, or vacuum up the bars. Ingot molds empty themselves: bars, junk and scrap drop below, slag is thrown away and the grate above is raked. Removing any mold returns its set metal to your bag: whole bars as bars, the rest as scrap. Copper that sets in the furnace melts again next firing.' }, { id: 'bit1', title: 'Copper drill bit', hint: 'Cast copper in a Bit mold. Building the furnace right on top works. A Grate over the funnel keeps the charge out. Let it set, then press F.', reward: 'Copper bit. You can now dig iron ore.' }, { id: 'auto', title: 'Moving parts', msg: 'Machines can now haul for you. Feed furnaces automatically, and lift ore out of your mines.', hint: 'Belts carry grains and bars resting on them. Screw tubes push loose material along (never liquids); stacked pointing up they lift it out of a mine. A Filter lets one material fall through and carries the rest along, so you can sort ore from rubble. Move 300 grains with machines.' }, diff --git a/src/styles/style.css b/src/styles/style.css index a068fd8..484b69e 100644 --- a/src/styles/style.css +++ b/src/styles/style.css @@ -177,8 +177,7 @@ table.mt td.dip { color: var(--melt); } #baglist .bagrow.on { border-color: var(--patina-dim); background: rgba(92, 186, 166, 0.08); } #baglist .bagrow .pick { flex: 1; min-width: 0; } #baglist .bagrow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -#baglist .mark { flex: none; width: 20px; height: 20px; padding: 0; justify-content: center; color: var(--ash-dim); } -#baglist .mark.on { color: var(--patina); } +#baglist .tag { flex: none; padding: 0 3px; color: var(--patina); font-size: 11px; } #selcard .vacrow { flex-wrap: wrap; gap: 4px; } #selcard .vacrow .sw { width: 9px; height: 9px; } #baglist .baghint { color: var(--ash-dim); font-size: 0.82em; padding: 4px 4px 0; } @@ -316,14 +315,14 @@ input.text { background: var(--soot-0); border: 1px solid var(--soot-4); border- .toast { animation: none; } } /* wall material picker */ -.wpick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: min(60vh, 490px); overflow-y: auto; padding: 2px; } -.wpick .wp { display: flex; align-items: flex-start; gap: 8px; text-align: left; padding: 8px; border-radius: 6px; border: 1px solid var(--soot-4); background: var(--soot-2); color: var(--bone); font: inherit; font-size: 12px; cursor: pointer; min-width: 0; } -.wpick .wp > span:last-child { min-width: 0; overflow-wrap: anywhere; } -.wpick .wp span span { display: block; color: var(--ash); margin-top: 3px; } -.wpick .wp.short { opacity: 0.55; } -.wpick .wp:hover { background: #2d2724; } -.wpick .wp.on { border-color: #e59a52; background: #33261c; } -.wpick .wp:focus-visible, [data-wall-picker]:focus-visible { outline: 2px solid #e59a52; outline-offset: 1px; } +:is(.wpick, .vpick) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: min(60vh, 490px); overflow-y: auto; padding: 2px; } +:is(.wpick, .vpick) .wp { display: flex; align-items: flex-start; gap: 8px; text-align: left; padding: 8px; border-radius: 6px; border: 1px solid var(--soot-4); background: var(--soot-2); color: var(--bone); font: inherit; font-size: 12px; cursor: pointer; min-width: 0; } +:is(.wpick, .vpick) .wp > span:last-child { min-width: 0; overflow-wrap: anywhere; } +:is(.wpick, .vpick) .wp span span { display: block; color: var(--ash); margin-top: 3px; } +:is(.wpick, .vpick) .wp.short { opacity: 0.55; } +:is(.wpick, .vpick) .wp:hover { background: #2d2724; } +:is(.wpick, .vpick) .wp.on { border-color: #e59a52; background: #33261c; } +:is(.wpick, .vpick) .wp:focus-visible, [data-wall-picker]:focus-visible { outline: 2px solid #e59a52; outline-offset: 1px; } [data-wall-picker] { cursor: pointer; } /* filter picker */ .fpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: min(52vh, 420px); overflow-y: auto; padding: 2px; } @@ -362,3 +361,9 @@ input.text { background: var(--soot-0); border: 1px solid var(--soot-4); border- .world-actions input { flex: 1; min-width: 120px; max-width: 100%; } #m-dialog { z-index: 21; } #continue-meta { max-width: 72%; overflow-wrap: anywhere; text-align: right; } + +.vpick { max-height: min(48vh, 390px); } +.vtoggles { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; } +.vtoggles button { padding: 4px 7px; font-size: 11px; } +.vtoggles button.on { border-color: #e59a52; background: #533820; color: var(--bone); } +.vacchoice { display: flex; align-items: center; gap: 4px; text-align: left; min-width: 0; background: transparent; border: 0; padding: 0; cursor: pointer; } diff --git a/src/ui/actions.js b/src/ui/actions.js index db97faf..23cd30b 100644 --- a/src/ui/actions.js +++ b/src/ui/actions.js @@ -44,6 +44,7 @@ function doInteract() { if (msg) break outer; } if (msg) { setStatus(msg, 'info'); if (!/^New (drill bit|bag)/.test(msg)) toast(msg); } + else if (toolId() === 'vacuum') openVacuumMenu(); else if ((moldAt(ax, ay) || {}).kind !== 'ingot') setStatus('Nothing to use there.', 'info'); // an ingot mold needs no F: say nothing } // Pick (middle mouse): the piece under the cursor becomes the one you build, with its @@ -118,10 +119,7 @@ function primaryPress(shift) { return; } if (t === 'vacuum') { - const g = GAME.pickMode === 'first' ? grainAt(ax, ay) : 0; - GAME.vacFilter = shift || GAME.pickMode === 'all' ? -1 : g; - GAME.vacLocked = shift || GAME.pickMode !== 'first' || !!g; - if (!shift && GAME.pickMode === 'marked' && !GAME.collect.size) setStatus('Nothing marked to pick up. R over something, or ⬇ in the bag.', 'info'); + GAME.vacFilter = shift || !GAME.collect.size ? -1 : 0; hudDirty = true; } else if (t === 'build') { const P = piece(); @@ -188,7 +186,7 @@ function primaryRelease(shift) { if (r.n || ghosts) { playSfx('place'); setStatus(gtxt || (r.status ? r.status + hint : ''), 'info'); } else { setStatus((r.status || 'Nothing placed.') + hint); playSfx('error'); } GAME.drag = null; GAME.dragDir = -1; hudDirty = true; } - if (t === 'vacuum') { GAME.vacFilter = 0; GAME.vacLocked = false; hudDirty = true; } + if (t === 'vacuum') { GAME.vacFilter = 0; hudDirty = true; } } function secondaryPress() { const t = toolId(); @@ -207,13 +205,9 @@ function toolTick() { const r = toolPulse(ax, ay, GAME.drillW, GAME.drillTune); if (r.fired) { playSfx('pulse', GAME.drillW); if (r.status) setStatus(r.status); } } else if (t === 'vacuum') { - if (!GAME.vacLocked && GAME.pickMode === 'first') { const g = grainAt(ax, ay); if (g) { GAME.vacFilter = g; GAME.vacLocked = true; hudDirty = true; } } - const f = GAME.vacFilter, marked = GAME.pickMode === 'marked', list = GAME.collect; - if (f || marked && list.size) { - const r = toolVacuum(ax, ay, GAME.brush[1], f < 0 ? () => true : marked ? m => list.has(m) : m => m === f); - if (r.got) { playSfx('suck'); hudDirty = true; } - if (r.status) setStatus(r.status); - } + const r = toolVacuum(ax, ay, GAME.brush[1], GAME.vacFilter < 0 || !GAME.collect.size ? () => true : m => GAME.collect.has(m)); + if (r.got) { playSfx('suck'); hudDirty = true; } + if (r.status) setStatus(r.status); } else if (t === 'ignite') { if (inReach(ax, ay)) { const r = toolIgnite(ax, ay); playSfx('spark'); if (Math.random() < 0.6) spawnSpark(ax + 0.5, ay + 0.5); if (!r.fuel) setStatus('Aim at coal or wood touching air to light it.'); } else setStatus('Out of reach.'); diff --git a/src/ui/build-menu.js b/src/ui/build-menu.js index 1031f1c..9a61c7a 100644 --- a/src/ui/build-menu.js +++ b/src/ui/build-menu.js @@ -86,7 +86,7 @@ function renderBuildBar() { pop.style.left = `${Math.max(8, Math.min(innerWidth - w - 8, r.left + r.width / 2 - w / 2)) - br.left}px`; } function setupBuildBar() { - $('selcard').addEventListener('click', e => { if (e.target.closest('[data-wall-picker]')) openWallPicker(); else if (e.target.closest('[data-pick-mode]')) cyclePickMode(); }); + $('selcard').addEventListener('click', e => { if (e.target.closest('[data-wall-picker]')) openWallPicker(); else if (e.target.closest('[data-vac-menu]')) openVacuumMenu(); }); const bar = $('buildbar'); if (!bar) return; bar.addEventListener('click', e => { const t = e.target.closest('[data-cat],[data-piece]'); if (!t) return; diff --git a/src/ui/gamepad.js b/src/ui/gamepad.js index d0e1102..88cfb1b 100644 --- a/src/ui/gamepad.js +++ b/src/ui/gamepad.js @@ -45,7 +45,7 @@ function pollPad() { if (padPressed(gp, 0)) doInteract(); if (padPressed(gp, 2)) rotate(); if (padPressed(gp, 3)) toggleLens(); - if (padPressed(gp, 1)) { if (GAME.drag) GAME.drag = null; else if (GAME.paste) { GAME.paste = false; hudDirty = true; } else if (toolId() === 'vacuum') cyclePickMode(); } + if (padPressed(gp, 1)) { if (GAME.drag) GAME.drag = null; else if (GAME.paste) { GAME.paste = false; hudDirty = true; } } if (padPressed(gp, 10)) bot.lamp = !bot.lamp; if (padPressed(gp, 11)) { SET.zoom = SET.zoom >= 10 ? 2 : SET.zoom + 2; saveSettings(); resizeRender(); R.snapNext = true; } if (padPressed(gp, 8)) openNotebook(); diff --git a/src/ui/input.js b/src/ui/input.js index 79c22ae..efbc083 100644 --- a/src/ui/input.js +++ b/src/ui/input.js @@ -27,7 +27,7 @@ window.addEventListener('keydown', e => { case 'q': if (e.shiftKey && toolId() === 'build') cycleBuildCat(-1); else cycleItem(-1); break; case 'e': if (e.shiftKey && toolId() === 'build') cycleBuildCat(1); else cycleItem(1); break; case 'r': rotate(); break; - case 't': if (toolId() === 'vacuum') cyclePickMode(); else if (toolId() === 'build' && piece().filter) pickFilterUnderCursor(); break; + case 't': if (toolId() === 'build' && piece().filter) pickFilterUnderCursor(); break; case 'f': doInteract(); break; case 'g': GAME.replace = true; hudDirty = true; break; case 'h': toggleLens(); break; diff --git a/src/ui/notebook.js b/src/ui/notebook.js index bdc4c37..4bdf045 100644 --- a/src/ui/notebook.js +++ b/src/ui/notebook.js @@ -170,18 +170,18 @@ function controlsHtml() { const kb = [ ['Fly', 'W A S D'], ['Boost while flying', 'Shift'], ['Tool modifier (while not flying)', 'Shift'], ['Use tool', 'Left mouse'], ['Second action', 'Right mouse'], ['Tools', '1 – 4'], ['Cycle what you blow · piece', 'Q / E'], ['Switch build tab', 'Shift + Q / E'], ['Variant: material · direction · flip', 'R'], ['Wall or mold material menu (Build)', 'F'], - ['Mark/unmark what is under the cursor (Vacuum)', 'R'], ['Pick-up mode (Vacuum)', 'T'], ['Nozzle or brush size', '[ ] or Shift + wheel'], + ['Mark/unmark what is under the cursor (Vacuum)', 'R'], ['Vacuum menu: what to pick up and blow', 'F (with the Vacuum, away from anything to use)'], ['Nozzle or brush size', '[ ] or Shift + wheel'], ['Replace what is built (Build)', 'Hold G'], ['Copy a box of what you built', 'Hold C, drag'], ['Cut a box (refunded, paste it back)', 'Hold X, drag'], ['Paste again', 'V'], ['Undo building', 'Ctrl + Z'], ['Blueprint library', 'B'], ['Zoom', 'Mouse wheel'], ['Interact (gates, molds, fans, filters)', 'F'], ['Thermal lens', 'H'], ['Info overlay: filters, belt and tube directions', 'I'], ['Bot lamp', 'L'], ['Pick the piece under the cursor (with its direction and settings)', 'Middle mouse'], ['Notebook', 'N'], ['Clear all blueprint ghosts', 'Delete'], ['Save', 'Ctrl + S'], ['Pause · menu', 'Esc'], ['Mute', 'M'], ]; const pad = [ ['Fly', 'Left stick'], ['Boost', 'Left stick pushed all the way'], ['Aim', 'Right stick'], ['Use tool · suck', 'RT'], ['Second action · blow', 'LT'], ['Tools', 'LB / RB'], - ['Cycle what you blow · piece', 'D-pad ← →'], ['Brush size', 'D-pad ↑ ↓'], ['Interact', 'A'], ['Variant · mark material', 'X'], ['Pick-up mode (Vacuum)', 'B'], ['Thermal lens', 'Y'], + ['Cycle what you blow · piece', 'D-pad ← →'], ['Brush size', 'D-pad ↑ ↓'], ['Interact', 'A'], ['Variant · mark material', 'X'], ['Thermal lens', 'Y'], ['Cancel', 'B'], ['Zoom', 'R3'], ['Lamp', 'L3'], ['Notebook', 'View / Back'], ['Menu', 'Menu / Start'], ]; const tools = [ ['1 Resonance drill', 'Hold left click to send pulses from the bot toward the cursor: rock they shake hard enough shatters and falls as rubble, ore, coal or scrap, and trees come apart into wood chunks and acorns. Q and E set the pulse width: narrow bores a tunnel fast, wide clears a big cone slowly, medium is in between. R over a material tunes the drill to it, so only that shatters (great for pulling a vein out of the rock); R again untunes. Built blocks are never harmed. Better bits dig harder rock, faster and further.'], - ['2 Vacuum', 'Left click picks up what you click, only marked materials, or everything: T or the card chip changes the mode. R over a grain or ⬇ in the bag marks it for pick-up. Adding a mark switches to Only marked; removing the last returns to What I click. Hold Shift while not flying to take everything. Right click blows the materials marked ⬆ in the bag as an even mix. Bars blow one at a time. Click a name or use Q/E to blow only one material; it stays chosen when empty. Pick-up and blow marks are separate.'], + ['2 Vacuum', 'Left click picks up everything, or only marked materials once you mark some. F opens the vacuum menu to mark what to pick up (⬇) and blow (⬆). R over a grain marks it. Hold Shift while not flying to take everything. Right click blows the ⬆ materials as an even mix, bars one at a time. Click a bag name or use Q/E to blow only one; it stays chosen when empty.'], ['3 Build', 'Places pieces on a grid of 4×4 blocks: wall blocks, belts, tubes, filters, grates, gates, pipes, pumps and outlets, machines (fans, the Refiner) and molds. Drag for a line, hold Shift while dragging for a filled rectangle. Right click takes a piece back. Your bot flies through anything you build.'], ['4 Igniter', 'Heats a small spot to 640°C, and its flame reaches a few grains into a pile. Enough to light coal and wood that touch air.'], ['Copy, cut and paste', 'Hold C (copy) or X (cut) and drag a box over what you built; let go and it is picked up, ready to paste. Cut takes it down and refunds it to your bag. Click to place ghosts: your bot builds them from your bag when it is close. R flips, V pastes again, right click or Esc stops. Ctrl+Z undoes building. The notebook (B) keeps saved blueprints and a few starter designs.'], @@ -191,9 +191,9 @@ function controlsHtml() {
Keyboard and mouse
${tbl(kb)}Gamepad
${tbl(pad)}First steps
1. Drill down a little. Stone falls as rubble; coal (dark seams), copper ore (green speckles) and clay (reddish) come loose too.
- 2. With the Vacuum, click on coal to suck up only coal, then the copper ore, rubble and clay you want.
+ 2. With the Vacuum, left click to pick up loose materials. To take only coal, copper ore, rubble or clay, mark what you want in the vacuum menu (F).
3. Build (3) a chamber of stone wall blocks with a one-block vent in the roof, a floor of clay Grates, and an Ingot mold right under the grates. The notebook's Blueprints tab has this as a starter design.
- 4. Click coal in your bag, then mark copper ore with ⬆ to blow both. Fly inside (the bot passes through what you build) and right click to blow an even mix onto the grates: about 50 of each. (Ore first and coal on top works too; coal buried under ore will not light.) Light a coal grain on top with the Igniter.
+ 4. In the vacuum menu (F), mark coal and copper ore with ⬆ to blow both. Fly inside (the bot passes through what you build) and right click to blow an even mix onto the grates: about 50 of each. (Ore first and coal on top works too; coal buried under ore will not light.) Light a coal grain on top with the Igniter.
5. When the ingot sets, bars drop out of the bottom of the mold onto whatever is under it. Leave one open block under it: a belt below that carries them off, or vacuum them up. Leftover metal stays for the next firing. Ingot molds empty themselves: bars, junk and scrap drop below, slag is thrown away and the grate above is raked. Removing any mold returns its set metal to your bag: whole bars as bars, the rest as scrap.
Screw tubes carry grains and whole bars: feed bars in from a belt, turn corners and unload at the mouth.
6. Blow the bars into the trade dock: they sell the moment they drop through its grate, and bars pay far more than ore. Watch the Market page for orders that pay double. Money buys belts, screw tubes and fans; pay down the claim there too.
diff --git a/src/ui/previews.js b/src/ui/previews.js
index 2156e1e..ffa34b4 100644
--- a/src/ui/previews.js
+++ b/src/ui/previews.js
@@ -153,9 +153,9 @@ function drawPreviews() {
if (t === 'vacuum') {
// what the right button would blow, next to the cursor; what the left is sucking, while it sucks
const sz = Math.max(6, zp * 1.6), qx = p.x + (r + 1.2) * zp, qy = p.y - (r + 1.2) * zp;
- const swatches = GAME.lmb && GAME.pickMode === 'first' && GAME.vacFilter > 0 ? [GAME.vacFilter] : GAME.lmb && GAME.pickMode === 'marked' && GAME.vacFilter >= 0 ? [...GAME.collect] : blowList();
+ const swatches = GAME.lmb ? GAME.vacFilter >= 0 && GAME.collect.size ? [...GAME.collect] : [] : blowList();
swatches.slice(0, 4).forEach((m, k) => { ctx.fillStyle = rgbOf(m); ctx.fillRect(qx + k * (sz + 2), qy, sz, sz); });
- if (blowing || (GAME.lmb && GAME.vacFilter)) {
+ if (blowing || GAME.lmb) {
// faint line from the nozzle: the path the grains take
const c = worldToScreenPx(bot.x + bot.w / 2, bot.y + bot.h / 2);
ctx.strokeStyle = blowing ? 'rgba(255,210,122,0.22)' : 'rgba(92,186,166,0.22)'; ctx.lineWidth = Math.max(1, zp * (r + 0.5) * 0.6);
diff --git a/src/ui/selection.js b/src/ui/selection.js
index c24207d..f81ec52 100644
--- a/src/ui/selection.js
+++ b/src/ui/selection.js
@@ -53,23 +53,10 @@ function rotate() {
else return;
playSfx('ui'); hudDirty = true;
}
-const PICK_MODES = ['first', 'marked', 'all'];
-const PICK_LABELS = { first: 'What I click', marked: 'Only marked', all: 'Everything' };
-function setPickMode(mode) {
- GAME.pickMode = mode;
- try { localStorage.setItem('deepgrain.pickMode', mode); } catch (e) { /* storage unavailable */ }
- hudDirty = true;
-}
-function cyclePickMode() {
- setPickMode(PICK_MODES[(PICK_MODES.indexOf(GAME.pickMode) + 1) % PICK_MODES.length]);
- playSfx('ui');
-}
function toggleCollect(m) {
if (!m) return;
const add = !GAME.collect.has(m);
if (add) GAME.collect.add(m); else GAME.collect.delete(m);
- if (add && GAME.pickMode !== 'marked') { setPickMode('marked'); setStatus('Picking up only marked materials.', 'info'); }
- else if (!GAME.collect.size && GAME.pickMode === 'marked') setPickMode('first');
try { localStorage.setItem('deepgrain.collect', JSON.stringify([...GAME.collect])); } catch (e) { /* storage unavailable */ }
lastBagKey = ''; hudDirty = true; playSfx('ui');
}
@@ -154,6 +141,34 @@ function openFilterPicker(cur, onDone, title) {
box.querySelectorAll('[data-m]').forEach(b => b.onclick = () => { const m = +b.dataset.m; if (sel.has(m)) sel.delete(m); else sel.add(m); playSfx('ui'); sync(); });
sync();
}
+function openVacuumMenu() {
+ ensureBlow();
+ dialog('Vacuum', '', [
+ { label: 'Pick up everything', cls: 'ghost', fn: () => {
+ GAME.collect.clear();
+ try { localStorage.setItem('deepgrain.collect', '[]'); } catch (e) { /* storage unavailable */ }
+ lastBagKey = ''; hudDirty = true; playSfx('ui'); sync(); return true;
+ } },
+ { label: 'Blow one at a time', cls: 'ghost', fn: () => {
+ GAME.blow = new Set(blowList().slice(0, 1));
+ lastBagKey = ''; hudDirty = true; playSfx('ui'); sync(); return true;
+ } },
+ { label: 'Done', cls: 'primary' },
+ ]);
+ const box = $('dlg-body');
+ function sync() {
+ const list = BAG_ORDER.filter(m => bag[m] > 0)
+ .concat(BAG_ORDER.filter(m => !bag[m] && (GAME.collect.has(m) || GAME.blow.has(m))))
+ .concat(BAG_ORDER.filter(m => !bag[m] && !GAME.collect.has(m) && !GAME.blow.has(m) && seen[m] && filterable(m)));
+ const blow = blowList();
+ box.innerHTML = `
${esc(GAME.collect.size ? 'Picking up only ' + matList([...GAME.collect]) + '.' : 'Picking up everything.')} Blowing out ${blow.length > 1 ? `an even mix of ${blow.length}` : blow.length ? esc(MD[blow[0]].name.toLowerCase()) : 'nothing'}.
` + + (!GAME.collect.size ? 'Mark materials to pick up only those.
' : '') + + (list.length ? `Find something loose first.
'); + box.querySelectorAll('[data-vm-pick]').forEach(b => b.onclick = () => { toggleCollect(+b.dataset.vmPick); sync(); }); + box.querySelectorAll('[data-vm-blow]').forEach(b => b.onclick = () => { toggleBlow(+b.dataset.vmBlow); sync(); }); + } + sync(); +} function openWallPicker() { const P = piece(), title = P.kind === 'mold' ? `${P.name} material` : 'Wall material'; const list = WALL_LIST.filter(m => bag[m] > 0).concat(WALL_LIST.filter(m => !bag[m])); @@ -211,13 +226,12 @@ function renderSelCard() { + '