From db9dd4cf7eb319ff6dbc26faa603498035f1bbbe Mon Sep 17 00:00:00 2001 From: Virx Date: Wed, 5 Mar 2025 12:16:58 -0500 Subject: [PATCH 1/6] Use `NiceSelect` for launcher options --- app.go | 2 +- .../src/components/LauncherSelector.svelte | 60 +++++++++---------- rockethost.go | 2 +- 3 files changed, 29 insertions(+), 35 deletions(-) diff --git a/app.go b/app.go index 3a03792..b9add97 100644 --- a/app.go +++ b/app.go @@ -194,7 +194,7 @@ func (a *App) StartMatch(options StartMatchOptions) Result { launcher = flat.LauncherEpic case "custom": launcher = flat.LauncherCustom - case "noLaunch": + case "nolaunch": launcher = flat.LauncherNoLaunch default: println("No launcher chosen, defaulting to NoLaunch") diff --git a/frontend/src/components/LauncherSelector.svelte b/frontend/src/components/LauncherSelector.svelte index 5b6ebf5..8442b6e 100644 --- a/frontend/src/components/LauncherSelector.svelte +++ b/frontend/src/components/LauncherSelector.svelte @@ -1,23 +1,39 @@ @@ -25,23 +41,8 @@ $effect(() => {
-
- -
- - -
- - -
- - -
- - - -
- {#if localLauncher !== "legendary" && localLauncher !== "nolaunch"} + + {#if launcher === "custom"}
@@ -56,13 +57,6 @@ $effect(() => { flex-direction: column; gap: 1rem; } -.launcherSelect { - font-size: 1.1rem; -} -input[type='radio'] { - transform: scale(1.4); - user-select: none; -} .launcherArg { display: flex; flex-direction: column; diff --git a/rockethost.go b/rockethost.go index a2cc0ea..0d1ab9f 100644 --- a/rockethost.go +++ b/rockethost.go @@ -153,7 +153,7 @@ func (a *App) StartRHostMatch(settings RHostMatchSettings) (string, error) { launcher = flat.LauncherEpic case "custom": launcher = flat.LauncherCustom - case "noLaunch": + case "nolaunch": launcher = flat.LauncherNoLaunch default: println("No launcher chosen, defaulting to NoLaunch") From 1949bd70eb9a3b5e9d6ca5416792675aac696b20 Mon Sep 17 00:00:00 2001 From: Virx Date: Wed, 5 Mar 2025 12:17:13 -0500 Subject: [PATCH 2/6] Add `biome.json` symlink in base dir --- biome.json | 1 + 1 file changed, 1 insertion(+) create mode 120000 biome.json diff --git a/biome.json b/biome.json new file mode 120000 index 0000000..c7eed6d --- /dev/null +++ b/biome.json @@ -0,0 +1 @@ +./frontend/biome.json \ No newline at end of file From d8eee16c25c463845d58c9fda6f157d6b8ffa36b Mon Sep 17 00:00:00 2001 From: Virx Date: Wed, 5 Mar 2025 13:34:43 -0500 Subject: [PATCH 3/6] Open `LauncherSelector` if launcher not set --- frontend/src/components/LauncherSelector.svelte | 5 +++-- frontend/src/components/MatchSettings/Main.svelte | 3 ++- frontend/src/pages/Home.svelte | 4 ++++ frontend/src/pages/RocketHost.svelte | 5 ++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/LauncherSelector.svelte b/frontend/src/components/LauncherSelector.svelte index 8442b6e..2dc467a 100644 --- a/frontend/src/components/LauncherSelector.svelte +++ b/frontend/src/components/LauncherSelector.svelte @@ -2,7 +2,8 @@ import Modal from "./Modal.svelte"; import NiceSelect from "./NiceSelect.svelte"; -let visible = $state(false); +let { visible = $bindable() } = $props(); + let localLauncher = $state(localStorage.getItem("MS_LAUNCHER") || ""); let localLauncherArg = $state(localStorage.getItem("MS_LAUNCHER_ARG") || ""); @@ -39,7 +40,7 @@ $effect(() => { - +
{#if launcher === "custom"} diff --git a/frontend/src/components/MatchSettings/Main.svelte b/frontend/src/components/MatchSettings/Main.svelte index 20f4e98..eab8d13 100644 --- a/frontend/src/components/MatchSettings/Main.svelte +++ b/frontend/src/components/MatchSettings/Main.svelte @@ -12,6 +12,7 @@ let { mode = $bindable(), extraOptions = $bindable(), mutators = $bindable(), + launcherOptionsVisible = $bindable(), onStart = (randomizeMap: boolean) => {}, onStop = () => {}, } = $props(); @@ -92,7 +93,7 @@ const filteredMutatorOptions = Object.keys(mutatorOptions).filter( />
- +
diff --git a/frontend/src/pages/Home.svelte b/frontend/src/pages/Home.svelte index d946f35..9294e64 100644 --- a/frontend/src/pages/Home.svelte +++ b/frontend/src/pages/Home.svelte @@ -31,6 +31,7 @@ let paths: { JSON.parse(window.localStorage.getItem("BOT_SEARCH_PATHS") || "[]"), ); +let launcherOptionsVisible = $state(false); let players: DraggablePlayer[] = $state([...BASE_PLAYERS]); let selectedTeam = $state(null); @@ -104,6 +105,8 @@ async function onMatchStart(randomizeMap: boolean) { position: "bottom-right", duration: 5000, }); + + launcherOptionsVisible = true; return; } @@ -213,6 +216,7 @@ function handleSearch(event: Event) { bind:mode bind:mutators={mutatorSettings} bind:extraOptions + bind:launcherOptionsVisible />
diff --git a/frontend/src/pages/RocketHost.svelte b/frontend/src/pages/RocketHost.svelte index b508e02..e4f2365 100644 --- a/frontend/src/pages/RocketHost.svelte +++ b/frontend/src/pages/RocketHost.svelte @@ -69,6 +69,7 @@ refreshRHostServers(); let blueBots: string[] = $state([]); let orangeBots: string[] = $state([]); +let launcherOptionsVisible = $state(false);
@@ -182,7 +183,7 @@ let orangeBots: string[] = $state([]);
- +
@@ -194,6 +195,8 @@ let orangeBots: string[] = $state([]); position: "bottom-right", duration: 5000, }); + + launcherOptionsVisible = true; return; } From b52279fbb993f1091934bf78b7482d30ba63b7ab Mon Sep 17 00:00:00 2001 From: Virx Date: Wed, 5 Mar 2025 14:14:49 -0500 Subject: [PATCH 4/6] cleanup --- frontend/src/components/BotList.svelte | 2 -- frontend/src/components/MatchSettings/Main.svelte | 6 +++--- frontend/src/components/Modal.svelte | 2 +- frontend/src/pages/Home.svelte | 8 ++++---- frontend/src/pages/RocketHost.svelte | 4 ++-- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/BotList.svelte b/frontend/src/components/BotList.svelte index 93ff148..964fa6a 100644 --- a/frontend/src/components/BotList.svelte +++ b/frontend/src/components/BotList.svelte @@ -4,11 +4,9 @@ import toast from "svelte-5-french-toast"; import { SHADOW_ITEM_MARKER_PROPERTY_NAME, TRIGGERS, - alertToScreenReader, dndzone, } from "svelte-dnd-action"; import { flip } from "svelte/animate"; -import { stopPropagation } from "svelte/legacy"; import { App, BotInfo } from "../../bindings/gui"; import infoIcon from "../assets/info_icon.svg"; import defaultIcon from "../assets/rlbot_mono.png"; diff --git a/frontend/src/components/MatchSettings/Main.svelte b/frontend/src/components/MatchSettings/Main.svelte index eab8d13..8b84eed 100644 --- a/frontend/src/components/MatchSettings/Main.svelte +++ b/frontend/src/components/MatchSettings/Main.svelte @@ -30,12 +30,12 @@ const existingMatchBehaviors: { [n: string]: number } = { }; function cleanCase(toClean: string) { - let halfClean = toClean.replaceAll("_", " ").replace(" option", ""); + const halfClean = toClean.replaceAll("_", " ").replace(" option", ""); return halfClean.charAt(0).toUpperCase() + halfClean.slice(1); } function resetMutators() { - for (let key of Object.keys(mutators)) { + for (const key of Object.keys(mutators)) { mutators[key] = 0; } selectedPreset = ""; @@ -61,7 +61,7 @@ function setPreset(presetData: Gamemode) { randomizeMap = true; } - for (let key of filteredMutatorOptions) { + for (const key of filteredMutatorOptions) { if (presetData.mutators[key] !== undefined) { mutators[key] = mutatorOptions[key].indexOf(presetData.mutators[key]); } else { diff --git a/frontend/src/components/Modal.svelte b/frontend/src/components/Modal.svelte index e820828..a7cc956 100644 --- a/frontend/src/components/Modal.svelte +++ b/frontend/src/components/Modal.svelte @@ -10,7 +10,7 @@ function handleOuter(e: MouseEvent) { if (e.target === wrap && mouseDownWasOutside) visible = false; } function handleMouseDown(e: MouseEvent) { - let res = e.target === wrap; + const res = e.target === wrap; mouseDownWasOutside = res; return res; } diff --git a/frontend/src/pages/Home.svelte b/frontend/src/pages/Home.svelte index 9294e64..2f64e3e 100644 --- a/frontend/src/pages/Home.svelte +++ b/frontend/src/pages/Home.svelte @@ -99,7 +99,7 @@ $effect(() => { }); async function onMatchStart(randomizeMap: boolean) { - let launcher = localStorage.getItem("MS_LAUNCHER"); + const launcher = localStorage.getItem("MS_LAUNCHER"); if (!launcher) { toast.error("Please select a launcher first", { position: "bottom-right", @@ -117,7 +117,7 @@ async function onMatchStart(randomizeMap: boolean) { ]; } - let options: StartMatchOptions = { + const options: StartMatchOptions = { map: $mapStore, gameMode: mode, bluePlayers: bluePlayers.map((x: DraggablePlayer) => { @@ -138,7 +138,7 @@ async function onMatchStart(randomizeMap: boolean) { position: "bottom-right", }); - let response = await App.StartMatch(options); + const response = await App.StartMatch(options); if (response.success) { toast.success("Sent start match command", { @@ -157,7 +157,7 @@ async function onMatchStop() { toast("Stopping match...", { position: "bottom-right", }); - let response = await App.StopMatch(false); + const response = await App.StopMatch(false); if (response.success) { toast.success("Sent stop match command", { diff --git a/frontend/src/pages/RocketHost.svelte b/frontend/src/pages/RocketHost.svelte index e4f2365..52cb301 100644 --- a/frontend/src/pages/RocketHost.svelte +++ b/frontend/src/pages/RocketHost.svelte @@ -14,8 +14,8 @@ let botFamilies = $derived.by(() => { let families: { [name: string]: string[]; } = {}; - for (let bot of bots) { - let fam = bot.family !== "" ? bot.family : bot.name; + for (const bot of bots) { + const fam = bot.family !== "" ? bot.family : bot.name; if (!Object.hasOwn(families, fam)) { families[fam] = []; } From 887dff72307fa9ea09496184b8d47f737c32c142 Mon Sep 17 00:00:00 2001 From: Virx Date: Wed, 5 Mar 2025 14:19:39 -0500 Subject: [PATCH 5/6] Default to Restart for existing match behavior --- frontend/src/pages/Home.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/Home.svelte b/frontend/src/pages/Home.svelte index 2f64e3e..20ad215 100644 --- a/frontend/src/pages/Home.svelte +++ b/frontend/src/pages/Home.svelte @@ -85,7 +85,7 @@ $effect(() => { let extraOptions = $state( JSON.parse( localStorage.getItem("MS_EXTRAOPTIONS") || - '{"enableStateSetting": true, "existingMatchBehavior": 1}', + '{"enableStateSetting": true, "existingMatchBehavior": 0}', ), ); $effect(() => { From f1925fe6490abb35b368fd8939ea2f135c44729f Mon Sep 17 00:00:00 2001 From: swz <37341774+swz-git@users.noreply.github.com> Date: Thu, 6 Mar 2025 01:50:51 +0100 Subject: [PATCH 6/6] Delete biome.json symlink --- biome.json | 1 - 1 file changed, 1 deletion(-) delete mode 120000 biome.json diff --git a/biome.json b/biome.json deleted file mode 120000 index c7eed6d..0000000 --- a/biome.json +++ /dev/null @@ -1 +0,0 @@ -./frontend/biome.json \ No newline at end of file