From 9079df942a69043a304ec3669208ec5e5785781e Mon Sep 17 00:00:00 2001 From: CoCo_Sol007 Date: Wed, 6 Mar 2024 19:27:10 +0100 Subject: [PATCH] update --- crates/border-wars/src/map/mod.rs | 2 +- crates/border-wars/src/map/selection.rs | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/crates/border-wars/src/map/mod.rs b/crates/border-wars/src/map/mod.rs index 543fdc6..24c15d6 100644 --- a/crates/border-wars/src/map/mod.rs +++ b/crates/border-wars/src/map/mod.rs @@ -2,8 +2,8 @@ pub mod generation; pub mod hex; -pub mod selection; pub mod renderer; +pub mod selection; use bevy::prelude::*; diff --git a/crates/border-wars/src/map/selection.rs b/crates/border-wars/src/map/selection.rs index 6a7e5f4..901034f 100644 --- a/crates/border-wars/src/map/selection.rs +++ b/crates/border-wars/src/map/selection.rs @@ -4,9 +4,9 @@ use bevy::prelude::*; use super::Tile; -/// The event that is triggered when a tile is selected. -/// -/// The event contains the index (ID) of the selected tile. +/// The event that is triggered when a tile is clicked. +/// +/// The event contains the index (ID) of the clicked tile. #[derive(Event)] pub struct TileJustClicked(pub u32); @@ -59,8 +59,7 @@ fn mouse_handler( events_writer.send(ClickOnTheWorld(cursor_position_in_world)); } -/// Selects the closest tile to the cursor and marks it as selected. -/// It also unmarks the old selection if there is one. +/// Get the closest tile to the cursor and send it in an event. fn select_closest_tile( tiles: Query<(Entity, &Transform, &Tile)>, mut click_event_reader: EventReader,