Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename AppExt to RegisterManifest #32

Merged
merged 3 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/entities_from_manifests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use leafwing_manifest::{
asset_state::SimpleAssetState,
identifier::Id,
manifest::{Manifest, ManifestFormat},
plugin::{AppExt, ManifestPlugin},
plugin::{ManifestPlugin, RegisterManifest},
};
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion examples/raw_manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use leafwing_manifest::{
asset_state::SimpleAssetState,
identifier::Id,
manifest::{Manifest, ManifestFormat},
plugin::{AppExt, ManifestPlugin},
plugin::{ManifestPlugin, RegisterManifest},
};
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use leafwing_manifest::{
asset_state::SimpleAssetState,
identifier::Id,
manifest::{Manifest, ManifestFormat},
plugin::{AppExt, ManifestPlugin},
plugin::{ManifestPlugin, RegisterManifest},
};
use serde::{Deserialize, Serialize};

Expand Down
8 changes: 4 additions & 4 deletions src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ use crate::manifest::Manifest;
/// This plugin will add the required state to your app (starting in [`AssetLoadingState::LOADING`]),
/// and set up the required systems to progress through the asset loading process and parse any added manifests.
///
/// Note that manifests must be added to the app manually, using the [`app.register_manifest`](crate::plugin::AppExt::register_manifest) method.
/// Note that manifests must be added to the app manually, using the [`app.register_manifest`](crate::plugin::RegisterManifest::register_manifest) method.
/// This plugin **must** be added before manifests are registered.
///
/// While [`register_manifest`](crate::plugin::AppExt::register_manifest) must be called for each manifest type you wish to use,
/// While [`register_manifest`](crate::plugin::RegisterManifest::register_manifest) must be called for each manifest type you wish to use,
/// this plugin should only be added a single time.
///
/// This plugin is intenionally optional: if you have more complex asset loading requirements, take a look at the systems in this plugin and either add or reimplement them as needed.
Expand Down Expand Up @@ -71,7 +71,7 @@ impl<S: AssetLoadingState> Plugin for ManifestPlugin<S> {
}

/// An extension trait for registering manifests with an app.
pub trait AppExt {
pub trait RegisterManifest {
/// Registers a manifest with the app, preparing it for loading and parsing.
///
/// The final manifest type must implement [`Manifest`], while the raw manifest type must implement [`Asset`](bevy::asset::Asset).
Expand All @@ -87,7 +87,7 @@ pub trait AppExt {
#[derive(SystemSet, PartialEq, Eq, Hash, Debug, Clone)]
struct ProcessManifestSet;

impl AppExt for App {
impl RegisterManifest for App {
/// Registers the manifest `M`.
///
/// By default, the path root is the `assets` folder, just like all Bevy assets.
Expand Down