From 4e8f7a70e3f16f892f037ffa9c1fe7cd914c943f Mon Sep 17 00:00:00 2001 From: Cassian Godsted Date: Mon, 2 Dec 2024 16:11:53 -0500 Subject: [PATCH] Ensure at least one loader is checked --- res/script.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/res/script.js b/res/script.js index 0f894b0..f37fa79 100644 --- a/res/script.js +++ b/res/script.js @@ -174,6 +174,10 @@ function refreshFabricLikeCheckbox() { fabricLikeInput.disabled = !hasFabricLike; } +function isLoaderChecked() { + return document.getElementById("fabric-loader-input").checked || document.getElementById("forge-loader-input").checked || document.getElementById("neoforge-loader-input").checked || document.getElementById("quilt-loader-input").checked +} + document.getElementById("generate-button").onclick = async () => { updateState(); @@ -186,6 +190,9 @@ document.getElementById("generate-button").onclick = async () => { } else if (state.package_name === "") { showError("Package name is empty"); return; + } else if (!isLoaderChecked()) { + showError("You need to choose at least one subproject first!") + return } clearError();