]> git.cworth.org Git - zombocom-ai/commitdiff
Disable the art-generation form when the puzzle hunt is over
authorCarl Worth <cworth@cworth.org>
Sat, 24 Dec 2022 15:13:59 +0000 (07:13 -0800)
committerCarl Worth <cworth@cworth.org>
Sat, 24 Dec 2022 15:18:41 +0000 (07:18 -0800)
Like Coda says, the AI has been rendered inert at this point.

index.html
index.js

index 92e115ede8e264b75a77843e21cf39ebbd5aff7f..8db8b695b93b68c2187af45978e1fe4e8a07e6c0 100644 (file)
@@ -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);
index 29f304bd13e2b3015c32b54af60fd94eee5227de..a369ecb59e62227ee0f13756680d30d66a69533f 100644 (file)
--- 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.