Skip to content

Commit

Permalink
UPDATE deps, bevy 0.12, ldtk 1.4.1.
Browse files Browse the repository at this point in the history
locale assets aren't handled via bevy_asset_loader anymore, bevy_fluent handles them by itself
  • Loading branch information
inodentry committed Jan 10, 2024
1 parent 0816a7b commit 9dfa471
Show file tree
Hide file tree
Showing 12 changed files with 871 additions and 656 deletions.
1,128 changes: 672 additions & 456 deletions Cargo.lock

Large diffs are not rendered by default.

83 changes: 46 additions & 37 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[patch.crates-io]
bevy = { git = "https://github.com/TheSeekerGame/bevy", branch = "TheSeeker" }
bevy_ecs = { git = "https://github.com/TheSeekerGame/bevy", branch = "TheSeeker" }
bevy_app = { git = "https://github.com/TheSeekerGame/bevy", branch = "TheSeeker" }
bevy_asset = { git = "https://github.com/TheSeekerGame/bevy", branch = "TheSeeker" }
bevy_log = { git = "https://github.com/TheSeekerGame/bevy", branch = "TheSeeker" }
bevy_utils = { git = "https://github.com/TheSeekerGame/bevy", branch = "TheSeeker" }

[lib]
name = "theseeker_engine"
path = "engine/src/lib.rs"

[[bin]]
name = "theseeker_game"
path = "game/src/main.rs"

[features]
dev = [
"bevy/file_watcher",
"bevy_xpbd_2d/debug-plugin",
]

# dev: Enable max optimizations for dependencies, but not for our code
[profile.dev.package."*"]
opt-level = 3
Expand All @@ -21,43 +43,29 @@ lto = true
codegen-units = 1
debug = false

[lib]
name = "theseeker_engine"
path = "engine/src/lib.rs"

[[bin]]
name = "theseeker_game"
path = "game/src/main.rs"

[features]
dev = [
"bevy/filesystem_watcher",
"bevy_xpbd_2d/debug-plugin",
]

# Random little libraries
[dependencies]
anyhow = "1.0.71"
anyhow = "1.0.79"
derive_more = "0.99.17"
directories = "5.0.1"
enum-iterator = "1.4.1"
enum-map = "2.6.0"
enum-map = "2.7.3"
fluent_content = "0.0.5"
glam = "0.23.0"
glam = "0.25.0"
rand = "0.8.5"
serde_with = "3.1.0"
thiserror = "1.0.43"
toml = "0.7.6"
unic-langid = "0.9.1"
serde_with = "3.4.0"
thiserror = "1.0.56"
toml = "0.8.8"
unic-langid = "0.9.4"

[dependencies.serde]
version = "1.0.167"
version = "1.0.194"
features = [
"derive",
]

[dependencies.bevy]
version = "0.11"
version = "0.12"
default-features = false
features = [
"multi-threaded",
Expand Down Expand Up @@ -87,34 +95,35 @@ features = [
]

[dependencies.bevy_asset_loader]
# version = "0.17"
# FIXME: temporary until there is a new release with our dynamic asset api PRs
git = "https://github.com/NiklasEi/bevy_asset_loader"
rev = "d048c88348a393b28c51dcc650917ff772741a4a"
version = "0.19"
features = [
"2d",
"progress_tracking",
"standard_dynamic_assets",
]

[dependencies.bevy_common_assets]
version = "0.7"
version = "0.8"
features = [
"toml",
"ron",
]

[dependencies.bevy_ecs_ldtk]
version = "0.8"
# version = "0.8"
git = "https://github.com/TheSeekerGame/bevy_ecs_ldtk"
rev = "68af1c11cb95b1ed85f9f5008e7308f41e8015f1"

[dependencies.bevy_ecs_tilemap]
version = "0.11"
# version = "0.11"
git = "https://github.com/StarArawn/bevy_ecs_tilemap"
rev = "b08a5d997867d5e5a760e296dc38e435c6b268cc"

[dependencies.bevy_fluent]
version = "0.7"
version = "0.8"

[dependencies.bevy_tweening]
version = "0.8"
version = "0.9"

[dependencies.iyes_bevy_extras]
git = "https://github.com/IyesGames/iyes_bevy_extras"
Expand All @@ -124,23 +133,23 @@ features = ["2d"]
git = "https://github.com/IyesGames/iyes_cli"

[dependencies.iyes_progress]
version = "0.9"
version = "0.10"
features = ["assets"]

[dependencies.iyes_ui]
git = "https://github.com/IyesGames/iyes_ui"
features = ["iyes_cli"]

[dependencies.leafwing-input-manager]
version = "0.10"
version = "0.11"

[dependencies.bevy_xpbd_2d]
version = "0.2.0"
version = "0.3.2"
default-features = false
features = [
"2d",
"collider-from-mesh",
"f64",
"simd",
# "parallel",
# "simd",
]

4 changes: 2 additions & 2 deletions assets/levels/level.01.ldtk
Git LFS file not shown
9 changes: 0 additions & 9 deletions assets/locale.assets.ron

This file was deleted.

4 changes: 2 additions & 2 deletions engine/src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ pub fn resolve_asset_keys<T: Asset>(
/// and kept loaded at all times, even when unused.
#[derive(Resource, Default)]
pub struct PreloadedAssets {
handles: HashSet<HandleUntyped>,
handles: HashSet<UntypedHandle>,
map: HashMap<String, Option<DynamicAssetType>>,
}

Expand All @@ -141,7 +141,7 @@ impl PreloadedAssets {
None
}

pub fn get_multi_asset<T: Asset>(&self, key: &str) -> Option<&[HandleUntyped]> {
pub fn get_multi_asset<T: Asset>(&self, key: &str) -> Option<&[UntypedHandle]> {
if let Some(d) = self.get_asset(key) {
if let DynamicAssetType::Collection(handles) = d {
return Some(handles.as_slice());
Expand Down
2 changes: 1 addition & 1 deletion engine/src/assets/animation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::prelude::*;
/// Sprite Animation Asset type
///
/// Would typically be loaded from TOML files.
#[derive(Debug, Clone)]
#[derive(Asset, Debug, Clone)]
#[derive(Serialize, Deserialize)]
#[derive(TypeUuid, TypePath)]
#[uuid = "6D201246-BDB4-4803-A52A-76D95E3B6C77"]
Expand Down
2 changes: 1 addition & 1 deletion engine/src/assets/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::prelude::*;
/// Scripted Sequence Asset type
///
/// Would typically be loaded from TOML files.
#[derive(Debug, Clone)]
#[derive(Asset, Debug, Clone)]
#[derive(Serialize, Deserialize)]
#[derive(TypeUuid, TypePath)]
#[uuid = "8D1B7F2F-3798-4438-9EB8-A5EEC3EA77A9"]
Expand Down
11 changes: 0 additions & 11 deletions game/src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,9 @@ impl Plugin for AssetsPlugin {
AppState::AssetsLoading,
"ui.assets.ron",
);
app.add_dynamic_collection_to_loading_state::<_, StandardDynamicAssetCollection>(
AppState::AssetsLoading,
"locale.assets.ron",
);

// Some assets can be defined statically in Resource structs for ease of access
app.add_collection_to_loading_state::<_, UiAssets>(AppState::AssetsLoading);
app.add_collection_to_loading_state::<_, LocaleAssets>(AppState::AssetsLoading);
app.add_collection_to_loading_state::<_, MainMenuAssets>(AppState::AssetsLoading);
}
}
Expand All @@ -62,9 +57,3 @@ pub struct MainMenuAssets {
#[asset(key = "ui.mainmenu.logo")]
pub logo: Handle<Image>,
}

#[derive(AssetCollection, Resource)]
pub struct LocaleAssets {
#[asset(key = "locale.bundles", collection(typed))]
pub bundles: Vec<Handle<bevy_fluent::BundleAsset>>,
}
Loading

0 comments on commit 9dfa471

Please sign in to comment.