Skip to content

Bump bevy & bevy console #153

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

Merged
merged 3 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
43 changes: 21 additions & 22 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ bevy_script_api = { path = "crates/bevy_script_api", version = "0.8.0-alpha.1",


[workspace.dependencies]
bevy = { version = "0.15.0-rc.3", default-features = false }
bevy = { version = "0.15.0", default-features = false }
bevy_mod_scripting_core = { path = "crates/bevy_mod_scripting_core", version = "0.8.0-alpha.1" }
bevy_mod_scripting_common = { path = "crates/bevy_mod_scripting_common", version = "0.8.0-alpha.1" }

[dev-dependencies]
bevy = { workspace = true, default-features = true }
clap = { version = "4.1", features = ["derive"] }
rand = "0.8.5"
bevy_console = "0.12"
bevy_console = "0.13"
rhai-rand = "0.1"

[workspace]
Expand Down Expand Up @@ -111,26 +111,25 @@ codegen-units = 8
incremental = false
debug = false

# TODO: bump once bevy is released and the lib is updated
# [[example]]
# name = "console_integration_lua"
# path = "examples/lua/console_integration.rs"
# required-features = [
# "lua54",
# "lua_script_api",
# "bevy/file_watcher",
# "bevy/multi_threaded",
# ]

# [[example]]
# name = "console_integration_rhai"
# path = "examples/rhai/console_integration.rs"
# required-features = [
# "rhai",
# "rhai_script_api",
# "bevy/file_watcher",
# "bevy/multi_threaded",
# ]
[[example]]
name = "console_integration_lua"
path = "examples/lua/console_integration.rs"
required-features = [
"lua54",
"lua_script_api",
"bevy/file_watcher",
"bevy/multi_threaded",
]

[[example]]
name = "console_integration_rhai"
path = "examples/rhai/console_integration.rs"
required-features = [
"rhai",
"rhai_script_api",
"bevy/file_watcher",
"bevy/multi_threaded",
]

[[example]]
name = "complex_game_loop_lua"
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_mod_scripting_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ doc_always = []
[dependencies]
bevy = { workspace = true, default-features = false, features = [
"bevy_asset",
"bevy_gltf",
"bevy_animation",
"bevy_core_pipeline",
"bevy_ui",
Expand Down
69 changes: 0 additions & 69 deletions crates/bevy_script_api/src/providers/bevy_a11y.rs

This file was deleted.

12 changes: 6 additions & 6 deletions crates/bevy_script_api/src/providers/bevy_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ use bevy_script_api::{
remote = "bevy::core::prelude::Name",
functions[r#"

#[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
fn clone(&self) -> bevy::core::prelude::Name;

"#,
r#"

#[lua(
as_trait = "std::cmp::PartialEq",
kind = "MetaFunction",
Expand All @@ -28,6 +22,12 @@ use bevy_script_api::{
)]
fn eq(&self, #[proxy] other: &name::Name) -> bool;

"#,
r#"

#[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
fn clone(&self) -> bevy::core::prelude::Name;

"#,
r#"
#[lua(kind="MetaMethod", metamethod="ToString")]
Expand Down
107 changes: 60 additions & 47 deletions crates/bevy_script_api/src/providers/bevy_ecs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ use bevy_script_api::{
remote = "bevy::ecs::entity::Entity",
functions[r#"

#[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
fn clone(&self) -> bevy::ecs::entity::Entity;
#[lua(
as_trait = "std::cmp::PartialEq",
kind = "MetaFunction",
composite = "eq",
metamethod = "Eq",
)]
fn eq(&self, #[proxy] other: &entity::Entity) -> bool;

"#,
r#"
Expand Down Expand Up @@ -73,13 +78,8 @@ use bevy_script_api::{
"#,
r#"

#[lua(
as_trait = "std::cmp::PartialEq",
kind = "MetaFunction",
composite = "eq",
metamethod = "Eq",
)]
fn eq(&self, #[proxy] other: &entity::Entity) -> bool;
#[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
fn clone(&self) -> bevy::ecs::entity::Entity;

"#,
r#"
Expand Down Expand Up @@ -143,17 +143,6 @@ struct OnReplace {}
derive(clone),
remote = "bevy::ecs::component::ComponentId",
functions[r#"

#[lua(
as_trait = "std::cmp::PartialEq",
kind = "MetaFunction",
composite = "eq",
metamethod = "Eq",
)]
fn eq(&self, #[proxy] other: &component::ComponentId) -> bool;

"#,
r#"
/// Creates a new [`ComponentId`].
/// The `index` is a unique value associated with each type of component in a given world.
/// Usually, this value is taken from a counter incremented for each type of component registered with the world.
Expand All @@ -174,6 +163,17 @@ struct OnReplace {}
#[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
fn clone(&self) -> bevy::ecs::component::ComponentId;

"#,
r#"

#[lua(
as_trait = "std::cmp::PartialEq",
kind = "MetaFunction",
composite = "eq",
metamethod = "Eq",
)]
fn eq(&self, #[proxy] other: &component::ComponentId) -> bool;

"#,
r#"

Expand All @@ -195,8 +195,8 @@ struct ComponentId();
remote = "bevy::ecs::component::Tick",
functions[r#"

#[lua(as_trait = "std::cmp::Eq", kind = "Method")]
fn assert_receiver_is_total_eq(&self) -> ();
#[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
fn clone(&self) -> bevy::ecs::component::Tick;

"#,
r#"
Expand All @@ -212,8 +212,8 @@ struct ComponentId();
"#,
r#"

#[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
fn clone(&self) -> bevy::ecs::component::Tick;
#[lua(as_trait = "std::cmp::Eq", kind = "Method")]
fn assert_receiver_is_total_eq(&self) -> ();

"#,
r#"
Expand Down Expand Up @@ -264,12 +264,6 @@ struct Tick {}
derive(clone),
remote = "bevy::ecs::component::ComponentTicks",
functions[r#"

#[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
fn clone(&self) -> bevy::ecs::component::ComponentTicks;

"#,
r#"
/// Returns `true` if the component or resource was added after the system last ran
/// (or the system is running for the first time).

Expand Down Expand Up @@ -298,17 +292,13 @@ struct Tick {}

"#,
r#"
/// Returns the tick recording the time this component or resource was most recently changed.
/// Creates a new instance with the same change tick for `added` and `changed`.

#[lua(kind = "Method", output(proxy))]
fn last_changed_tick(&self) -> bevy::ecs::component::Tick;

"#,
r#"
/// Returns the tick recording the time this component or resource was added.

#[lua(kind = "Method", output(proxy))]
fn added_tick(&self) -> bevy::ecs::component::Tick;
#[lua(kind = "Function", output(proxy))]
fn new(
#[proxy]
change_tick: bevy::ecs::component::Tick,
) -> bevy::ecs::component::ComponentTicks;

"#,
r#"
Expand All @@ -327,6 +317,12 @@ struct Tick {}
#[lua(kind = "MutatingMethod")]
fn set_changed(&mut self, #[proxy] change_tick: bevy::ecs::component::Tick) -> ();

"#,
r#"

#[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
fn clone(&self) -> bevy::ecs::component::ComponentTicks;

"#,
r#"
#[lua(kind="MetaMethod", metamethod="ToString")]
Expand All @@ -335,19 +331,18 @@ fn index(&self) -> String {
}
"#]
)]
struct ComponentTicks {}
struct ComponentTicks {
#[lua(output(proxy))]
added: bevy::ecs::component::Tick,
#[lua(output(proxy))]
changed: bevy::ecs::component::Tick,
}
#[derive(bevy_mod_scripting_lua_derive::LuaProxy)]
#[proxy(
derive(clone),
remote = "bevy::ecs::identifier::Identifier",
functions[r#"

#[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
fn clone(&self) -> bevy::ecs::identifier::Identifier;

"#,
r#"

#[lua(
as_trait = "std::cmp::PartialEq",
kind = "MetaFunction",
Expand Down Expand Up @@ -387,6 +382,12 @@ struct ComponentTicks {}
#[lua(kind = "Function", output(proxy))]
fn from_bits(value: u64) -> bevy::ecs::identifier::Identifier;

"#,
r#"

#[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
fn clone(&self) -> bevy::ecs::identifier::Identifier;

"#,
r#"
#[lua(kind="MetaMethod", metamethod="ToString")]
Expand Down Expand Up @@ -451,6 +452,13 @@ impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals {
"Tick",
bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::<LuaTick>::new,
)?;
instances
.add_instance(
"ComponentTicks",
bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::<
LuaComponentTicks,
>::new,
)?;
instances
.add_instance(
"Identifier",
Expand Down Expand Up @@ -500,6 +508,11 @@ impl bevy_mod_scripting_core::hosts::APIProvider for BevyEcsAPIProvider {
bevy_mod_scripting_lua::tealr::mlu::UserDataProxy<LuaTick>,
>()
.process_type::<LuaComponentTicks>()
.process_type::<
bevy_mod_scripting_lua::tealr::mlu::UserDataProxy<
LuaComponentTicks,
>,
>()
.process_type::<LuaIdentifier>()
.process_type::<
bevy_mod_scripting_lua::tealr::mlu::UserDataProxy<
Expand Down
8 changes: 4 additions & 4 deletions crates/bevy_script_api/src/providers/bevy_hierarchy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ struct Parent();
remote = "bevy::hierarchy::HierarchyEvent",
functions[r#"

#[lua(as_trait = "std::cmp::Eq", kind = "Method")]
fn assert_receiver_is_total_eq(&self) -> ();
#[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
fn clone(&self) -> bevy::hierarchy::HierarchyEvent;

"#,
r#"
Expand All @@ -87,8 +87,8 @@ struct Parent();
"#,
r#"

#[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
fn clone(&self) -> bevy::hierarchy::HierarchyEvent;
#[lua(as_trait = "std::cmp::Eq", kind = "Method")]
fn assert_receiver_is_total_eq(&self) -> ();

"#,
r#"
Expand Down
Loading
Loading