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/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/LauncherSelector.svelte b/frontend/src/components/LauncherSelector.svelte index 5b6ebf5..2dc467a 100644 --- a/frontend/src/components/LauncherSelector.svelte +++ b/frontend/src/components/LauncherSelector.svelte @@ -1,47 +1,49 @@ - +
-
- -
- - -
- - -
- - -
- - - -
- {#if localLauncher !== "legendary" && localLauncher !== "nolaunch"} + + {#if launcher === "custom"}
@@ -56,13 +58,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/frontend/src/components/MatchSettings/Main.svelte b/frontend/src/components/MatchSettings/Main.svelte index 20f4e98..8b84eed 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(); @@ -29,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 = ""; @@ -60,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 { @@ -92,7 +93,7 @@ const filteredMutatorOptions = Object.keys(mutatorOptions).filter( />
- +
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 d946f35..20ad215 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); @@ -84,7 +85,7 @@ $effect(() => { let extraOptions = $state( JSON.parse( localStorage.getItem("MS_EXTRAOPTIONS") || - '{"enableStateSetting": true, "existingMatchBehavior": 1}', + '{"enableStateSetting": true, "existingMatchBehavior": 0}', ), ); $effect(() => { @@ -98,12 +99,14 @@ $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", duration: 5000, }); + + launcherOptionsVisible = true; return; } @@ -114,7 +117,7 @@ async function onMatchStart(randomizeMap: boolean) { ]; } - let options: StartMatchOptions = { + const options: StartMatchOptions = { map: $mapStore, gameMode: mode, bluePlayers: bluePlayers.map((x: DraggablePlayer) => { @@ -135,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", { @@ -154,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", { @@ -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..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] = []; } @@ -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; } 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")