From 09d99f2c3028e27b397df8471baec29975ec154b Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Mon, 19 Oct 2026 12:34:00 +0200 Subject: [PATCH] ui: "click screen" hit before audio unmuted --- CHANGELOG.md | 2 +- css/ui.css | 6 +++ index.html | 1 + src/common/audio.ts | 83 +++++++++++++++++++++++++++++++++++++++--- src/ide/ui.ts | 21 +++++++++++ test/unit/testaudio.ts | 46 ++++++++++++++++++++++- 6 files changed, 151 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d417eb2..74080bf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,7 +44,7 @@ See [extension/CHANGELOG.md](extension/CHANGELOG.md). - "Share Playable Link" packs the game into the URL fragment instead of the query string, so it no longer hits the web server's ~8 KB request-line limit, and encodes it as URL-safe Base64 to avoid percent-encoding. Old `?r=` links still play. - Removed the Markdown/Showdown platform, the old `script` platform, Google Analytics, Sentry (replaced with a new error-reporting endpoint) and the HTTPS redirect. - "Highlight Executed Lines" draws a hot/cold heat map: lines run since the last update are colored by how often they have run (blue = cold, red = hot) and disappear once they stop executing. -- Audio reliably unlocks under the browser autoplay policy: the emulator resumes its `AudioContext` on the first click/keypress anywhere on the page, not only when the emulator canvas gets focus. +- Audio reliably unlocks under the browser autoplay policy: the emulator resumes its `AudioContext` on the first click/keypress anywhere on the page, not only when the emulator canvas gets focus. A hint under the emulator screen says so until it is unlocked. - Memory Map: a Modules column shows each object file's slice of every SDCC or cc65 segment (`Segment.modules`; SDCC from the `.rel` sizes in link order, with the remainder as `(libraries)`; cc65 from the ld65 map's module list, library members by name). - Memory Browser: a symbol label covers only its reported size, and an unsized symbol stops at its segment boundary instead of running into the next segment. diff --git a/css/ui.css b/css/ui.css index 0c030a3b..405c6b76 100644 --- a/css/ui.css +++ b/css/ui.css @@ -1029,6 +1029,12 @@ div.asset_toolbar { margin-top: auto; margin-bottom: 2em; } +.audio-hint { + color: #ccc; + margin-top: 0.5em; + margin-left: 1em; + margin-right: 1em; +} .control-key { border: 2px solid rgba(0,0,0,0.2); border-radius: 0.6em; diff --git a/index.html b/index.html index 3a7cc619..28c1d229 100644 --- a/index.html +++ b/index.html @@ -298,6 +298,7 @@ body {
+