Apply naming suggestion.

This commit is contained in:
Talin 2025-07-17 13:08:14 -07:00
parent e1e5e6bbc4
commit 9aa3e5ea50
2 changed files with 6 additions and 6 deletions

View File

@ -19,7 +19,7 @@ use bevy_winit::cursor::CustomCursor;
/// A resource that specifies the cursor icon to be used when the mouse is not hovering over /// A resource that specifies the cursor icon to be used when the mouse is not hovering over
/// any other entity. This is used to set the default cursor icon for the window. /// any other entity. This is used to set the default cursor icon for the window.
#[derive(Resource, Debug, Clone, Default)] #[derive(Resource, Debug, Clone, Default)]
pub struct DefaultEntityCursor(pub EntityCursor); pub struct DefaultCursor(pub EntityCursor);
/// A component that specifies the cursor shape to be used when the pointer hovers over an entity. /// A component that specifies the cursor shape to be used when the pointer hovers over an entity.
/// This is copied to the windows's [`CursorIcon`] component. /// This is copied to the windows's [`CursorIcon`] component.
@ -76,7 +76,7 @@ pub(crate) fn update_cursor(
parent_query: Query<&ChildOf>, parent_query: Query<&ChildOf>,
cursor_query: Query<&EntityCursor>, cursor_query: Query<&EntityCursor>,
mut q_windows: Query<(Entity, &mut Window, Option<&CursorIcon>)>, mut q_windows: Query<(Entity, &mut Window, Option<&CursorIcon>)>,
r_default_cursor: Res<DefaultEntityCursor>, r_default_cursor: Res<DefaultCursor>,
) { ) {
let cursor = hover_map.and_then(|hover_map| match hover_map.get(&PointerId::Mouse) { let cursor = hover_map.and_then(|hover_map| match hover_map.get(&PointerId::Mouse) {
Some(hover_set) => hover_set.keys().find_map(|entity| { Some(hover_set) => hover_set.keys().find_map(|entity| {
@ -115,8 +115,8 @@ pub struct CursorIconPlugin;
impl Plugin for CursorIconPlugin { impl Plugin for CursorIconPlugin {
fn build(&self, app: &mut App) { fn build(&self, app: &mut App) {
if app.world().get_resource::<DefaultEntityCursor>().is_none() { if app.world().get_resource::<DefaultCursor>().is_none() {
app.init_resource::<DefaultEntityCursor>(); app.init_resource::<DefaultCursor>();
} }
app.add_systems(PreUpdate, update_cursor.in_set(PickingSystems::Last)); app.add_systems(PreUpdate, update_cursor.in_set(PickingSystems::Last));
} }

View File

@ -25,7 +25,7 @@ use bevy_text::{TextColor, TextFont};
use crate::{ use crate::{
controls::ControlsPlugin, controls::ControlsPlugin,
cursor::{CursorIconPlugin, DefaultEntityCursor, EntityCursor}, cursor::{CursorIconPlugin, DefaultCursor, EntityCursor},
theme::{ThemedText, UiTheme}, theme::{ThemedText, UiTheme},
}; };
@ -60,7 +60,7 @@ impl Plugin for FeathersPlugin {
HierarchyPropagatePlugin::<TextFont, With<ThemedText>>::default(), HierarchyPropagatePlugin::<TextFont, With<ThemedText>>::default(),
)); ));
app.insert_resource(DefaultEntityCursor(EntityCursor::System( app.insert_resource(DefaultCursor(EntityCursor::System(
bevy_window::SystemCursorIcon::Default, bevy_window::SystemCursorIcon::Default,
))); )));