aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorLibravatar Silas Bartha <silas@exvacuum.dev>2024-06-17 19:37:21 -0400
committerLibravatar Silas Bartha <silas@exvacuum.dev>2024-06-17 19:37:21 -0400
commit462d6c5aaa2281bf875e04d5e2c3241a13256836 (patch)
tree742112db5e0c5554ba0c7a55ea48d3f0cba30dc9 /src/lib.rs
parentebc3ccfea4027a3eb0c80f6a3d64b6425d32d1ef (diff)
Mon Jun 17 07:37:21 PM EDT 2024
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 6b46502..f4bd783 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -4,7 +4,7 @@
use std::path::PathBuf;
-use bevy::prelude::*;
+use bevy::{asset::io::AssetSource, prelude::*};
use events::DirworldNavigationEvent;
use resources::{Dirworld, DirworldConfig};
@@ -25,7 +25,12 @@ pub struct DirworldPlugin {
impl Plugin for DirworldPlugin {
fn build(&self, app: &mut App) {
+ info!("building");
+ let path_string = self.path.to_string_lossy().to_string();
app.insert_resource(DirworldConfig::new(self.path.clone()))
+ .register_asset_source("dirworld", AssetSource::build()
+ .with_reader(AssetSource::get_default_reader(path_string.clone()))
+ .with_watcher(|_| None))
.add_event::<DirworldNavigationEvent>()
.init_resource::<Dirworld>();
}