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

chore(): Bevy 0.11 migration #45

Merged
merged 24 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1874ae4
chore(): bumped versions & dependency versions
kaosat-dev Jul 17, 2023
e4a2a87
chore(): removed the FromReflect macro calls, as it is now automatica…
kaosat-dev Jul 17, 2023
47a6759
chore(examples): migrated examples to schedule-first
kaosat-dev Jul 17, 2023
2630069
Rename Command's "write" method to "apply"
hafiidz Jul 15, 2023
85aa324
Changed spelling linebreak_behaviour to linebreak_behavior
hafiidz Jul 20, 2023
91c6805
Require #[derive(Event)] on all Events
hafiidz Jul 20, 2023
17cea81
Allow custom depth texture usage
hafiidz Jul 20, 2023
1eee06e
Flatten UI Style properties that use Size + remove Size & MeasureFunc…
hafiidz Jul 20, 2023
b38efd1
Rename Interaction::Clicked > Interaction::Pressed
hafiidz Jul 17, 2023
5cae089
Ui Node Borders #7795
hafiidz Jul 20, 2023
7ef1337
typo background_color -> border_color
hafiidz Jul 20, 2023
655bec6
Merge pull request #2 from hafiidz/bevy-0.11-cherrypickedchanges
kaosat-dev Jul 21, 2023
566204e
fix(ImageBundle): added missing image_size field
kaosat-dev Jul 22, 2023
0becab5
chore(from_reflect): removed obsoleted from_reflect imports
kaosat-dev Jul 22, 2023
e899c10
Add some more fixes
MrGVSV Jul 22, 2023
403dfec
Fix generics causing compile error
MrGVSV Jul 28, 2023
759061d
Update examples
MrGVSV Jul 28, 2023
5f189fe
Change bevy version
MrGVSV Jul 28, 2023
ece4b16
Fix clippy
MrGVSV Jul 28, 2023
a053979
Fix clippy
MrGVSV Jul 28, 2023
c395e52
Fix clippy (some more)
MrGVSV Jul 28, 2023
d6c35d6
Update color defaults
MrGVSV Jul 28, 2023
7e49ee4
Reset version
MrGVSV Jul 28, 2023
62a8e50
Reset dep version
MrGVSV Jul 28, 2023
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
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