parent
7fac9f7cfc
commit
4fc2b47834
15 changed files with 36 additions and 31 deletions
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "bevy_scriptum"
|
||||
authors = ["Jaroslaw Konik <konikjar@gmail.com>"]
|
||||
version = "0.10.0"
|
||||
version = "0.11.0"
|
||||
edition = "2024"
|
||||
license = "MIT OR Apache-2.0"
|
||||
readme = "README.md"
|
||||
|
|
@ -16,7 +16,7 @@ rhai = ["dep:rhai"]
|
|||
ruby = ["dep:magnus", "dep:rb-sys"]
|
||||
|
||||
[dependencies]
|
||||
bevy = { default-features = false, version = "0.17", features = ["bevy_asset", "bevy_log"] }
|
||||
bevy = { default-features = false, version = "0.18", features = ["bevy_asset", "bevy_log"] }
|
||||
serde = "1.0.162"
|
||||
rhai = { version = "1.14.0", features = [
|
||||
"sync",
|
||||
|
|
|
|||
13
README.md
13
README.md
|
|
@ -5,11 +5,11 @@
|
|||
bevy_scriptum is a a plugin for [Bevy](https://bevyengine.org/) that allows you to write some of your game or application logic in a scripting language.
|
||||
### Supported scripting languages/runtimes
|
||||
|
||||
| language/runtime | cargo feature | documentation chapter |
|
||||
| ------------------------------------------ | ------------- | --------------------------------------------------------------- |
|
||||
| 🌙 LuaJIT | `lua` | [link](https://jarkonik.github.io/bevy_scriptum/lua/lua.html) |
|
||||
| 🌾 Rhai | `rhai` | [link](https://jarkonik.github.io/bevy_scriptum/rhai/rhai.html) |
|
||||
| 💎 Ruby(currently only supported on Linux) | `ruby` | [link](https://jarkonik.github.io/bevy_scriptum/ruby/ruby.html) |
|
||||
| language/runtime | cargo feature | documentation chapter |
|
||||
| ---------------------------------------------------- | ------------- | --------------------------------------------------------------- |
|
||||
| 🌙 LuaJIT | `lua` | [link](https://jarkonik.github.io/bevy_scriptum/lua/lua.html) |
|
||||
| 🌾 Rhai | `rhai` | [link](https://jarkonik.github.io/bevy_scriptum/rhai/rhai.html) |
|
||||
| 💎 Ruby(currently only supported on Linux and MacOS) | `ruby` | [link](https://jarkonik.github.io/bevy_scriptum/ruby/ruby.html) |
|
||||
|
||||
Documentation book is available [here](https://jarkonik.github.io/bevy_scriptum/) 📖
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ Add the following to your `Cargo.toml`:
|
|||
|
||||
```toml
|
||||
[dependencies]
|
||||
bevy_scriptum = { version = "0.10", features = ["lua"] }
|
||||
bevy_scriptum = { version = "0.11", features = ["lua"] }
|
||||
```
|
||||
|
||||
or execute `cargo add bevy_scriptum --features lua` from your project directory.
|
||||
|
|
@ -167,6 +167,7 @@ The examples live in `examples` directory and their corresponding scripts live i
|
|||
|
||||
| bevy version | bevy_scriptum version |
|
||||
|--------------|-----------------------|
|
||||
| 0.18 | 0.11 |
|
||||
| 0.17 | 0.10 |
|
||||
| 0.16 | 0.8-0.9 |
|
||||
| 0.15 | 0.7 |
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ currently being supported with security updates.
|
|||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 0.10 | :white_check_mark: |
|
||||
| 0.11 | :white_check_mark: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
| bevy version | bevy_scriptum version |
|
||||
| ------------ | --------------------- |
|
||||
| 0.18 | 0.11 |
|
||||
| 0.17 | 0.10 |
|
||||
| 0.16 | 0.8-0.9 |
|
||||
| 0.15 | 0.7 |
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ Add the following to your `Cargo.toml`:
|
|||
|
||||
```toml
|
||||
[dependencies]
|
||||
bevy_scriptum = { version = "0.10", features = ["lua"] }
|
||||
bevy_scriptum = { version = "0.11", features = ["lua"] }
|
||||
```
|
||||
|
||||
or execute `cargo add bevy_scriptum --features lua` from your project directory.
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ Add the following to your `Cargo.toml`:
|
|||
|
||||
```toml
|
||||
[dependencies]
|
||||
bevy = "0.17"
|
||||
bevy_scriptum = { version = "0.10", features = ["lua"] }
|
||||
bevy = "0.18"
|
||||
bevy_scriptum = { version = "0.11", features = ["lua"] }
|
||||
```
|
||||
|
||||
If you need a different version of bevy you need to use a matching bevy_scriptum
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ Add the following to your `Cargo.toml`:
|
|||
|
||||
```toml
|
||||
[dependencies]
|
||||
bevy = "0.17"
|
||||
bevy_scriptum = { version = "0.10", features = ["rhai"] }
|
||||
bevy = "0.18"
|
||||
bevy_scriptum = { version = "0.11", features = ["rhai"] }
|
||||
```
|
||||
|
||||
If you need a different version of bevy you need to use a matching bevy_scriptum
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Installation
|
||||
|
||||
Ruby is currently only supported on Linux.
|
||||
Ruby is currently only supported on Linux ana MacOS.
|
||||
|
||||
## Ruby
|
||||
|
||||
|
|
@ -45,8 +45,8 @@ Add the following to your `Cargo.toml`:
|
|||
|
||||
```toml
|
||||
[dependencies]
|
||||
bevy = "0.17"
|
||||
bevy_scriptum = { version = "0.10", features = ["ruby"] }
|
||||
bevy = "0.18"
|
||||
bevy_scriptum = { version = "0.11", features = ["ruby"] }
|
||||
```
|
||||
|
||||
If you need a different version of bevy you need to use a matching bevy_scriptum
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ To enable live reload it should be enough to enable `file-watcher` feature
|
|||
within bevy dependency in `Cargo.toml`
|
||||
|
||||
```toml
|
||||
bevy = { version = "0.17", features = ["file_watcher"] }
|
||||
bevy = { version = "0.18", features = ["file_watcher"] }
|
||||
```
|
||||
|
||||
## Init-teardown pattern
|
||||
|
|
|
|||
|
|
@ -3,9 +3,11 @@ use std::marker::PhantomData;
|
|||
use bevy::{
|
||||
asset::{io::Reader, Asset, AssetLoader, LoadContext},
|
||||
tasks::ConditionalSendFuture,
|
||||
reflect::TypePath,
|
||||
};
|
||||
|
||||
/// A loader for script assets.
|
||||
#[derive(TypePath)]
|
||||
pub struct ScriptLoader<A: Asset + From<String>> {
|
||||
_phantom_data: PhantomData<A>,
|
||||
}
|
||||
|
|
|
|||
13
src/lib.rs
13
src/lib.rs
|
|
@ -4,11 +4,11 @@
|
|||
|
||||
//! ## Supported scripting languages/runtimes
|
||||
//!
|
||||
//! | language/runtime | cargo feature | documentation chapter |
|
||||
//! | ------------------------------------------ | ------------- | --------------------------------------------------------------- |
|
||||
//! | 🌙 LuaJIT | `lua` | [link](https://jarkonik.github.io/bevy_scriptum/lua/lua.html) |
|
||||
//! | 🌾 Rhai | `rhai` | [link](https://jarkonik.github.io/bevy_scriptum/rhai/rhai.html) |
|
||||
//! | 💎 Ruby(currently only supported on Linux) | `ruby` | [link](https://jarkonik.github.io/bevy_scriptum/ruby/ruby.html) |
|
||||
//! | language/runtime | cargo feature | documentation chapter |
|
||||
//! | ---------------------------------------------------- | ------------- | --------------------------------------------------------------- |
|
||||
//! | 🌙 LuaJIT | `lua` | [link](https://jarkonik.github.io/bevy_scriptum/lua/lua.html) |
|
||||
//! | 🌾 Rhai | `rhai` | [link](https://jarkonik.github.io/bevy_scriptum/rhai/rhai.html) |
|
||||
//! | 💎 Ruby(currently only supported on Linux and MacOS) | `ruby` | [link](https://jarkonik.github.io/bevy_scriptum/ruby/ruby.html) |
|
||||
//!
|
||||
//! Documentation book is available [here](https://jarkonik.github.io/bevy_scriptum/) 📖
|
||||
//!
|
||||
|
|
@ -103,7 +103,7 @@
|
|||
//!
|
||||
//! ```toml
|
||||
//! [dependencies]
|
||||
//! bevy_scriptum = { version = "0.10", features = ["lua"] }
|
||||
//! bevy_scriptum = { version = "0.11", features = ["lua"] }
|
||||
//! ```
|
||||
//!
|
||||
//! or execute `cargo add bevy_scriptum --features lua` from your project directory.
|
||||
|
|
@ -176,6 +176,7 @@
|
|||
//!
|
||||
//! | bevy version | bevy_scriptum version |
|
||||
//! |--------------|-----------------------|
|
||||
//! | 0.18 | 0.11 |
|
||||
//! | 0.17 | 0.10 |
|
||||
//! | 0.16 | 0.8-0.9 |
|
||||
//! | 0.15 | 0.7 |
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ pub struct BevyEntity(pub Entity);
|
|||
|
||||
impl BevyEntity {
|
||||
pub fn index(&self) -> u32 {
|
||||
self.0.index()
|
||||
self.0.index_u32()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -104,7 +104,7 @@ impl Default for LuaRuntime {
|
|||
let engine = engine.lock().expect("Failed to lock engine");
|
||||
engine
|
||||
.register_userdata_type::<BevyEntity>(|typ| {
|
||||
typ.add_field_method_get("index", |_, entity| Ok(entity.0.index()));
|
||||
typ.add_field_method_get("index", |_, entity| Ok(entity.index()));
|
||||
})
|
||||
.expect("Failed to register BevyEntity userdata type");
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ pub struct BevyEntity(pub Entity);
|
|||
|
||||
impl BevyEntity {
|
||||
pub fn index(&self) -> u32 {
|
||||
self.0.index()
|
||||
self.0.index_u32()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ pub struct BevyEntity(pub Entity);
|
|||
|
||||
impl BevyEntity {
|
||||
pub fn index(&self) -> u32 {
|
||||
self.0.index()
|
||||
self.0.index_u32()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -441,7 +441,7 @@ macro_rules! scripting_tests {
|
|||
|
||||
assert_eq!(
|
||||
app.world().get_resource::<State>().unwrap().index,
|
||||
entity.index()
|
||||
entity.index_u32()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -473,7 +473,7 @@ macro_rules! scripting_tests {
|
|||
|
||||
assert_eq!(
|
||||
app.world().get_resource::<State>().unwrap().index,
|
||||
Some(entity.index())
|
||||
Some(entity.index_u32())
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -505,7 +505,7 @@ macro_rules! scripting_tests {
|
|||
|
||||
assert_eq!(
|
||||
app.world().get_resource::<State>().unwrap().index,
|
||||
Some(entity.index())
|
||||
Some(entity.index_u32())
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue