Skip to content

Commit

Permalink
Merge pull request #45 from kaosat-dev/bevy-0.11
Browse files Browse the repository at this point in the history
chore(): Bevy 0.11 migration
  • Loading branch information
MrGVSV committed Jul 28, 2023
2 parents e613d45 + 62a8e50 commit 5e721b6
Show file tree
Hide file tree
Showing 44 changed files with 592 additions and 487 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ bevy_ui = [

[dependencies]
bevy_proto_backend = { version = "0.3", path = "./bevy_proto_backend", default-features = false }
bevy = { version = ">=0.10.1", default-features = false, features = ["bevy_asset"] }
bevy = { version = "0.11", default-features = false, features = ["bevy_asset"] }
anyhow = "1.0"
serde = "1.0"
thiserror = "1.0"
Expand All @@ -111,8 +111,8 @@ serde_yaml = { version = "0.9", optional = true, default-features = false }
[dev-dependencies]
ron = "0.8"
serde_yaml = "0.9"
bevy = "0.10.1"
bevy_prototype_lyon = "0.8.0"
bevy = "0.11.0"
bevy_prototype_lyon = "0.9.0"
trybuild = "1.0.71"

[[example]]
Expand Down
19 changes: 7 additions & 12 deletions assets/examples/bevy/ui/Blue.prototype.ron
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@
schematics: {
"bevy_proto::custom::NodeBundle": (
style: (
size: (
width: Px(200.0),
height: Px(200.0),
),
width: Px(200.0),
height: Px(200.0),
position_type: Absolute,
position: (
left: Px(210.0),
bottom: Px(10.0),
),
left: Px(210.0),
bottom: Px(10.0),
border: (
left: Px(20.0),
right: Px(20.0),
top: Px(20.0),
bottom: Px(20.0),
),
),
border_color: (Green),
background_color: (Rgba(
red: 0.4,
green: 0.4,
Expand All @@ -33,10 +30,8 @@
schematics: {
"bevy_proto::custom::NodeBundle": (
style: (
size: (
width: Percent(100.0),
height: Percent(100.0),
),
width: Percent(100.0),
height: Percent(100.0),
),
background_color: (Rgba(
red: 0.8,
Expand Down
10 changes: 2 additions & 8 deletions assets/examples/bevy/ui/Left.prototype.ron
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
schematics: {
"bevy_proto::custom::NodeBundle": (
style: (
size: (
width: Px(200.0),
height: Auto,
),
width: Px(200.0),
border: (
left: Px(2.0),
right: Px(2.0),
Expand All @@ -28,10 +25,7 @@
schematics: {
"bevy_proto::custom::NodeBundle": (
style: (
size: (
width: Percent(100.0),
height: Auto,
),
width: Percent(100.0),
),
background_color: (Rgba(
red: 0.15,
Expand Down
60 changes: 20 additions & 40 deletions assets/examples/bevy/ui/Red.prototype.ron
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
schematics: {
"bevy_proto::custom::NodeBundle": (
style: (
size: (
width: Percent(100.0),
height: Percent(100.0),
),
width: Percent(100.0),
height: Percent(100.0),
position_type: Absolute,
align_items: Center,
justify_content: Center,
Expand All @@ -19,10 +17,8 @@
schematics: {
"bevy_proto::custom::NodeBundle": (
style: (
size: (
width: Px(100.0),
height: Px(100.0),
),
width: Px(100.0),
height: Px(100.0),
),
background_color: (Red),
)
Expand All @@ -34,15 +30,11 @@
schematics: {
"bevy_proto::custom::NodeBundle": (
style: (
size: (
width: Percent(100.0),
height: Percent(100.0),
),
width: Percent(100.0),
height: Percent(100.0),
position_type: Absolute,
position: (
left: Px(20.0),
bottom: Px(20.0),
),
left: Px(20.0),
bottom: Px(20.0),
),
background_color: (Rgba(
red: 1.0,
Expand All @@ -60,15 +52,11 @@
schematics: {
"bevy_proto::custom::NodeBundle": (
style: (
size: (
width: Percent(100.0),
height: Percent(100.0),
),
width: Percent(100.0),
height: Percent(100.0),
position_type: Absolute,
position: (
left: Px(40.0),
bottom: Px(40.0),
),
left: Px(40.0),
bottom: Px(40.0),
),
background_color: (Rgba(
red: 1.0,
Expand All @@ -86,15 +74,11 @@
schematics: {
"bevy_proto::custom::NodeBundle": (
style: (
size: (
width: Percent(100.0),
height: Percent(100.0),
),
width: Percent(100.0),
height: Percent(100.0),
position_type: Absolute,
position: (
left: Px(60.0),
bottom: Px(60.0),
),
left: Px(60.0),
bottom: Px(60.0),
),
background_color: (Rgba(
red: 1.0,
Expand All @@ -112,15 +96,11 @@
schematics: {
"bevy_proto::custom::NodeBundle": (
style: (
size: (
width: Percent(100.0),
height: Percent(100.0),
),
width: Percent(100.0),
height: Percent(100.0),
position_type: Absolute,
position: (
left: Px(80.0),
bottom: Px(80.0),
),
left: Px(80.0),
bottom: Px(80.0),
),
background_color: (Rgba(
red: 1.0,
Expand Down
12 changes: 4 additions & 8 deletions assets/examples/bevy/ui/Right.prototype.ron
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
flex_direction: Column,
justify_content: Center,
align_items: Center,
size: (
width: Px(200.0),
height: Auto,
),
width: Px(200.0),
height: Auto,
),
background_color: (Rgba(
red: 0.15,
Expand All @@ -35,10 +33,8 @@
)]
),
style: (
size: (
width: Auto,
height: Px(25.0),
)
width: Auto,
height: Px(25.0),
),
),
"bevy_ui::widget::label::Label": ()
Expand Down
6 changes: 2 additions & 4 deletions assets/examples/bevy/ui/Root.prototype.ron
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
schematics: {
"bevy_proto::custom::NodeBundle": (
style: (
size: (
width: Percent(100.0),
height: Percent(100.0),
),
width: Percent(100.0),
height: Percent(100.0),
justify_content: SpaceBetween,
)
)
Expand Down
17 changes: 8 additions & 9 deletions assets/examples/bevy/ui/Scrollbox.prototype.ron
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
style: (
flex_direction: Column,
align_self: Stretch,
size: (
width: Auto,
height: Percent(50.0),
),
overflow: Hidden
width: Auto,
height: Percent(50.0),
overflow: (
x: Clip,
y: Clip,
)
),
background_color: (Rgba(
red: 0.10,
Expand All @@ -26,10 +27,8 @@
"bevy_proto::custom::NodeBundle": (
style: (
flex_direction: Column,
max_size: (
width: Undefined,
height: Undefined,
),
max_width: Auto,
max_height: Auto,
align_items: Center,
),
),
Expand Down
2 changes: 1 addition & 1 deletion bevy_proto_backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ bevy_ui = [

[dependencies]
bevy_proto_derive = { version = "0.5", path = "../bevy_proto_derive" }
bevy = { version = ">=0.10.1", default-features = false, features = ["bevy_asset"] }
bevy = { version = "0.11", default-features = false, features = ["bevy_asset"] }
anyhow = "1.0"
serde = "1.0"
thiserror = "1.0"
Expand Down
7 changes: 1 addition & 6 deletions bevy_proto_backend/src/impls/bevy_impls/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ pub(super) fn register(app: &mut App) {
register_schematic!(app, Handle<bevy::prelude::AnimationClip>);

#[cfg(feature = "bevy_audio")]
register_schematic!(
app,
Handle<bevy::prelude::AudioSink>,
Handle<bevy::prelude::AudioSource>,
Handle<bevy::prelude::SpatialAudioSink>,
);
register_schematic!(app, Handle<bevy::prelude::AudioSource>,);

#[cfg(feature = "bevy_gltf")]
register_schematic!(
Expand Down
4 changes: 2 additions & 2 deletions bevy_proto_backend/src/impls/bevy_impls/core.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bevy::app::App;
use bevy::core::Name;
use bevy::reflect::{FromReflect, Reflect};
use bevy::reflect::Reflect;

use crate::impls::macros::register_schematic;
use bevy_proto_derive::impl_external_schematic;
Expand All @@ -13,7 +13,7 @@ impl_external_schematic! {
#[schematic(from = NameInput)]
struct Name {}
// ---
#[derive(Reflect, FromReflect)]
#[derive(Reflect)]
pub struct NameInput(String);
impl From<NameInput> for Name {
fn from(input: NameInput) -> Self {
Expand Down
Loading

0 comments on commit 5e721b6

Please sign in to comment.