From 60d4a9c676aba06a3815af5382b428aa44ec5ffa Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sat, 24 Dec 2022 07:13:59 -0800 Subject: [PATCH] Disable the art-generation form when the puzzle hunt is over Like Coda says, the AI has been rendered inert at this point. --- index.html | 6 ++++++ index.js | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/index.html b/index.html index 92e115e..8db8b69 100644 --- a/index.html +++ b/index.html @@ -139,6 +139,12 @@ mute.addEventListener("click", () => { comments.appendChild(dd); } + // When we enter the endgame, we disable the art-generation form, + // (just hide it) + socket.on('endgame', () => { + zombo_form.style.display = "none"; + }); + socket.on('comment', function(comment) { const comments = document.querySelector("#comments_" + comment.image_id); add_comment(comments, comment); diff --git a/index.js b/index.js index 29f304b..a369ecb 100644 --- a/index.js +++ b/index.js @@ -556,6 +556,11 @@ io.on('connection', (socket) => { socket.emit('inform-name', socket.request.session.name); } + // And if we're in the endgame, let them know that + if (state.endgame) { + socket.emit('endgame'); + } + // Replay old comments and images to a newly-joining client socket.emit('reset'); state.images.forEach((image) => { @@ -598,6 +603,15 @@ io.on('connection', (socket) => { }); function endgame() { + state.endgame = true; + + // Tell all clients we are in the endgame, (which will disable + // any additional image generation, both showing that Coda is + // correc that Zombo.com has been rendered inert, and also + // making clear to the boys that they have everything they + // need). + io.emit('endgame'); + // Before revealing Coda's final image, have her comment on // each of the weaknesses, in order to bring them to the top // of the feed. -- 2.43.0