From c80ce332791c94b83a03c9f7c3cbb937f474cc5d Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sat, 27 Aug 2022 17:05:11 +0200 Subject: [PATCH] allow selecting a map in editor view --- planetwars-server/src/lib.rs | 1 + planetwars-server/src/routes/mod.rs | 1 + .../src/lib/components/SubmitPane.svelte | 54 ++++++++++++------- web/pw-server/src/lib/stores/editor_state.ts | 1 + 4 files changed, 39 insertions(+), 18 deletions(-) diff --git a/planetwars-server/src/lib.rs b/planetwars-server/src/lib.rs index 4950815..fa1af8d 100644 --- a/planetwars-server/src/lib.rs +++ b/planetwars-server/src/lib.rs @@ -133,6 +133,7 @@ pub fn api() -> Router { "/matches/:match_id/log", get(routes::matches::get_match_log), ) + .route("/maps", get(routes::maps::list_maps)) .route("/leaderboard", get(routes::bots::get_ranking)) .route("/submit_bot", post(routes::demo::submit_bot)) .route("/save_bot", post(routes::bots::save_bot)) diff --git a/planetwars-server/src/routes/mod.rs b/planetwars-server/src/routes/mod.rs index b3decb8..9510fd4 100644 --- a/planetwars-server/src/routes/mod.rs +++ b/planetwars-server/src/routes/mod.rs @@ -1,4 +1,5 @@ pub mod bots; pub mod demo; +pub mod maps; pub mod matches; pub mod users; diff --git a/web/pw-server/src/lib/components/SubmitPane.svelte b/web/pw-server/src/lib/components/SubmitPane.svelte index 9fd2380..b0f86c8 100644 --- a/web/pw-server/src/lib/components/SubmitPane.svelte +++ b/web/pw-server/src/lib/components/SubmitPane.svelte @@ -1,9 +1,11 @@