Skip to content

Commit

Permalink
Merge branch 'main' into feat/refactor-handler-context-as-system-param
Browse files Browse the repository at this point in the history
  • Loading branch information
makspll authored Feb 26, 2025
2 parents 7b44afb + 4af18c0 commit e7db4d6
Show file tree
Hide file tree
Showing 17 changed files with 62 additions and 23 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## [0.9.8](https://github.com/makspll/bevy_mod_scripting/compare/v0.9.7...v0.9.8) - 2025-02-25

### Added

- Allow trailing comma in callback_labels. (#325)

### Fixed

- `enable_context_sharing` not returning the plugin like a real builder

## [0.9.7](https://github.com/makspll/bevy_mod_scripting/compare/v0.9.6...v0.9.7) - 2025-02-23

### Added
Expand Down
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_mod_scripting"
version = "0.9.7"
version = "0.9.8"
authors = ["Maksymilian Mozolewski <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down Expand Up @@ -53,18 +53,18 @@ rhai = ["bevy_mod_scripting_rhai"]
[dependencies]
bevy = { workspace = true }
bevy_mod_scripting_core = { workspace = true }
bevy_mod_scripting_lua = { path = "crates/languages/bevy_mod_scripting_lua", version = "0.9.7", optional = true }
bevy_mod_scripting_rhai = { path = "crates/languages/bevy_mod_scripting_rhai", version = "0.9.7", optional = true }
bevy_mod_scripting_lua = { path = "crates/languages/bevy_mod_scripting_lua", version = "0.9.8", optional = true }
bevy_mod_scripting_rhai = { path = "crates/languages/bevy_mod_scripting_rhai", version = "0.9.8", optional = true }
# bevy_mod_scripting_rune = { path = "crates/languages/bevy_mod_scripting_rune", version = "0.9.0-alpha.2", optional = true }
bevy_mod_scripting_functions = { workspace = true }
bevy_mod_scripting_derive = { workspace = true }

[workspace.dependencies]
profiling = { version = "1.0" }
bevy = { version = "0.15.2", default-features = false }
bevy_mod_scripting_core = { path = "crates/bevy_mod_scripting_core", version = "0.9.7" }
bevy_mod_scripting_functions = { path = "crates/bevy_mod_scripting_functions", version = "0.9.7", default-features = false }
bevy_mod_scripting_derive = { path = "crates/bevy_mod_scripting_derive", version = "0.9.7" }
bevy_mod_scripting_core = { path = "crates/bevy_mod_scripting_core", version = "0.9.8" }
bevy_mod_scripting_functions = { path = "crates/bevy_mod_scripting_functions", version = "0.9.8", default-features = false }
bevy_mod_scripting_derive = { path = "crates/bevy_mod_scripting_derive", version = "0.9.8" }

# test utilities
script_integration_test_harness = { path = "crates/testing_crates/script_integration_test_harness" }
Expand All @@ -77,7 +77,7 @@ rand = "0.8.5"
bevy_console = "0.13"
# rhai-rand = "0.1"
ansi-parser = "0.9"
ladfile_builder = { path = "crates/ladfile_builder", version = "0.2.1" }
ladfile_builder = { path = "crates/ladfile_builder", version = "0.2.2" }

[workspace]
members = [
Expand Down
10 changes: 10 additions & 0 deletions crates/bevy_mod_scripting_core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.9.8](https://github.com/makspll/bevy_mod_scripting/compare/bevy_mod_scripting_core-v0.9.7...bevy_mod_scripting_core-v0.9.8) - 2025-02-25

### Added

- Allow trailing comma in callback_labels. (#325)

### Fixed

- `enable_context_sharing` not returning the plugin like a real builder

## [0.9.7](https://github.com/makspll/bevy_mod_scripting/compare/bevy_mod_scripting_core-v0.9.6...bevy_mod_scripting_core-v0.9.7) - 2025-02-23

### Added
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_mod_scripting_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_mod_scripting_core"
version = "0.9.7"
version = "0.9.8"
authors = ["Maksymilian Mozolewski <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_mod_scripting_core/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl CallbackLabel {
#[macro_export]
/// Creates a set of callback labels
macro_rules! callback_labels {
($($name:ident => $label:expr),*) => {
($($name:ident => $label:expr),* $(,)?) => {

$(
#[doc = "A callback label for the event: "]
Expand All @@ -74,7 +74,7 @@ macro_rules! callback_labels {

callback_labels!(
OnScriptLoaded => "on_script_loaded",
OnScriptUnloaded => "on_script_unloaded"
OnScriptUnloaded => "on_script_unloaded",
);

/// A trait for types that can be converted into a callback label
Expand Down
7 changes: 4 additions & 3 deletions crates/bevy_mod_scripting_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ pub trait ConfigureScriptPlugin {
/// Switch the context assigning strategy to a global context assigner.
///
/// This means that all scripts will share the same context. This is useful for when you want to share data between scripts easilly.
/// Be careful however as this also means that scripts can interfere with each other in unexpected ways!.
fn enable_context_sharing(self);
/// Be careful however as this also means that scripts can interfere with each other in unexpected ways! Including overwriting each other's handlers.
fn enable_context_sharing(self) -> Self;
}

impl<P: IntoScriptPluginParams + AsMut<ScriptingPlugin<P>>> ConfigureScriptPlugin for P {
Expand All @@ -223,8 +223,9 @@ impl<P: IntoScriptPluginParams + AsMut<ScriptingPlugin<P>>> ConfigureScriptPlugi
self
}

fn enable_context_sharing(mut self) {
fn enable_context_sharing(mut self) -> Self {
self.as_mut().context_assigner = ContextAssigner::new_global_context_assigner();
self
}
}

Expand Down
6 changes: 6 additions & 0 deletions crates/bevy_mod_scripting_derive/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.9.8](https://github.com/makspll/bevy_mod_scripting/compare/bevy_mod_scripting_derive-v0.9.7...bevy_mod_scripting_derive-v0.9.8) - 2025-02-25

### Fixed

- Generate IntoScript implementation with the correct path (#326)

## [0.9.7](https://github.com/makspll/bevy_mod_scripting/compare/bevy_mod_scripting_derive-v0.9.6...bevy_mod_scripting_derive-v0.9.7) - 2025-02-23

### Added
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_mod_scripting_derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_mod_scripting_derive"
version = "0.9.7"
version = "0.9.8"
edition = "2021"
authors = ["Maksymilian Mozolewski <[email protected]>"]
license = "MIT OR Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_mod_scripting_derive/src/derive/into_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub fn into_script(input: TokenStream) -> TokenStream {
let (impl_generics, type_generics, where_clause) = generics.split_for_impl();

quote! {
impl #impl_generics ::bevy_mod_scripting::bindings::function::into::IntoScript for #ident #type_generics #where_clause {
impl #impl_generics ::bevy_mod_scripting::core::bindings::function::into::IntoScript for #ident #type_generics #where_clause {
fn into_script(self, world: ::bevy_mod_scripting::core::bindings::WorldGuard) -> Result<::bevy_mod_scripting::core::bindings::script_value::ScriptValue, ::bevy_mod_scripting::core::error::InteropError> {
::bevy_mod_scripting::core::bindings::function::into::IntoScript::into_script(
::bevy_mod_scripting::core::bindings::function::from::Val(self),
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_mod_scripting_functions/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_mod_scripting_functions"
version = "0.9.7"
version = "0.9.8"
edition = "2021"
authors = ["Maksymilian Mozolewski <[email protected]>"]
license = "MIT OR Apache-2.0"
Expand Down
6 changes: 6 additions & 0 deletions crates/lad_backends/mdbook_lad_preprocessor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.1.2](https://github.com/makspll/bevy_mod_scripting/compare/mdbook_lad_preprocessor-v0.1.1...mdbook_lad_preprocessor-v0.1.2) - 2025-02-25

### Added

- *(mdbook)* improve mdbook generics behaviour and fix broken links (#319)

## [0.1.1](https://github.com/makspll/bevy_mod_scripting/compare/mdbook_lad_preprocessor-v0.1.0...mdbook_lad_preprocessor-v0.1.1) - 2025-02-23

### Added
Expand Down
4 changes: 2 additions & 2 deletions crates/lad_backends/mdbook_lad_preprocessor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mdbook_lad_preprocessor"
version = "0.1.1"
version = "0.1.2"
edition = "2021"
authors = ["Maksymilian Mozolewski <[email protected]>"]
license = "MIT OR Apache-2.0"
Expand All @@ -15,7 +15,7 @@ readme = "readme.md"
[dependencies]
clap = "4"
mdbook = "0.4"
ladfile = { path = "../../ladfile", version = "0.3.0" }
ladfile = { path = "../../ladfile", version = "0.3.1" }
env_logger = "0.11"
log = "0.4"
serde_json = "1.0"
Expand Down
6 changes: 6 additions & 0 deletions crates/ladfile/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.1](https://github.com/makspll/bevy_mod_scripting/compare/v0.3.0-ladfile...v0.3.1-ladfile) - 2025-02-25

### Added

- *(mdbook)* improve mdbook generics behaviour and fix broken links (#319)

## [0.3.0](https://github.com/makspll/bevy_mod_scripting/compare/v0.2.0-ladfile...v0.3.0-ladfile) - 2025-02-23

### Added
Expand Down
2 changes: 1 addition & 1 deletion crates/ladfile/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ladfile"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
authors = ["Maksymilian Mozolewski <[email protected]>"]
license = "MIT OR Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions crates/ladfile_builder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ladfile_builder"
version = "0.2.1"
version = "0.2.2"
edition = "2021"
authors = ["Maksymilian Mozolewski <[email protected]>"]
license = "MIT OR Apache-2.0"
Expand All @@ -17,7 +17,7 @@ bevy_mod_scripting_core = { workspace = true }
# I don't think bevy has a top level feature for this :C
bevy = { workspace = true }
bevy_reflect = { version = "0.15.2", features = ["documentation"] }
ladfile = { version = "0.3.0", path = "../ladfile" }
ladfile = { version = "0.3.1", path = "../ladfile" }
regex = "1.11"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/languages/bevy_mod_scripting_lua/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_mod_scripting_lua"
version = "0.9.7"
version = "0.9.8"
authors = ["Maksymilian Mozolewski <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/languages/bevy_mod_scripting_rhai/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_mod_scripting_rhai"
version = "0.9.7"
version = "0.9.8"
authors = ["Maksymilian Mozolewski <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down

0 comments on commit e7db4d6

Please sign in to comment.