From b9d01115348a3e8ab922fb431750ba8ab2076a3a Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Mon, 27 Jul 2026 21:21:33 -0700 Subject: [PATCH] Expose system controls over custom cursors --- system/public/aesthetic.computer/bios.mjs | 42 +++++++++++++++---- .../aesthetic.computer/disks/nopaint.mjs | 2 +- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/system/public/aesthetic.computer/bios.mjs b/system/public/aesthetic.computer/bios.mjs index 83d7b9533b..9d362e46fb 100644 --- a/system/public/aesthetic.computer/bios.mjs +++ b/system/public/aesthetic.computer/bios.mjs @@ -12884,7 +12884,18 @@ async function boot(parsed, bpm = 60, resolution, debug) { handler.state = "up"; } }; - handler.state = hitboxes[content.label]?.state || "up"; + handler.contains = (e) => { + const frame = canvas.getBoundingClientRect(); + const xscale = projectedWidth / canvas.width; + const yscale = projectedHeight / canvas.height; + return Box.from({ + x: frame.left + content.box.x * xscale, + y: frame.top + content.box.y * yscale, + w: content.box.w * xscale, + h: content.box.h * yscale, + }).contains({ x: e.x, y: e.y }); + }; + handler.state = hitboxes[content.label]?.state || "up"; hitboxes[content.label] = handler; return; @@ -12972,9 +12983,11 @@ async function boot(parsed, bpm = 60, resolution, debug) { tiny: "none", dot: "none", }; - if (code === "native") document.body.classList.add("native-cursor"); - else document.body.classList.remove("native-cursor"); - document.body.style.cursor = code in CURSOR_CSS ? CURSOR_CSS[code] : code; + if (code === "native") document.body.classList.add("native-cursor"); + else document.body.classList.remove("native-cursor"); + const cursorCss = code in CURSOR_CSS ? CURSOR_CSS[code] : code; + window.acPieceCursorCss = cursorCss; + document.body.style.cursor = cursorCss; return; } @@ -22074,11 +22087,22 @@ async function boot(parsed, bpm = 60, resolution, debug) { keys(hitboxes).forEach((key) => hitboxes[key]?.(e)); }); - window.addEventListener("pointerdown", async (e) => { - keys(hitboxes).forEach((key) => hitboxes[key]?.(e)); - }); - - // 📄 Drag and Drop File API + window.addEventListener("pointerdown", async (e) => { + keys(hitboxes).forEach((key) => hitboxes[key]?.(e)); + }); + + // BIOS overlays stay reachable when a piece hides the OS pointer in favor + // of a painted cursor. Raise the native hand over system hitboxes, then + // restore the piece's exact cursor request when it leaves. + window.addEventListener("pointermove", (e) => { + const overSystemControl = keys(hitboxes).some((key) => + hitboxes[key]?.contains?.(e)); + document.body.style.cursor = overSystemControl + ? "pointer" + : (window.acPieceCursorCss || "auto"); + }); + + // 📄 Drag and Drop File API // Drag over... document.body.addEventListener("dragover", function (e) { diff --git a/system/public/aesthetic.computer/disks/nopaint.mjs b/system/public/aesthetic.computer/disks/nopaint.mjs index 1c096fdada..6e507d4115 100644 --- a/system/public/aesthetic.computer/disks/nopaint.mjs +++ b/system/public/aesthetic.computer/disks/nopaint.mjs @@ -302,7 +302,7 @@ function paintMarkerLabel($, button, label, color) { function paintDecisionButton($, button, label, flavor = "no") { const active = button.down || button.over; const palette = flavor === "paint" - ? { fill: [250, 250, 250, active ? 235 : 205], ink: [20, 20, 20] } + ? { fill: [45, 170, 76, active ? 255 : 235], ink: [245, 255, 245] } : flavor === "back" ? { fill: [232, 119, 28, active ? 255 : 235], ink: [255, 250, 235] } : flavor === "done" -- 2.51.2