From f61db08e064a280f6653d7294c44824fb5988d6b Mon Sep 17 00:00:00 2001 From: peshomir <80340328+peshomir@users.noreply.github.com> Date: Sat, 28 Jun 2025 17:37:24 +0300 Subject: [PATCH] Point users to the stable custom lobby version when the custom lobby button in the main menu is clicked --- src/customLobby.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/customLobby.js b/src/customLobby.js index ac41b73..bb17baf 100644 --- a/src/customLobby.js +++ b/src/customLobby.js @@ -1,5 +1,6 @@ import WindowManager from "./windowManager.js"; +const customLobbiesUnavailable = true; //const socketURL = "ws://localhost:8080/"; const socketURL = "wss://fx.peshomir.workers.dev/"; const customMessageMarker = 120; @@ -15,6 +16,15 @@ WindowManager.add({ name: "lobbyJoinMenu", element: document.getElementById("customLobbyJoinMenu") }) + +if (customLobbiesUnavailable) { + const window = WindowManager.create({ + name: "customLobbiesUnavailable", + closeWithButton: true + }); + window.innerHTML = `

The latest version of FX Client doesn't support custom lobbies yet. Use the stable version at https://fxclient.github.io/custom-lobbies

`; +} + const windowElement = WindowManager.create({ name: "customLobby", classes: "scrollable selectable flex-column text-align-center", @@ -155,6 +165,8 @@ function setSelectMenuOptions(options, element) { } function showJoinPrompt() { + if (customLobbiesUnavailable) + return WindowManager.openWindow("customLobbiesUnavailable"); WindowManager.openWindow("lobbyJoinMenu"); } document.getElementById("lobbyCode").addEventListener("input", ({ target: input }) => { @@ -301,6 +313,7 @@ function rejoinLobby() { function checkForLobbyLink(isHashChangeEvent) { const hash = window.location.hash; if (hash.startsWith("#lobby=")) { + if (customLobbiesUnavailable) return WindowManager.openWindow("customLobbiesUnavailable"); // in case the player is already in a lobby if (isHashChangeEvent) leaveLobby(); currentCode = hash.slice(7);