show main menu as background to initial login; show splash screen upon press of close...
authorGeoffrey Allott <geoffrey@allott.email>
Sat, 17 Jun 2023 22:27:41 +0000 (23:27 +0100)
committerGeoffrey Allott <geoffrey@allott.email>
Sat, 17 Jun 2023 22:27:41 +0000 (23:27 +0100)
site/modules/socket.js

index f62eda1e9e94e159082f228fc418d94749798c0f..20f018a72e000363c7d8c4be50d037fb61a30b8a 100644 (file)
@@ -30,6 +30,9 @@ export class Socket {
 
         this.scheduled_actions = [];
         this.schedule_timeout = null;
+
+        this.game = new MainMenu(this.container, message => this.send(message));
+        this.container.append(this.close_button());
     }
 
     onopen() {
@@ -294,6 +297,10 @@ export class Socket {
                 this.send({type: "LeaveGame"});
                 this.send({type: "JoinLobby", filter: this.last_filter});
                 break;
+            default:
+                this.show_login();
+                this.splash.show();
+                break;
         }
     }