Identify ores with the cursor: pinged veins, ores-only label, vein outline (t77)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-27 17:43:49 -04:00
co-authored by Claude Opus 5.5
parent f4ca1cae57
commit f193b1c76c
11 changed files with 214 additions and 23 deletions
+16
View File
@@ -167,6 +167,22 @@ function drawPing() {
}
ctx.restore();
}
// Edges are built once when the cursor enters a different vein.
function drawHoveredVein() {
if (SET.cursorLabel === 'off' || (!GAME.mouse.in && !GAME.usingPad)) return;
const vein = hoveredVein(Math.floor(GAME.aim.x), Math.floor(GAME.aim.y));
if (!vein) return;
const ctx = R.ctx, zp = R.zp;
ctx.save(); ctx.beginPath(); ctx.rect(0, 0, R.canvas.width, R.canvas.height); ctx.clip();
ctx.strokeStyle = 'rgba(235,245,255,0.85)'; ctx.lineWidth = 1;
ctx.beginPath();
for (const e of vein.edges) {
if (e[2] < R.vx0 || e[0] > R.vx0 + R.bw || e[3] < R.vy0 || e[1] > R.vy0 + R.bh) continue;
const a = worldToScreenPx(e[0], e[1]);
ctx.moveTo(a.x, a.y); ctx.lineTo(a.x + (e[2] - e[0]) * zp, a.y + (e[3] - e[1]) * zp);
}
ctx.stroke(); ctx.restore();
}
// While the ping recharges, a thin arc around the bot fills up (only with the drill in hand).
function drawPingRecharge() {
if (toolId() !== 'drill' || GAME.pingTick === undefined || tick < GAME.pingTick) return;