Skip to content

Commit

Permalink
chore: fix debug and some imports
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrossi committed Apr 25, 2024
1 parent 7781b50 commit b840fd3
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/ryot_app/src/sprites.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ impl Plugin for RyotSpritePlugin {
.pipe(store_loaded_appearances_system)
.run_if(on_event::<LoadAppearanceEvent>())
.in_set(SpriteSystems::Load),
// #[cfg(feature = "debug")]
// debug_sprites.in_set(SpriteSystems::Initialize),
#[cfg(feature = "debug")]
debug_sprites.in_set(SpriteSystems::Initialize),
update_sprite_system
.in_set(SpriteSystems::Update)
.after(SpriteSystems::Initialize),
Expand Down
3 changes: 2 additions & 1 deletion crates/ryot_internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ all-features = true

[features]
debug = [
"ryot_tiled/debug",
"ryot_app?/debug",
"ryot_sprites/debug",
"ryot_tiled/debug",
]

bevy = [
Expand Down
11 changes: 11 additions & 0 deletions crates/ryot_sprites/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ categories = ["game-development", "game-engines", "games"]
rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true

[features]
debug = [
"dep:bevy_hierarchy",
"dep:bevy_stroked_text",
"dep:bevy_transform",
]

[dependencies]
bevy_app.workspace = true
bevy_asset.workspace = true
Expand All @@ -29,6 +36,10 @@ bevy_time.workspace = true
bevy_utils.workspace = true
bevy_asset_loader.workspace = true

bevy_transform = { workspace = true, optional = true }
bevy_hierarchy = { workspace = true, optional = true }
bevy_stroked_text = { workspace = true, optional = true }

ryot_core = { path = "../ryot_core", version = "0.2" }
ryot_content = { path = "../ryot_content", version = "0.2" }
ryot_tiled = { path = "../ryot_tiled", version = "0.2" }
Expand Down
3 changes: 3 additions & 0 deletions crates/ryot_sprites/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@ pub mod prelude {
sprites::*,
SpriteSystems, SPRITE_SHEET_FOLDER,
};

#[cfg(feature = "debug")]
pub use crate::sprites::debug_sprites;
}
8 changes: 7 additions & 1 deletion crates/ryot_sprites/src/sprites.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ use ryot_tiled::prelude::*;
use std::path::PathBuf;

#[cfg(feature = "debug")]
use bevy::sprite::Anchor;
use bevy_hierarchy::prelude::*;
#[cfg(feature = "debug")]
use bevy_sprite::Anchor;
#[cfg(feature = "debug")]
use bevy_stroked_text::{StrokedText, StrokedTextBundle};
#[cfg(feature = "debug")]
use bevy_transform::prelude::Transform;
#[cfg(feature = "debug")]
use glam::Vec3;

pub struct LoadedAppearance {
pub sprites: Vec<LoadedSprite>,
Expand Down

0 comments on commit b840fd3

Please sign in to comment.