Skip to content

Commit 206c1db

Browse files
authored
Bug fixes / small features (#21)
* New maps * Allow modals to have custom HTML in titles Make the max width 90% to make small screens not look weird Ensure content scrolls when the window is too small * Working favorites Fix the human being show briefly on start Reload scripts, not just bots Prevent the Teams component from disappearing on small window sizes * New mutators * Live-countdowns for events * Disable animations when there's > 16 bots selected on a team Fixes performance issues * Sort maps & mutators by name Better mutators panel * Add options for auto start agents and wait for agents * Show unique path in team bot list Format * Use UUIDs for bots/scripts Don't update filteredBots in `handleBotClick` * Update `bots` with new id Use $derived for `filteredBots` and `filteredScripts` * Update `e.detail.items` even less (unneeded) * Remove 'map' * Exclude human from search results * Remove a loadout editor thing * Fix reloading bots when showHuman is true * Only allow bot and script tomls * Make certain variables const * Fix bug with dragging the human * Remove unused import * Rename selectedBot to selectedAgent
1 parent 7311db5 commit 206c1db

16 files changed

Lines changed: 545 additions & 317 deletions

app.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"fmt"
45
"os"
56
"os/exec"
67
"path/filepath"
@@ -139,6 +140,8 @@ type ExtraOptions struct {
139140
SkipReplays bool `json:"skipReplays"`
140141
AutoSaveReplay bool `json:"autoSaveReplay"`
141142
ExistingMatchBehavior byte `json:"existingMatchBehavior"`
143+
AutoStartAgents bool `json:"autoStartAgents"`
144+
WaitForAgents bool `json:"waitForAgents"`
142145
}
143146

144147
type StartMatchOptions struct {
@@ -214,8 +217,8 @@ func (a *App) StartMatch(options StartMatchOptions) Result {
214217
}
215218

216219
match := flat.MatchConfigurationT{
217-
AutoStartAgents: true,
218-
WaitForAgents: true,
220+
AutoStartAgents: options.ExtraOptions.AutoStartAgents,
221+
WaitForAgents: options.ExtraOptions.WaitForAgents,
219222
GameMapUpk: options.Map,
220223
PlayerConfigurations: playerConfigs,
221224
ScriptConfigurations: scriptConfigs,
@@ -262,15 +265,21 @@ func (a *App) PickFolder() string {
262265
return path
263266
}
264267

265-
func (a *App) PickTomlFile() string {
268+
func (a *App) PickRLBotToml() (string, error) {
266269
path, err := zenity.SelectFile(zenity.FileFilter{
267270
Name: ".toml files",
268271
Patterns: []string{"*.toml"},
269272
})
270273
if err != nil {
271-
println("ERR: File picker failed")
274+
return "", nil
272275
}
273-
return path
276+
277+
filename := filepath.Base(path)
278+
if filename == "bot.toml" || filename == "script.toml" || strings.HasSuffix(filename, ".bot.toml") || strings.HasSuffix(filename, ".script.toml") {
279+
return path, nil
280+
}
281+
282+
return "", fmt.Errorf("invalid file name")
274283
}
275284

276285
func (a *App) ShowPathInExplorer(path string) error {

frontend/src/App.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ let eventsVisible = $state(false);
3636
{/if}
3737
</div>
3838
<div class="navbuttons">
39-
<button id={eventsNow > 0 || eventsFuture > 0 ? "events" : ""} onclick={() => { eventsVisible = true; }}>
39+
<button id={eventsNow > 0 || eventsFuture > 0 ? "events" : ""} onclick={() => eventsVisible = true}>
4040
Events
4141

4242
{#if eventsNow > 0}

frontend/src/arena-names.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export const MAPS_STANDARD = {
4848
"AquaDome (Shallows)": "Underwater_GRS_P",
4949
"Salty Shores (SaltyFest)": "Beach_Night_GRS_P",
5050
"Drift Woods": "Woods_P",
51+
"NeoTokyo (Arcade)": "NeoTokyo_Arcade_P",
52+
"Futura Garden": "UF_Day_P",
5153
};
5254

5355
// biome-ignore format: keep consistent

frontend/src/assets/star.svg

Lines changed: 1 addition & 0 deletions
Loading

frontend/src/assets/starFilled.svg

Lines changed: 1 addition & 0 deletions
Loading

frontend/src/base-players.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import type { DraggablePlayer } from ".";
1+
import { uuidv4, type DraggablePlayer } from ".";
22
import { HumanInfo, PsyonixBotInfo } from "../bindings/gui";
33
import controller from "./assets/controller.svg";
44

55
export const BASE_PLAYERS: DraggablePlayer[] = [
66
{
77
displayName: "Human",
88
icon: controller,
9-
id: Math.random(),
9+
id: uuidv4(),
1010
player: new HumanInfo(),
1111
tags: ["human"],
1212
},
1313
{
1414
displayName: "Psyonix Beginner",
1515
icon: "",
16-
id: Math.random(),
16+
id: uuidv4(),
1717
player: new PsyonixBotInfo({
1818
skill: 0,
1919
}),
@@ -22,7 +22,7 @@ export const BASE_PLAYERS: DraggablePlayer[] = [
2222
{
2323
displayName: "Psyonix Rookie",
2424
icon: "",
25-
id: Math.random(),
25+
id: uuidv4(),
2626
player: new PsyonixBotInfo({
2727
skill: 1,
2828
}),
@@ -31,7 +31,7 @@ export const BASE_PLAYERS: DraggablePlayer[] = [
3131
{
3232
displayName: "Psyonix Pro",
3333
icon: "",
34-
id: Math.random(),
34+
id: uuidv4(),
3535
player: new PsyonixBotInfo({
3636
skill: 2,
3737
}),
@@ -40,7 +40,7 @@ export const BASE_PLAYERS: DraggablePlayer[] = [
4040
{
4141
displayName: "Psyonix Allstar",
4242
icon: "",
43-
id: Math.random(),
43+
id: uuidv4(),
4444
player: new PsyonixBotInfo({
4545
skill: 3,
4646
}),

0 commit comments

Comments
 (0)