diff --git a/Cargo.toml b/Cargo.toml index d14c547..c6d27f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_scriptum" authors = ["Jaroslaw Konik "] -version = "0.7.0" +version = "0.8.0" edition = "2021" license = "MIT OR Apache-2.0" readme = "README.md" @@ -15,7 +15,7 @@ lua = ["mlua/luajit"] rhai = ["dep:rhai"] [dependencies] -bevy = { default-features = false, version = "0.15", features = ["bevy_asset"] } +bevy = { default-features = false, version = "0.16", features = ["bevy_asset", "bevy_log"] } serde = "1.0.162" rhai = { version = "1.14.0", features = [ "sync", diff --git a/README.md b/README.md index e4d359c..6e55837 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,7 @@ The examples live in `examples` directory and their corresponding scripts live i | bevy version | bevy_scriptum version | |--------------|-----------------------| +| 0.16 | 0.8 | | 0.15 | 0.7 | | 0.14 | 0.6 | | 0.13 | 0.4-0.5 | diff --git a/SECURITY.md b/SECURITY.md index d124bd4..1acfd39 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -7,7 +7,7 @@ currently being supported with security updates. | Version | Supported | | ------- | ------------------ | -| 0.7 | :white_check_mark: | +| 0.8 | :white_check_mark: | ## Reporting a Vulnerability diff --git a/book/src/bevy_support_matrix.md b/book/src/bevy_support_matrix.md index d67b8d8..87bbe80 100644 --- a/book/src/bevy_support_matrix.md +++ b/book/src/bevy_support_matrix.md @@ -2,6 +2,7 @@ | bevy version | bevy_scriptum version | | ------------ | --------------------- | +| 0.16 | 0.8 | | 0.15 | 0.7 | | 0.14 | 0.6 | | 0.13 | 0.4-0.5 | diff --git a/book/src/introduction.md b/book/src/introduction.md index a643a37..63a6a32 100644 --- a/book/src/introduction.md +++ b/book/src/introduction.md @@ -124,7 +124,7 @@ Add the following to your `Cargo.toml`: ```toml [dependencies] -bevy_scriptum = { version = "0.7", features = ["lua"] } +bevy_scriptum = { version = "0.8", features = ["lua"] } ``` or execute `cargo add bevy_scriptum --features lua` from your project directory. diff --git a/book/src/lua/installation.md b/book/src/lua/installation.md index 1c4beee..4caaac9 100644 --- a/book/src/lua/installation.md +++ b/book/src/lua/installation.md @@ -4,8 +4,8 @@ Add the following to your `Cargo.toml`: ```toml [dependencies] -bevy = "0.15" -bevy_scriptum = { version = "0.7", features = ["lua"] } +bevy = "0.16" +bevy_scriptum = { version = "0.8", features = ["lua"] } ``` If you need a different version of bevy you need to use a matching bevy_scriptum diff --git a/book/src/rhai/installation.md b/book/src/rhai/installation.md index 7991425..01d9dee 100644 --- a/book/src/rhai/installation.md +++ b/book/src/rhai/installation.md @@ -4,8 +4,8 @@ Add the following to your `Cargo.toml`: ```toml [dependencies] -bevy = "0.15" -bevy_scriptum = { version = "0.7", features = ["rhai"] } +bevy = "0.16" +bevy_scriptum = { version = "0.8", features = ["rhai"] } ``` If you need a different version of bevy you need to use a matching bevy_scriptum diff --git a/book/src/workflow/live_reload.md b/book/src/workflow/live_reload.md index 3c37c23..447e84c 100644 --- a/book/src/workflow/live_reload.md +++ b/book/src/workflow/live_reload.md @@ -6,7 +6,7 @@ To enable live reload it should be enough to enable `file-watcher` feature within bevy dependency in `Cargo.toml` ``` -bevy = { version = "0.15", features = ["file_watcher"] } +bevy = { version = "0.16", features = ["file_watcher"] } ``` ## Init-teardown pattern for game development diff --git a/examples/lua/call_function_from_rust.rs b/examples/lua/call_function_from_rust.rs index 49df2c8..14b0386 100644 --- a/examples/lua/call_function_from_rust.rs +++ b/examples/lua/call_function_from_rust.rs @@ -9,7 +9,7 @@ fn main() { .add_systems(Update, call_lua_on_update_from_rust) .add_scripting::(|runtime| { runtime.add_function(String::from("quit"), |mut exit: EventWriter| { - exit.send(AppExit::Success); + exit.write(AppExit::Success); }); }) .run(); diff --git a/examples/lua/promises.rs b/examples/lua/promises.rs index b1095a4..27c4200 100644 --- a/examples/lua/promises.rs +++ b/examples/lua/promises.rs @@ -11,7 +11,7 @@ fn main() { .add_scripting::(|builder| { builder.add_function( String::from("get_player_name"), - |player_names: Query<&Name, With>| player_names.single().to_string(), + |player_names: Query<&Name, With>| player_names.single().expect("Missing player_names").to_string(), ); }) .add_systems(Startup, startup) diff --git a/examples/lua/side_effects.rs b/examples/lua/side_effects.rs index 49eef1b..e3567ff 100644 --- a/examples/lua/side_effects.rs +++ b/examples/lua/side_effects.rs @@ -38,6 +38,6 @@ fn print_entity_names_and_quit(query: Query<&Name>, mut exit: EventWriter(|runtime| { runtime.add_function(String::from("quit"), |mut exit: EventWriter| { - exit.send(AppExit::Success); + exit.write(AppExit::Success); }); }) .run(); diff --git a/examples/rhai/promises.rs b/examples/rhai/promises.rs index 8b2a5d8..5a56ac1 100644 --- a/examples/rhai/promises.rs +++ b/examples/rhai/promises.rs @@ -11,7 +11,7 @@ fn main() { .add_scripting::(|builder| { builder.add_function( String::from("get_player_name"), - |player_names: Query<&Name, With>| player_names.single().to_string(), + |player_names: Query<&Name, With>| player_names.single().expect("Missing player_names").to_string(), ); }) .add_systems(Startup, startup) diff --git a/examples/rhai/side_effects.rs b/examples/rhai/side_effects.rs index a83dd32..28a6770 100644 --- a/examples/rhai/side_effects.rs +++ b/examples/rhai/side_effects.rs @@ -36,6 +36,6 @@ fn print_entity_names_and_quit(query: Query<&Name>, mut exit: EventWriter + GetExtensions; - type ScriptData: Component; + type ScriptData: Component; type CallContext: Send + Clone; type Value: Send + Clone; type RawEngine; diff --git a/src/runtimes/lua.rs b/src/runtimes/lua.rs index 4b240cf..43d852b 100644 --- a/src/runtimes/lua.rs +++ b/src/runtimes/lua.rs @@ -1,6 +1,6 @@ use bevy::{ asset::Asset, - ecs::{component::Component, entity::Entity, schedule::ScheduleLabel, system::Resource}, + ecs::{component::Component, entity::Entity, schedule::ScheduleLabel, resource::Resource}, math::Vec3, reflect::TypePath, }; diff --git a/src/runtimes/rhai.rs b/src/runtimes/rhai.rs index 8e34fbd..5515501 100644 --- a/src/runtimes/rhai.rs +++ b/src/runtimes/rhai.rs @@ -2,7 +2,7 @@ use std::fmt::Debug; use bevy::{ asset::Asset, - ecs::{component::Component, entity::Entity, schedule::ScheduleLabel, system::Resource}, + ecs::{component::Component, entity::Entity, schedule::ScheduleLabel, resource::Resource}, math::Vec3, reflect::TypePath, }; diff --git a/src/systems.rs b/src/systems.rs index 54904e9..a259fe9 100644 --- a/src/systems.rs +++ b/src/systems.rs @@ -1,4 +1,4 @@ -use bevy::{prelude::*, utils::tracing}; +use bevy::{prelude::*, log::tracing}; use std::{ fmt::Display, sync::{Arc, Mutex}, diff --git a/tests/tests.rs b/tests/tests.rs index 6d5375c..7dcf443 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -49,7 +49,7 @@ fn call_script_on_update_from_rust( ) where (): for<'a> FuncArgs<'a, R::Value, R>, { - let (entity, mut script_data) = scripted_entities.single_mut(); + let (entity, mut script_data) = scripted_entities.single_mut().unwrap(); scripting_runtime .call_fn("test_func", &mut script_data, entity, ()) .unwrap(); @@ -83,7 +83,7 @@ macro_rules! scripting_tests { .to_string(), |mut scripted_entities: Query<(Entity, &mut <$runtime as Runtime>::ScriptData)>, scripting_runtime: ResMut<$runtime>| { - let (entity, mut script_data) = scripted_entities.single_mut(); + let (entity, mut script_data) = scripted_entities.single_mut().unwrap(); scripting_runtime .call_fn("test_func", &mut script_data, entity, vec![1]) .unwrap(); @@ -178,7 +178,7 @@ macro_rules! scripting_tests { .to_string(), |mut scripted_entities: Query<(Entity, &mut <$runtime as Runtime>::ScriptData)>, scripting_runtime: ResMut<$runtime>| { - let (entity, mut script_data) = scripted_entities.single_mut(); + let (entity, mut script_data) = scripted_entities.single_mut().unwrap(); scripting_runtime .call_fn("test_func", &mut script_data, entity, vec![1]) .unwrap(); @@ -203,7 +203,7 @@ macro_rules! scripting_tests { .to_string(), |mut scripted_entities: Query<(Entity, &mut <$runtime as Runtime>::ScriptData)>, scripting_runtime: ResMut<$runtime>| { - let (entity, mut script_data) = scripted_entities.single_mut(); + let (entity, mut script_data) = scripted_entities.single_mut().unwrap(); scripting_runtime .call_fn( "test_func", @@ -239,7 +239,7 @@ macro_rules! scripting_tests { .to_string(), |mut scripted_entities: Query<(Entity, &mut <$runtime as Runtime>::ScriptData)>, scripting_runtime: ResMut<$runtime>| { - let (entity, mut script_data) = scripted_entities.single_mut(); + let (entity, mut script_data) = scripted_entities.single_mut().unwrap(); scripting_runtime .call_fn("test_func", &mut script_data, entity, vec![1, 2]) .unwrap(); @@ -265,7 +265,7 @@ macro_rules! scripting_tests { .to_string(), |mut scripted_entities: Query<(Entity, &mut <$runtime as Runtime>::ScriptData)>, scripting_runtime: ResMut<$runtime>| { - let (entity, mut script_data) = scripted_entities.single_mut(); + let (entity, mut script_data) = scripted_entities.single_mut().unwrap(); let result = scripting_runtime.call_fn("test_func", &mut script_data, entity, ()); assert!(result.is_err()); @@ -288,7 +288,7 @@ macro_rules! scripting_tests { .to_string(), |mut scripted_entities: Query<(Entity, &mut <$runtime as Runtime>::ScriptData)>, scripting_runtime: ResMut<$runtime>| { - let (entity, mut script_data) = scripted_entities.single_mut(); + let (entity, mut script_data) = scripted_entities.single_mut().unwrap(); let result = scripting_runtime.call_fn("does_not_exist", &mut script_data, entity, ()); assert!(result.is_err()); @@ -368,7 +368,7 @@ macro_rules! scripting_tests { app.world_mut() .run_system_once(|tagged: Query<&MyTag>| { - tagged.single(); + tagged.single().unwrap(); }) .unwrap(); }