Populate scenes so that the GM can select them
Some checks failed
Monorepo build / build-flake (push) Has been cancelled
Some checks failed
Monorepo build / build-flake (push) Has been cancelled
This commit was merged in pull request #384.
This commit is contained in:
@@ -819,6 +819,7 @@ impl DbHandle {
|
||||
});
|
||||
}
|
||||
|
||||
eprintln!("scenes_in_game: {:?}", scenes);
|
||||
Ok(scenes)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use visions_core::{database::Database, types::User};
|
||||
use visions_core::{
|
||||
database::Database,
|
||||
types::{Scene, User},
|
||||
};
|
||||
use visions_types::*;
|
||||
|
||||
pub const ZELL_ID: &str = "zell-id";
|
||||
@@ -27,6 +30,10 @@ pub async fn populate_database(db: &Database) {
|
||||
for character in charsheets() {
|
||||
db.save_character(character).expect("save character");
|
||||
}
|
||||
|
||||
for scene in scenes() {
|
||||
let _ = db.save_scene(scene).expect("save scene");
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
@@ -385,3 +392,74 @@ pub fn link_players_to_games() -> Vec<(GameId, UserId)> {
|
||||
("missing-librarians-id".into(), "alenko-id".into()),
|
||||
]
|
||||
}
|
||||
|
||||
pub fn scenes() -> Vec<Scene> {
|
||||
vec![
|
||||
Scene {
|
||||
id: SceneId::default(),
|
||||
game: "winter-solstice-id".into(),
|
||||
title: "The Fourth Pharos".to_owned(),
|
||||
background: "https://files.luminescent-dreams.com/b33096fb-755e-4f44-8a4c-f7da65f12934"
|
||||
.to_owned(),
|
||||
desktop_image: Some(
|
||||
"https://files.luminescent-dreams.com/b33096fb-755e-4f44-8a4c-f7da65f12934"
|
||||
.to_owned(),
|
||||
),
|
||||
},
|
||||
Scene {
|
||||
id: SceneId::default(),
|
||||
game: "winter-solstice-id".into(),
|
||||
title: "Newfaire Central Railway Station".to_owned(),
|
||||
background: "https://files.luminescent-dreams.com/b33096fb-755e-4f44-8a4c-f7da65f12934"
|
||||
.to_owned(),
|
||||
desktop_image: Some(
|
||||
"https://files.luminescent-dreams.com/b33096fb-755e-4f44-8a4c-f7da65f12934"
|
||||
.to_owned(),
|
||||
),
|
||||
},
|
||||
Scene {
|
||||
id: SceneId::default(),
|
||||
game: "winter-solstice-id".into(),
|
||||
title: "Gattack Yard Subway Station".to_owned(),
|
||||
background: "https://files.luminescent-dreams.com/b33096fb-755e-4f44-8a4c-f7da65f12934"
|
||||
.to_owned(),
|
||||
desktop_image: Some(
|
||||
"https://files.luminescent-dreams.com/b33096fb-755e-4f44-8a4c-f7da65f12934"
|
||||
.to_owned(),
|
||||
),
|
||||
},
|
||||
Scene {
|
||||
id: SceneId::default(),
|
||||
game: "missing-librarians-id".into(),
|
||||
title: "Philethis Index".to_owned(),
|
||||
background: "https://files.luminescent-dreams.com/9d17d64c-01b9-459c-8a60-fccd3d4e7ca0"
|
||||
.to_owned(),
|
||||
desktop_image: Some(
|
||||
"https://files.luminescent-dreams.com/9d17d64c-01b9-459c-8a60-fccd3d4e7ca0"
|
||||
.to_owned(),
|
||||
),
|
||||
},
|
||||
Scene {
|
||||
id: SceneId::default(),
|
||||
game: "missing-librarians-id".into(),
|
||||
title: "Armaita's Court".to_owned(),
|
||||
background: "https://files.luminescent-dreams.com/fd5ae209-ce19-4a17-9a4b-1035573c88e9"
|
||||
.to_owned(),
|
||||
desktop_image: Some(
|
||||
"https://files.luminescent-dreams.com/fd5ae209-ce19-4a17-9a4b-1035573c88e9"
|
||||
.to_owned(),
|
||||
),
|
||||
},
|
||||
Scene {
|
||||
id: SceneId::default(),
|
||||
game: "missing-librarians-id".into(),
|
||||
title: "The Indoctrination Chamber".to_owned(),
|
||||
background: "https://files.luminescent-dreams.com/e8ac41a4-ed05-4c21-a2c6-fc6ee8d3b559"
|
||||
.to_owned(),
|
||||
desktop_image: Some(
|
||||
"https://files.luminescent-dreams.com/e8ac41a4-ed05-4c21-a2c6-fc6ee8d3b559"
|
||||
.to_owned(),
|
||||
),
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ use crate::{
|
||||
clone,
|
||||
components::{
|
||||
BackgroundImage, CardElement, DragSource, DraggableItem, DropTarget, Label, List,
|
||||
SocketState, Stack, TabletopElement, WebsocketProvider,
|
||||
PanelElement, SocketState, Stack, TabletopElement, WebsocketProvider,
|
||||
},
|
||||
systems::{self, Character},
|
||||
utils::Prop,
|
||||
@@ -221,9 +221,9 @@ fn View(
|
||||
|
||||
let foreground = html! {
|
||||
<div class={styles}>
|
||||
<Label
|
||||
text={state.scene_title.clone().unwrap_or("unnamed".to_owned())}
|
||||
class={classes!("player-view__title")} />
|
||||
<PanelElement>
|
||||
{state.scene_title.clone().unwrap_or("unnamed".to_owned())}
|
||||
</PanelElement>
|
||||
<DropTarget on_drop={on_drop_on_tabletop}>
|
||||
<div class="player-view__tabletop">
|
||||
<TabletopElement
|
||||
|
||||
Reference in New Issue
Block a user