From 9e5f782eb228a6b050b01d5c4c82dba1399f7172 Mon Sep 17 00:00:00 2001 From: Silas Bartha Date: Sat, 15 Feb 2025 20:53:19 -0500 Subject: directory-aware navigation --- src/events.rs | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'src/events.rs') diff --git a/src/events.rs b/src/events.rs index 7932a67..042c5e6 100644 --- a/src/events.rs +++ b/src/events.rs @@ -2,33 +2,27 @@ use std::path::PathBuf; use bevy::prelude::*; -/// Events related to activities in the dirworld. -#[derive(Event)] -pub enum DirworldNavigationEvent { - /// Triggered when a room is left. - LeftRoom { - /// Path of room just left. - path: PathBuf, - }, - /// Triggered when a room is entered. - EnteredRoom { - /// Path of room just entered. - path: PathBuf, - }, -} - /// Event called when leaving a room #[derive(Debug, Event, Deref, DerefMut, Clone)] pub struct DirworldLeaveRoom(pub PathBuf); /// Event called when entering a room -#[derive(Debug, Event, Deref, DerefMut, Clone)] -pub struct DirworldEnterRoom(pub PathBuf); +#[derive(Debug, Event, Clone)] +pub struct DirworldEnterRoom { + pub exited: PathBuf, + pub entered: PathBuf, +} /// Event called when changing the world root #[derive(Debug, Event, Deref, DerefMut, Clone)] pub struct DirworldChangeRoot(pub PathBuf); +#[derive(Debug, Event, Clone)] +pub struct DirworldNavigationComplete { + pub from: PathBuf, + pub to: PathBuf, +} + /// Event called to spawn a dirworld entities #[derive(Event, Debug, Deref, DerefMut, Clone, Copy)] pub struct DirworldSpawn(pub Entity); -- cgit v1.2.3