Skip to content

Commit

Permalink
Merge pull request #274 from NiseVoid/bevy_0.11
Browse files Browse the repository at this point in the history
Upgrade to bevy 0.11
  • Loading branch information
StarArawn authored Nov 4, 2023
2 parents 041cfba + e4c183e commit 41706b3
Show file tree
Hide file tree
Showing 73 changed files with 399 additions and 384 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.70.0
components: clippy, rustfmt
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
Expand All @@ -28,7 +31,7 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }}
key: ${{ runner.os }}-cargo-build-1.70.0-${{ hashFiles('**/Cargo.toml') }}
- name: Install alsa and udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
if: runner.os == 'linux'
Expand Down
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ members = ["kayak_ui_macros", "kayak_font"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bevy = { version = "0.10", default-features = false, features = ["bevy_render", "bevy_sprite", "bevy_asset", "bevy_winit", "bevy_core_pipeline"] }
bevy_svg = { version="0.10.1", default-features = false }
bevy = { version = "0.11", default-features = false, features = ["bevy_render", "bevy_asset", "bevy_winit", "bevy_core_pipeline"] }
bevy_svg = { version="0.11", default-features = false }
bitflags = "1.3.2"
bytemuck = "1.12"
dashmap = "5.4"
Expand All @@ -36,8 +36,8 @@ uuid = { version = "1.3", features = ["v4"] }

[dev-dependencies]
fastrand = "1.8"
bevy-inspector-egui = "0.18"
bevy = { version = "0.10", default-features = true }
bevy-inspector-egui = "0.19"
bevy = { version = "0.11", default-features = true }

[[example]]
name = "tabs"
Expand All @@ -48,4 +48,4 @@ name = "todo"
path = "examples/todo/todo.rs"

[package.metadata.docs.rs]
features = ["bevy/x11"]
features = ["bevy/x11"]
6 changes: 3 additions & 3 deletions assets/rainbow_shader.wgsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import kayak_ui::bindings
#import kayak_ui::sample_quad
#import kayak_ui::vertex_output
#import kayak_ui::bindings globals
#import kayak_ui::sample_quad sample_quad
#import kayak_ui::vertex_output VertexOutput

fn hsv2rgb(c: vec3<f32>) -> vec3<f32>
{
Expand Down
5 changes: 2 additions & 3 deletions examples/accordion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,8 @@ fn startup(
fn main() {
App::new()
.add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()))
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_plugins((KayakContextPlugin, KayakWidgets))
// .add_plugin(bevy_inspector_egui::quick::WorldInspectorPlugin::default())
.add_startup_system(startup)
.add_systems(Startup, startup)
.run()
}
12 changes: 7 additions & 5 deletions examples/avsb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,12 @@ fn swap(input: Res<Input<KeyCode>>, mut query: Query<&mut AvsBState, Without<Pre
fn main() {
App::new()
.add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()))
.add_plugin(bevy_inspector_egui::quick::WorldInspectorPlugin::new())
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_system(swap)
.add_plugins((
bevy_inspector_egui::quick::WorldInspectorPlugin::new(),
KayakContextPlugin,
KayakWidgets,
))
.add_systems(Startup, startup)
.add_systems(Update, swap)
.run()
}
19 changes: 11 additions & 8 deletions examples/bevy_scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,16 @@ fn main() {
.insert_resource(ClearColor(Color::rgb(0.0, 0.0, 0.0)))
.insert_resource(ActiveColor { index: 0 })
.add_plugins(DefaultPlugins)
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_startup_system(world_setup)
.add_system(move_ghost_tile)
.add_system(set_active_tile_target)
.add_system(move_active_tile)
.add_system(on_color_change)
.add_plugins((KayakContextPlugin, KayakWidgets))
.add_systems(Startup, (startup, world_setup))
.add_systems(
Update,
(
move_ghost_tile,
set_active_tile_target,
move_active_tile,
on_color_change,
),
)
.run()
}
5 changes: 2 additions & 3 deletions examples/box_shadows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ fn main() {
App::new()
.insert_resource(ClearColor(Color::rgb(1.0, 1.0, 1.0)))
.add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()))
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_plugins((KayakContextPlugin, KayakWidgets))
.add_systems(Startup, startup)
.run()
}
5 changes: 2 additions & 3 deletions examples/clipping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ fn main() {
App::new()
.insert_resource(ClearColor(Color::rgb(0.0, 0.0, 0.0)))
.add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()))
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_plugins((KayakContextPlugin, KayakWidgets))
.add_systems(Startup, startup)
.run()
}
5 changes: 2 additions & 3 deletions examples/conditional_widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ fn main() {
App::new()
.insert_resource(ClearColor(Color::rgb(0.0, 0.0, 0.0)))
.add_plugins(DefaultPlugins)
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_plugins((KayakContextPlugin, KayakWidgets))
.add_systems(Startup, startup)
.run()
}
5 changes: 2 additions & 3 deletions examples/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,7 @@ fn startup(
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_plugins((KayakContextPlugin, KayakWidgets))
.add_systems(Startup, startup)
.run()
}
18 changes: 12 additions & 6 deletions examples/custom_shader.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
use bevy::{prelude::*, reflect::TypeUuid, render::render_resource::AsBindGroup};
use bevy::{
prelude::*,
reflect::{TypePath, TypeUuid},
render::render_resource::AsBindGroup,
};
use kayak_ui::{
prelude::{widgets::*, *},
CameraUIKayak,
};

#[derive(AsBindGroup, TypeUuid, Debug, Clone)]
#[derive(AsBindGroup, TypeUuid, TypePath, Debug, Clone)]
#[uuid = "94c4e6f9-6f10-422c-85ec-6d582d471afc"]
pub struct MyUIMaterial {}
impl MaterialUI for MyUIMaterial {
Expand Down Expand Up @@ -59,9 +63,11 @@ fn startup(
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_plugin(MaterialUIPlugin::<MyUIMaterial>::default())
.add_startup_system(startup)
.add_plugins((
KayakContextPlugin,
KayakWidgets,
MaterialUIPlugin::<MyUIMaterial>::default(),
))
.add_systems(Startup, startup)
.run()
}
7 changes: 3 additions & 4 deletions examples/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ fn update_resource(
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_system(update_resource)
.add_plugins((KayakContextPlugin, KayakWidgets))
.add_systems(Startup, startup)
.add_systems(Update, update_resource)
.run()
}
5 changes: 2 additions & 3 deletions examples/font_size_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ fn startup(
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_plugins((KayakContextPlugin, KayakWidgets))
.add_systems(Startup, startup)
.run()
}
5 changes: 2 additions & 3 deletions examples/hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ fn startup(
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_plugins((KayakContextPlugin, KayakWidgets))
.add_systems(Startup, startup)
.run()
}
5 changes: 2 additions & 3 deletions examples/hello_world_no_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ fn startup(
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_plugins((KayakContextPlugin, KayakWidgets))
.add_systems(Startup, startup)
.run()
}
5 changes: 2 additions & 3 deletions examples/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ fn startup(
fn main() {
App::new()
.add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()))
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_plugins((KayakContextPlugin, KayakWidgets))
.add_systems(Startup, startup)
.run()
}
5 changes: 2 additions & 3 deletions examples/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ fn startup(
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_plugins((KayakContextPlugin, KayakWidgets))
.add_systems(Startup, startup)
.run()
}
5 changes: 2 additions & 3 deletions examples/main_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ fn main() {
App::new()
.init_resource::<PreloadResource>()
.add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()))
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_plugins((KayakContextPlugin, KayakWidgets))
.add_systems(Startup, startup)
.run()
}
18 changes: 12 additions & 6 deletions examples/modal.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
use bevy::{prelude::*, reflect::TypeUuid, render::render_resource::AsBindGroup};
use bevy::{
prelude::*,
reflect::{TypePath, TypeUuid},
render::render_resource::AsBindGroup,
};
use kayak_ui::prelude::{widgets::*, *};

#[derive(AsBindGroup, TypeUuid, Debug, Clone)]
#[derive(AsBindGroup, TypeUuid, TypePath, Debug, Clone)]
#[uuid = "94c4e6f9-6f10-422c-85ec-6d582d471afc"]
pub struct MyUIMaterial {}
impl MaterialUI for MyUIMaterial {
Expand Down Expand Up @@ -158,9 +162,11 @@ fn main() {
App::new()
.insert_resource(ClearColor(Color::rgb(0.0, 0.0, 0.0)))
.add_plugins(DefaultPlugins)
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_plugin(MaterialUIPlugin::<MyUIMaterial>::default())
.add_startup_system(startup)
.add_plugins((
KayakContextPlugin,
KayakWidgets,
MaterialUIPlugin::<MyUIMaterial>::default(),
))
.add_systems(Startup, startup)
.run()
}
5 changes: 2 additions & 3 deletions examples/nine_patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ fn startup(
fn main() {
App::new()
.add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()))
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_plugins((KayakContextPlugin, KayakWidgets))
.add_systems(Startup, startup)
.run()
}
5 changes: 2 additions & 3 deletions examples/opacity_layers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ fn main() {
App::new()
.insert_resource(ClearColor(Color::rgb(0.0, 0.0, 0.0)))
.add_plugins(DefaultPlugins)
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_plugins((KayakContextPlugin, KayakWidgets))
.add_systems(Startup, startup)
.run()
}
12 changes: 7 additions & 5 deletions examples/quads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,12 @@ fn startup(
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(LogDiagnosticsPlugin::default())
.add_plugin(FrameTimeDiagnosticsPlugin::default())
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_plugins((
LogDiagnosticsPlugin::default(),
FrameTimeDiagnosticsPlugin::default(),
KayakContextPlugin,
KayakWidgets,
))
.add_systems(Startup, startup)
.run()
}
8 changes: 3 additions & 5 deletions examples/render_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,8 @@ fn depsawn_ui(
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_system(cube_rotator_system)
.add_system(depsawn_ui)
.add_plugins((KayakContextPlugin, KayakWidgets))
.add_systems(Startup, startup)
.add_systems(Update, (cube_rotator_system, depsawn_ui))
.run()
}
12 changes: 7 additions & 5 deletions examples/scrolling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ fn main() {
App::new()
.insert_resource(ClearColor(Color::rgb(0.0, 0.0, 0.0)))
.add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()))
.add_plugin(LogDiagnosticsPlugin::default())
.add_plugin(FrameTimeDiagnosticsPlugin::default())
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_plugins((
KayakContextPlugin,
KayakWidgets,
LogDiagnosticsPlugin::default(),
FrameTimeDiagnosticsPlugin::default(),
))
.add_systems(Startup, startup)
.run()
}
5 changes: 2 additions & 3 deletions examples/simple_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ fn main() {
App::new()
.insert_resource(ClearColor(Color::rgb(0.0, 0.0, 0.0)))
.add_plugins(DefaultPlugins)
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_startup_system(startup)
.add_plugins((KayakContextPlugin, KayakWidgets))
.add_systems(Startup, startup)
.run()
}
10 changes: 6 additions & 4 deletions examples/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ fn main() {
App::new()
.insert_resource(Msaa::Sample8)
.add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()))
.add_plugin(KayakContextPlugin)
.add_plugin(KayakWidgets)
.add_plugin(bevy_svg::prelude::SvgPlugin)
.add_startup_system(startup)
.add_plugins((
KayakContextPlugin,
KayakWidgets,
bevy_svg::prelude::SvgPlugin,
))
.add_systems(Startup, startup)
.run()
}
Loading

0 comments on commit 41706b3

Please sign in to comment.