simplify crate module imports

This commit is contained in:
yuni 2024-05-12 23:42:56 +02:00
parent d37b90be15
commit 94d732d9f0
10 changed files with 17 additions and 21 deletions

View file

@ -19,7 +19,6 @@ use bevy_xpbd_3d::prelude::*;
use bevy::scene::SceneInstance; use bevy::scene::SceneInstance;
use bevy::math::DVec3; use bevy::math::DVec3;
use crate::prelude::*; use crate::prelude::*;
use crate::{actor, audio, camera, chat, hud, menu, nature, visual, world};
use std::collections::HashMap; use std::collections::HashMap;
pub const ENGINE_SPEED_FACTOR: f32 = 30.0; pub const ENGINE_SPEED_FACTOR: f32 = 30.0;

View file

@ -12,7 +12,7 @@
use bevy::prelude::*; use bevy::prelude::*;
use bevy::audio::{PlaybackMode, Volume}; use bevy::audio::{PlaybackMode, Volume};
use crate::{camera, var}; use crate::prelude::*;
const ASSET_CLICK: &str = "sounds/click-button-140881-crop.ogg"; const ASSET_CLICK: &str = "sounds/click-button-140881-crop.ogg";
const ASSET_SWITCH: &str = "sounds/typosonic-typing-192811-crop.ogg"; const ASSET_SWITCH: &str = "sounds/typosonic-typing-192811-crop.ogg";

View file

@ -24,7 +24,7 @@ use bevy_xpbd_3d::prelude::*;
use bevy_xpbd_3d::plugins::sync; use bevy_xpbd_3d::plugins::sync;
use std::f32::consts::PI; use std::f32::consts::PI;
use std::f64::consts::PI as PI64; use std::f64::consts::PI as PI64;
use crate::{actor, audio, hud, var}; use crate::prelude::*;
pub const INITIAL_ZOOM_LEVEL: f64 = 10.0; pub const INITIAL_ZOOM_LEVEL: f64 = 10.0;

View file

@ -11,7 +11,7 @@
// This module loads the chat definitions from the YAML files // This module loads the chat definitions from the YAML files
// and manages the flow of conversations. // and manages the flow of conversations.
use crate::{actor, audio, hud, var, visual, world}; use crate::prelude::*;
use bevy::prelude::*; use bevy::prelude::*;
use bevy::math::DVec3; use bevy::math::DVec3;
use bevy_xpbd_3d::prelude::*; use bevy_xpbd_3d::prelude::*;

View file

@ -16,7 +16,6 @@ use bevy_xpbd_3d::prelude::*;
use bevy::math::DVec3; use bevy::math::DVec3;
use bevy::pbr::{NotShadowCaster, NotShadowReceiver}; use bevy::pbr::{NotShadowCaster, NotShadowReceiver};
use crate::prelude::*; use crate::prelude::*;
use crate::{actor, camera, chat, hud, load, nature, var, world};
use regex::Regex; use regex::Regex;
use std::f32::consts::PI; use std::f32::consts::PI;
use std::f64::consts::PI as PI64; use std::f64::consts::PI as PI64;

View file

@ -11,7 +11,6 @@
// This module manages the heads-up display and augmented reality overlays. // This module manages the heads-up display and augmented reality overlays.
use crate::prelude::*; use crate::prelude::*;
use crate::{actor, audio, camera, chat, nature};
use bevy::pbr::{NotShadowCaster, NotShadowReceiver}; use bevy::pbr::{NotShadowCaster, NotShadowReceiver};
use bevy::prelude::*; use bevy::prelude::*;
use bevy::diagnostic::{DiagnosticsStore, FrameTimeDiagnosticsPlugin}; use bevy::diagnostic::{DiagnosticsStore, FrameTimeDiagnosticsPlugin};

View file

@ -11,22 +11,23 @@
// This module initializes the game, handles command-line arguments, // This module initializes the game, handles command-line arguments,
// and manages window-related key bindings. // and manages window-related key bindings.
mod actor; pub mod actor;
mod audio; pub mod audio;
mod camera; pub mod camera;
mod chat; pub mod chat;
mod cmd; pub mod cmd;
mod hud; pub mod hud;
mod load; pub mod load;
mod menu; pub mod menu;
mod var; pub mod var;
mod visual; pub mod visual;
mod world; pub mod world;
#[allow(dead_code)] #[allow(dead_code)]
mod nature; pub mod nature;
pub mod prelude { pub mod prelude {
pub use crate::{actor, audio, camera, chat, cmd, hud, load, menu, nature, var, visual, world};
pub use crate::var::{FONT, Settings}; pub use crate::var::{FONT, Settings};
pub use crate::load::load_asset; pub use crate::load::load_asset;
pub fn bool2vis(boolean: bool) -> bevy::prelude::Visibility { pub fn bool2vis(boolean: bool) -> bevy::prelude::Visibility {

View file

@ -11,7 +11,6 @@
// This plugin manages game menus and the player death screen // This plugin manages game menus and the player death screen
use crate::prelude::*; use crate::prelude::*;
use crate::{audio, hud, visual, world};
use bevy::prelude::*; use bevy::prelude::*;
pub struct MenuPlugin; pub struct MenuPlugin;

View file

@ -11,7 +11,7 @@
// This module manages visual effects. // This module manages visual effects.
use bevy::prelude::*; use bevy::prelude::*;
use crate::{camera, var}; use crate::prelude::*;
pub struct VisualPlugin; pub struct VisualPlugin;

View file

@ -11,7 +11,6 @@
// This module populates the world with stars and asteroids. // This module populates the world with stars and asteroids.
use crate::prelude::*; use crate::prelude::*;
use crate::{actor, cmd, hud, load, nature};
use bevy::prelude::*; use bevy::prelude::*;
use bevy::math::{DVec3, I64Vec3}; use bevy::math::{DVec3, I64Vec3};
use bevy::scene::{InstanceId, SceneInstance}; use bevy::scene::{InstanceId, SceneInstance};