diff --git a/.vscode/settings.json b/.vscode/settings.json index 2561f143..5a25c446 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,5 +19,5 @@ "/home/makspll/git/bevy_mod_scripting/check.sh" ], "rust-analyzer.showUnlinkedFileNotification": false, - "rust-analyzer.semanticHighlighting.operator.enable": false + // "rust-analyzer.semanticHighlighting.operator.enable": false } \ No newline at end of file diff --git a/check.sh b/check.sh index 9c3bf174..4da6892c 100755 --- a/check.sh +++ b/check.sh @@ -3,7 +3,7 @@ unset RUSTUP_TOOLCHAIN CURRENT_DIR=$(basename "$PWD") if [[ "$CURRENT_DIR" == "bevy_api_gen" ]]; then - cargo clippy --message-format=json + cargo clippy --message-format=json else cargo clippy --message-format=json --features="lua54, lua_script_api, rhai, rhai_script_api, teal, rune" fi \ No newline at end of file diff --git a/crates/bevy_api_gen/src/passes/codegen.rs b/crates/bevy_api_gen/src/passes/codegen.rs index 522f9c8a..6a2a1a68 100644 --- a/crates/bevy_api_gen/src/passes/codegen.rs +++ b/crates/bevy_api_gen/src/passes/codegen.rs @@ -45,6 +45,10 @@ pub(crate) fn codegen(ctxt: &mut BevyCtxt<'_>, args: &Args) -> bool { mod tests { use std::collections::HashSet; + use strum::VariantNames; + + use crate::TEMPLATE_DIR; + use super::*; #[test] diff --git a/crates/bevy_api_gen/src/template.rs b/crates/bevy_api_gen/src/template.rs index b517a2d0..eb9c2d87 100644 --- a/crates/bevy_api_gen/src/template.rs +++ b/crates/bevy_api_gen/src/template.rs @@ -25,6 +25,9 @@ pub static TEMPLATE_DIR: Dir = include_dir!("$CARGO_MANIFEST_DIR/templates"); Deserialize, )] pub enum TemplateKind { + // Note: order here matters, macros need to be loaded first as they are used in other templates + #[strum(to_string = "macros.tera")] + Macros, #[strum(to_string = "mod.tera")] SharedModule, #[strum(to_string = "crate.tera")] @@ -155,7 +158,6 @@ pub fn configure_tera( .expect("Missing template kind file in the binary") .contents_utf8() .unwrap(); - tera.add_raw_template(template_filename, content) .expect("Could not load built-in template"); } diff --git a/crates/bevy_api_gen/templates/footer.tera b/crates/bevy_api_gen/templates/footer.tera index 9278410b..b14a4794 100644 --- a/crates/bevy_api_gen/templates/footer.tera +++ b/crates/bevy_api_gen/templates/footer.tera @@ -1,10 +1,3 @@ - -{% if args.self_is_bevy_script_api %} -crate::impl_tealr_generic!(pub(crate) struct T); -{% else %} -bevy_script_api::impl_tealr_generic!(pub(crate) struct T); -{% endif %} - #[derive(Default)] pub(crate) struct Globals; @@ -15,7 +8,7 @@ impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { ) -> bevy_mod_scripting_lua::tealr::mlu::mlua::Result<()> { {% for item in items %} {% if item.has_static_methods %} - instances.add_instance("{{ item.ident | prefix_lua }}", + instances.add_instance("{{ item.ident }}", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::<{{item.ident | prefix_lua}}>::new)?; {% endif %} {% endfor %} diff --git a/crates/bevy_api_gen/templates/item.tera b/crates/bevy_api_gen/templates/item.tera index d7a43991..c5077b93 100644 --- a/crates/bevy_api_gen/templates/item.tera +++ b/crates/bevy_api_gen/templates/item.tera @@ -1,3 +1,4 @@ +{% import "macros.tera" as macros -%} {% for line in item.docstrings %} ///{{ line }} {% endfor %} @@ -19,6 +20,31 @@ functions[ --- {%- include "function.tera" -%} {%- endfor -%} + {% if item.import_path is matching("bevy::math::[^B]?Vec.?") %} + --- + r#" + {%- set vec_type = item.import_path | split(pat="::") | last -%} + + {%- if vec_type is starting_with("V") -%} + {%- set num_type = "f32" -%} + {%- elif vec_type is starting_with("U16") -%} + {%- set num_type = "u64" -%} + {%- elif vec_type is starting_with("UV") -%} + {%- set num_type = "u32" -%} + {%- elif vec_type is starting_with("U16") -%} + {%- set num_type = "u16" -%} + {%- elif vec_type is starting_with("DV") -%} + {%- set num_type = "f64" -%} + {%- elif vec_type is starting_with("IV") -%} + {%- set num_type = "i32" -%} + {%- elif vec_type is starting_with("I16") -%} + {%- set num_type = "i16" -%} + {%- elif vec_type is starting_with("I64") -%} + {%- set num_type = "i64" -%} + {%- endif -%} + {{- macros::vector_index(num_type=num_type) -}} + "# + {% endif %} {%- endfilter -%} ] )] diff --git a/crates/bevy_api_gen/templates/macros.tera b/crates/bevy_api_gen/templates/macros.tera new file mode 100644 index 00000000..3b1bcdf5 --- /dev/null +++ b/crates/bevy_api_gen/templates/macros.tera @@ -0,0 +1,13 @@ +{% macro vector_index(num_type) %} +#[lua(kind="Method", raw , metamethod="Index")] +fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result<{{ num_type }},_> { + Ok(self.inner()?[*idx]) +} +{% endmacro vector_index %} + +{% macro vector_newindex(num_type) %} +#[lua(kind="MutatingMethod", raw , metamethod="NewIndex")] +fn index(&mut self, lua: &Lua, (idx, val): (crate::lua::util::LuaIndex,{{ num_type }})) -> Result<{{ num_type }},_> { + self.val_mut(|s| Ok(s[*idx] = val))? +} +{% endmacro vector_newindex %} \ No newline at end of file diff --git a/crates/bevy_script_api/src/core_providers.rs b/crates/bevy_script_api/src/core_providers.rs new file mode 100644 index 00000000..7998be9b --- /dev/null +++ b/crates/bevy_script_api/src/core_providers.rs @@ -0,0 +1,114 @@ +use crate::lua::RegisterForeignLuaType; + +pub struct CoreBevyAPIProvider; + +#[derive(Default)] +pub(crate) struct CoreBevyGlobals; + +crate::impl_tealr_generic!(pub(crate) struct T); + +impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for CoreBevyGlobals { + fn add_instances<'lua, T: bevy_mod_scripting_lua::tealr::mlu::InstanceCollector<'lua>>( + self, + instances: &mut T, + ) -> bevy_mod_scripting_lua::tealr::mlu::mlua::Result<()> { + instances.add_instance( + "world", + crate::lua::util::DummyTypeName::::new, + )?; + instances.add_instance( + "script", + crate::lua::util::DummyTypeName::::new, + )?; + instances.add_instance( + "entity", + crate::lua::util::DummyTypeName::::new, + )?; + Ok(()) + } +} + +impl bevy_mod_scripting_core::hosts::APIProvider for CoreBevyAPIProvider { + type APITarget = std::sync::Mutex; + type ScriptContext = std::sync::Mutex; + type DocTarget = bevy_mod_scripting_lua::docs::LuaDocFragment; + + fn attach_api( + &mut self, + ctx: &mut Self::APITarget, + ) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { + let ctx = ctx + .get_mut() + .expect("Unable to acquire lock on Lua context"); + bevy_mod_scripting_lua::tealr::mlu::set_global_env(CoreBevyGlobals, ctx) + .map_err(|e| bevy_mod_scripting_core::error::ScriptError::Other(e.to_string())) + } + + fn get_doc_fragment(&self) -> Option { + Some(bevy_mod_scripting_lua::docs::LuaDocFragment::new( + "CoreBevyAPI", + |tw| { + tw + .document_global_instance::().expect("Something went wrong documenting globals") + .process_type::() + .process_type::>() + .process_type::() + .process_type::>() + .process_type::() + .process_type::>() + }, + )) + } + + fn setup_script( + &mut self, + script_data: &bevy_mod_scripting_core::hosts::ScriptData, + ctx: &mut Self::ScriptContext, + ) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { + let ctx = ctx.get_mut().expect("Could not get context"); + let globals = ctx.globals(); + globals + .set( + "entity", + crate::providers::bevy_ecs::LuaEntity::new(script_data.entity), + ) + .map_err(bevy_mod_scripting_core::error::ScriptError::new_other)?; + globals + .set::<_, crate::lua::bevy::LuaScriptData>("script", script_data.into()) + .map_err(bevy_mod_scripting_core::error::ScriptError::new_other)?; + + Ok(()) + } + + fn setup_script_runtime( + &mut self, + world_ptr: bevy_mod_scripting_core::world::WorldPointer, + _script_data: &bevy_mod_scripting_core::hosts::ScriptData, + ctx: &mut Self::ScriptContext, + ) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { + let ctx = ctx.get_mut().expect("Could not get context"); + let globals = ctx.globals(); + globals + .set("world", crate::lua::bevy::LuaWorld::new(world_ptr)) + .map_err(bevy_mod_scripting_core::error::ScriptError::new_other) + } + + fn register_with_app(&self, app: &mut bevy::app::App) { + app.register_foreign_lua_type::(); + app.register_foreign_lua_type::(); + app.register_foreign_lua_type::(); + app.register_foreign_lua_type::(); + app.register_foreign_lua_type::(); + app.register_foreign_lua_type::(); + app.register_foreign_lua_type::(); + app.register_foreign_lua_type::(); + app.register_foreign_lua_type::(); + app.register_foreign_lua_type::(); + app.register_foreign_lua_type::(); + app.register_foreign_lua_type::(); + app.register_foreign_lua_type::(); + app.register_foreign_lua_type::(); + app.register_foreign_lua_type::(); + app.register_foreign_lua_type::(); + } +} diff --git a/crates/bevy_script_api/src/lib.rs b/crates/bevy_script_api/src/lib.rs index 2ae36912..f50998ae 100644 --- a/crates/bevy_script_api/src/lib.rs +++ b/crates/bevy_script_api/src/lib.rs @@ -8,6 +8,7 @@ pub mod rhai; pub mod common; +pub(crate) mod core_providers; pub mod script_ref; pub mod sub_reflect; pub mod wrappers; @@ -17,6 +18,7 @@ pub use {script_ref::*, sub_reflect::*}; pub mod prelude { #[cfg(feature = "lua")] pub use crate::{ + core_providers::CoreBevyAPIProvider, lua::{std::LuaVec, FromLuaProxy, IntoLuaProxy, LuaProxyable, ReflectLuaProxyable}, providers::BevyAPIProvider, LuaProxy, diff --git a/crates/bevy_script_api/src/providers/bevy_core.rs b/crates/bevy_script_api/src/providers/bevy_core.rs index 0c3a2cec..9c94c529 100644 --- a/crates/bevy_script_api/src/providers/bevy_core.rs +++ b/crates/bevy_script_api/src/providers/bevy_core.rs @@ -63,11 +63,6 @@ pub struct Name{ } - - -crate::impl_tealr_generic!(pub(crate) struct T); - - #[derive(Default)] pub(crate) struct Globals; diff --git a/crates/bevy_script_api/src/providers/bevy_ecs.rs b/crates/bevy_script_api/src/providers/bevy_ecs.rs index 0c49299b..f8af842d 100644 --- a/crates/bevy_script_api/src/providers/bevy_ecs.rs +++ b/crates/bevy_script_api/src/providers/bevy_ecs.rs @@ -70,12 +70,6 @@ functions[r#" #[lua(kind = "Method")] fn index(self) -> usize; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" @@ -88,6 +82,12 @@ functions[r#" #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] fn eq(&self, #[proxy] other: &component::ComponentId) -> bool; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#] )] @@ -148,8 +148,8 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &component::Tick) -> bool; "#, r#" @@ -160,8 +160,8 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &component::Tick) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#] )] @@ -442,14 +442,14 @@ functions[r#" "#, 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 = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &entity::Entity) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "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; "#] )] @@ -468,11 +468,6 @@ pub struct Entity{ } - - -crate::impl_tealr_generic!(pub(crate) struct T); - - #[derive(Default)] pub(crate) struct Globals; @@ -483,12 +478,12 @@ impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { ) -> bevy_mod_scripting_lua::tealr::mlu::mlua::Result<()> { - instances.add_instance("LuaComponentId", + instances.add_instance("ComponentId", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaTick", + instances.add_instance("Tick", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; @@ -497,7 +492,7 @@ impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { - instances.add_instance("LuaEntity", + instances.add_instance("Entity", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; diff --git a/crates/bevy_script_api/src/providers/bevy_hierarchy.rs b/crates/bevy_script_api/src/providers/bevy_hierarchy.rs index 1052a4a9..adfffa18 100644 --- a/crates/bevy_script_api/src/providers/bevy_hierarchy.rs +++ b/crates/bevy_script_api/src/providers/bevy_hierarchy.rs @@ -1,15 +1,29 @@ #![allow(clippy::all, unused_imports, deprecated, dead_code)] // @generated by cargo bevy-api-gen generate, modify the templates not this file + + use super::bevy_ecs::*; + + use super::bevy_reflect::*; + + use super::bevy_core::*; + + + extern crate self as bevy_script_api; use crate::lua::RegisterForeignLuaType; + + + + + /// Contains references to the child entities of this entity. /// Each child must contain a [`Parent`] component that points back to this entity. @@ -30,6 +44,7 @@ use crate::lua::RegisterForeignLuaType; /// [`BuildChildren::with_children`]: crate::child_builder::BuildChildren::with_children + #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(debug,), @@ -43,8 +58,17 @@ functions[r#" "#] )] -pub struct Children(); + +pub struct Children( + + + + + +); + + /// Holds a reference to the parent entity of this entity. /// This component should only be present on entities that actually have a parent entity. @@ -65,6 +89,7 @@ pub struct Children(); /// [`BuildChildren::with_children`]: crate::child_builder::BuildChildren::with_children + #[derive(bevy_mod_scripting_lua_derive::LuaProxy)] #[proxy( derive(debug,), @@ -78,21 +103,28 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &components::parent::Parent) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &components::parent::Parent) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#] )] -pub struct Parent(); -crate::impl_tealr_generic!(pub(crate) struct T); + +pub struct Parent( + + + + + +); + #[derive(Default)] pub(crate) struct Globals; @@ -102,6 +134,11 @@ impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { self, instances: &mut T, ) -> bevy_mod_scripting_lua::tealr::mlu::mlua::Result<()> { + + + + + Ok(()) } } @@ -109,14 +146,11 @@ impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { pub struct BevyHierarchyAPIProvider; impl bevy_mod_scripting_core::hosts::APIProvider for BevyHierarchyAPIProvider { - type APITarget = std::sync::Mutex; - type ScriptContext = std::sync::Mutex; - type DocTarget = bevy_mod_scripting_lua::docs::LuaDocFragment; + type APITarget = std::sync::Mutex; + type ScriptContext = std::sync::Mutex; + type DocTarget = bevy_mod_scripting_lua::docs::LuaDocFragment; - fn attach_api( - &mut self, - ctx: &mut Self::APITarget, - ) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { + fn attach_api(&mut self, ctx: &mut Self::APITarget) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { let ctx = ctx .get_mut() .expect("Unable to acquire lock on Lua context"); @@ -125,14 +159,17 @@ impl bevy_mod_scripting_core::hosts::APIProvider for BevyHierarchyAPIProvider { } fn get_doc_fragment(&self) -> Option { - Some(bevy_mod_scripting_lua::docs::LuaDocFragment::new( - "BevyHierarchyAPI", - |tw| { - tw.document_global_instance::() - .expect("Something went wrong documenting globals") - .process_type::() - .process_type::() - }, + Some(bevy_mod_scripting_lua::docs::LuaDocFragment::new("BevyHierarchyAPI", |tw| { + tw + .document_global_instance::().expect("Something went wrong documenting globals") + + .process_type::() + + + .process_type::() + + + } )) } @@ -154,8 +191,10 @@ impl bevy_mod_scripting_core::hosts::APIProvider for BevyHierarchyAPIProvider { } fn register_with_app(&self, app: &mut bevy::app::App) { + app.register_foreign_lua_type::(); - + app.register_foreign_lua_type::(); + } -} +} \ No newline at end of file diff --git a/crates/bevy_script_api/src/providers/bevy_input.rs b/crates/bevy_script_api/src/providers/bevy_input.rs index 71c20c57..fe9c7878 100644 --- a/crates/bevy_script_api/src/providers/bevy_input.rs +++ b/crates/bevy_script_api/src/providers/bevy_input.rs @@ -48,8 +48,8 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::Gamepad; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &gamepad::Gamepad) -> bool; "#, r#" @@ -60,8 +60,8 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &gamepad::Gamepad) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::Gamepad; "#] )] @@ -85,12 +85,6 @@ derive(clone,debug,), remote="bevy::input::gamepad::GamepadInfo", functions[r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &gamepad::GamepadInfo) -> bool; - -"#, - r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::input::gamepad::GamepadInfo; @@ -100,6 +94,12 @@ functions[r#" #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &gamepad::GamepadInfo) -> bool; + "#] )] @@ -138,14 +138,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &gamepad::GamepadButtonType) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &gamepad::GamepadButtonType) -> bool; "#] )] @@ -235,20 +235,20 @@ derive(clone,debug,), remote="bevy::input::gamepad::GamepadButtonInput", functions[r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &gamepad::GamepadButtonInput) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::GamepadButtonInput; "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &gamepad::GamepadButtonInput) -> bool; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::GamepadButtonInput; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#] )] @@ -280,8 +280,8 @@ derive(clone,debug,), remote="bevy::input::gamepad::GamepadAxisType", functions[r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &gamepad::GamepadAxisType) -> bool; "#, r#" @@ -292,8 +292,8 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &gamepad::GamepadAxisType) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#] )] @@ -343,12 +343,6 @@ functions[r#" axis_type: bevy::input::gamepad::GamepadAxisType, ) -> bevy::input::gamepad::GamepadAxis; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &gamepad::GamepadAxis) -> bool; - "#, r#" @@ -361,6 +355,12 @@ functions[r#" #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &gamepad::GamepadAxis) -> bool; + "#] )] @@ -624,14 +624,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &gamepad::AxisSettings) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::AxisSettings; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::AxisSettings; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &gamepad::AxisSettings) -> bool; "#] )] @@ -778,14 +778,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &gamepad::GamepadConnectionEvent) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::GamepadConnectionEvent; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::GamepadConnectionEvent; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &gamepad::GamepadConnectionEvent) -> bool; "#] )] @@ -824,14 +824,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &gamepad::GamepadAxisChangedEvent) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::GamepadAxisChangedEvent; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::GamepadAxisChangedEvent; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &gamepad::GamepadAxisChangedEvent) -> bool; "#] )] @@ -907,14 +907,14 @@ derive(clone,debug,), remote="bevy::input::gamepad::GamepadEvent", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::gamepad::GamepadEvent; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &gamepad::GamepadEvent) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &gamepad::GamepadEvent) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::gamepad::GamepadEvent; "#] )] @@ -946,8 +946,8 @@ derive(clone,debug,), remote="bevy::input::keyboard::KeyboardInput", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::keyboard::KeyboardInput; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &keyboard::KeyboardInput) -> bool; "#, r#" @@ -958,8 +958,8 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &keyboard::KeyboardInput) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::keyboard::KeyboardInput; "#] )] @@ -997,14 +997,14 @@ derive(clone,debug,), remote="bevy::input::keyboard::NativeKeyCode", functions[r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &keyboard::NativeKeyCode) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &keyboard::NativeKeyCode) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -1054,14 +1054,14 @@ derive(clone,debug,), remote="bevy::input::keyboard::KeyCode", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::keyboard::KeyCode; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &keyboard::KeyCode) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &keyboard::KeyCode) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::keyboard::KeyCode; "#, r#" @@ -1103,14 +1103,14 @@ derive(clone,debug,), remote="bevy::input::keyboard::NativeKey", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::keyboard::NativeKey; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &keyboard::NativeKey) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &keyboard::NativeKey) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::keyboard::NativeKey; "#, r#" @@ -1148,14 +1148,14 @@ functions[r#" "#, 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::input::keyboard::Key; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::keyboard::Key; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#] )] @@ -1185,14 +1185,14 @@ derive(clone,debug,), remote="bevy::input::mouse::MouseButtonInput", functions[r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &mouse::MouseButtonInput) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::mouse::MouseButtonInput; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::mouse::MouseButtonInput; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &mouse::MouseButtonInput) -> bool; "#, r#" @@ -1232,20 +1232,20 @@ derive(clone,debug,), remote="bevy::input::mouse::MouseButton", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::mouse::MouseButton; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &mouse::MouseButton) -> bool; "#, 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::input::mouse::MouseButton; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &mouse::MouseButton) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#] )] @@ -1314,20 +1314,20 @@ derive(clone,debug,), remote="bevy::input::mouse::MouseScrollUnit", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::mouse::MouseScrollUnit; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &mouse::MouseScrollUnit) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::mouse::MouseScrollUnit; "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &mouse::MouseScrollUnit) -> bool; "#] )] @@ -1412,14 +1412,14 @@ derive(clone,debug,), remote="bevy::input::touch::TouchInput", functions[r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &touch::TouchInput) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::touch::TouchInput; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::touch::TouchInput; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &touch::TouchInput) -> bool; "#] )] @@ -1443,14 +1443,14 @@ derive(clone,debug,), remote="bevy::input::touch::ForceTouch", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::touch::ForceTouch; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &touch::ForceTouch) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &touch::ForceTouch) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::touch::ForceTouch; "#] )] @@ -1482,8 +1482,8 @@ derive(clone,debug,), remote="bevy::input::touch::TouchPhase", 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::input::touch::TouchPhase; "#, r#" @@ -1494,8 +1494,8 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::touch::TouchPhase; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#] )] @@ -1525,14 +1525,14 @@ derive(clone,debug,), remote="bevy::input::touchpad::TouchpadMagnify", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::touchpad::TouchpadMagnify; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &touchpad::TouchpadMagnify) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &touchpad::TouchpadMagnify) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::touchpad::TouchpadMagnify; "#] )] @@ -1563,14 +1563,14 @@ derive(clone,debug,), remote="bevy::input::touchpad::TouchpadRotate", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::input::touchpad::TouchpadRotate; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &touchpad::TouchpadRotate) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &touchpad::TouchpadRotate) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::input::touchpad::TouchpadRotate; "#] )] @@ -1626,11 +1626,6 @@ pub struct ButtonState{ } - - -crate::impl_tealr_generic!(pub(crate) struct T); - - #[derive(Default)] pub(crate) struct Globals; @@ -1641,7 +1636,7 @@ impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { ) -> bevy_mod_scripting_lua::tealr::mlu::mlua::Result<()> { - instances.add_instance("LuaGamepad", + instances.add_instance("Gamepad", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; @@ -1650,7 +1645,7 @@ impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { - instances.add_instance("LuaGamepadButton", + instances.add_instance("GamepadButton", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; @@ -1659,7 +1654,7 @@ impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { - instances.add_instance("LuaGamepadAxis", + instances.add_instance("GamepadAxis", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; @@ -1674,17 +1669,17 @@ impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { - instances.add_instance("LuaGamepadConnectionEvent", + instances.add_instance("GamepadConnectionEvent", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaGamepadAxisChangedEvent", + instances.add_instance("GamepadAxisChangedEvent", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaGamepadButtonChangedEvent", + instances.add_instance("GamepadButtonChangedEvent", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; diff --git a/crates/bevy_script_api/src/providers/bevy_reflect.rs b/crates/bevy_script_api/src/providers/bevy_reflect.rs index ab47effd..6ef9ded5 100644 --- a/crates/bevy_script_api/src/providers/bevy_reflect.rs +++ b/crates/bevy_script_api/src/providers/bevy_reflect.rs @@ -597,12 +597,6 @@ functions[r#" #[lua(kind = "Function")] fn encode_buffer() -> [u8; 45]; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &bevy_utils::Uuid) -> bool; - "#, r#" @@ -619,6 +613,12 @@ functions[r#" #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &bevy_utils::Uuid) -> bool; + "#] )] @@ -651,6 +651,12 @@ functions[r#" value: bevy::math::Vec2, ) -> bevy::math::primitives::Direction2d; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &bevy_math::primitives::Direction2d) -> bool; + "#, r#" @@ -663,12 +669,6 @@ functions[r#" )] fn neg(self) -> bevy::math::primitives::Direction2d; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &bevy_math::primitives::Direction2d) -> bool; - "#, r#" @@ -808,12 +808,6 @@ functions[r#" #[lua(kind = "Method")] fn area(&self) -> f32; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &bevy_math::primitives::Ellipse) -> bool; - "#, r#" @@ -824,6 +818,12 @@ functions[r#" )] fn clone(&self) -> bevy::math::primitives::Ellipse; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &bevy_math::primitives::Ellipse) -> bool; + "#] )] @@ -854,6 +854,12 @@ functions[r#" #[lua(kind = "Function", output(proxy))] fn new(#[proxy] normal: bevy::math::Vec2) -> bevy::math::primitives::Plane2d; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &bevy_math::primitives::Plane2d) -> bool; + "#, r#" @@ -864,12 +870,6 @@ functions[r#" )] fn clone(&self) -> bevy::math::primitives::Plane2d; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &bevy_math::primitives::Plane2d) -> bool; - "#] )] @@ -894,12 +894,6 @@ derive(clone,debug,), remote="bevy::math::primitives::Line2d", functions[r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &bevy_math::primitives::Line2d) -> bool; - -"#, - r#" - #[lua( as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", kind = "Method", @@ -907,6 +901,12 @@ functions[r#" )] fn clone(&self) -> bevy::math::primitives::Line2d; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &bevy_math::primitives::Line2d) -> bool; + "#] )] @@ -951,6 +951,12 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn point2(&self) -> bevy::math::Vec2; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &bevy_math::primitives::Segment2d) -> bool; + "#, r#" @@ -961,12 +967,6 @@ functions[r#" )] fn clone(&self) -> bevy::math::primitives::Segment2d; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &bevy_math::primitives::Segment2d) -> bool; - "#] )] @@ -1022,6 +1022,12 @@ functions[r#" #[lua(kind = "MutatingMethod")] fn reverse(&mut self) -> (); +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &bevy_math::primitives::Triangle2d) -> bool; + "#, r#" @@ -1032,12 +1038,6 @@ functions[r#" )] fn clone(&self) -> bevy::math::primitives::Triangle2d; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &bevy_math::primitives::Triangle2d) -> bool; - "#] )] @@ -1233,6 +1233,12 @@ functions[r#" #[lua(kind = "Method")] fn external_angle_radians(&self) -> f32; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &bevy_math::primitives::RegularPolygon) -> bool; + "#, r#" @@ -1243,12 +1249,6 @@ functions[r#" )] fn clone(&self) -> bevy::math::primitives::RegularPolygon; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &bevy_math::primitives::RegularPolygon) -> bool; - "#] )] @@ -1277,12 +1277,6 @@ functions[r#" #[lua(kind = "Function", output(proxy))] fn new(radius: f32, length: f32) -> bevy::math::primitives::Capsule2d; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &bevy_math::primitives::Capsule2d) -> bool; - "#, r#" @@ -1293,6 +1287,12 @@ functions[r#" )] fn clone(&self) -> bevy::math::primitives::Capsule2d; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &bevy_math::primitives::Capsule2d) -> bool; + "#] )] @@ -1328,23 +1328,17 @@ functions[r#" r#" #[lua( - as_trait = "std::ops::Neg", - kind = "Function", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "neg", - metamethod = "Unm", )] - fn neg(self) -> bevy::math::primitives::Direction3d; + fn clone(&self) -> bevy::math::primitives::Direction3d; "#, r#" - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::primitives::Direction3d; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &bevy_math::primitives::Direction3d) -> bool; "#, r#" @@ -1361,8 +1355,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &bevy_math::primitives::Direction3d) -> bool; + #[lua( + as_trait = "std::ops::Neg", + kind = "Function", + output(proxy), + composite = "neg", + metamethod = "Unm", + )] + fn neg(self) -> bevy::math::primitives::Direction3d; "#] )] @@ -1507,12 +1507,6 @@ derive(clone,debug,), remote="bevy::math::primitives::Line3d", functions[r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &bevy_math::primitives::Line3d) -> bool; - -"#, - r#" - #[lua( as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", kind = "Method", @@ -1520,6 +1514,12 @@ functions[r#" )] fn clone(&self) -> bevy::math::primitives::Line3d; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &bevy_math::primitives::Line3d) -> bool; + "#] )] @@ -1659,12 +1659,6 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn closest_point(&self, #[proxy] point: bevy::math::Vec3) -> bevy::math::Vec3; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &bevy_math::primitives::Cuboid) -> bool; - "#, r#" @@ -1675,6 +1669,12 @@ functions[r#" )] fn clone(&self) -> bevy::math::primitives::Cuboid; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &bevy_math::primitives::Cuboid) -> bool; + "#] )] @@ -2313,6 +2313,12 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn as_urect(&self) -> bevy::math::URect; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" @@ -2323,12 +2329,6 @@ functions[r#" )] fn clone(&self) -> bevy::math::IRect; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" @@ -2646,6 +2646,12 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn as_urect(&self) -> bevy::math::URect; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &bevy_math::Rect) -> bool; + "#, r#" @@ -2656,12 +2662,6 @@ functions[r#" )] fn clone(&self) -> bevy::math::Rect; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &bevy_math::Rect) -> bool; - "#] )] @@ -2960,6 +2960,12 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn as_irect(&self) -> bevy::math::IRect; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &bevy_math::URect) -> bool; + "#, r#" @@ -2976,12 +2982,6 @@ functions[r#" )] fn clone(&self) -> bevy::math::URect; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &bevy_math::URect) -> bool; - "#] )] @@ -3441,14 +3441,12 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &bevy_utils::Instant) -> bool; + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::utils::Instant; "#, r#" @@ -3468,12 +3466,14 @@ functions[r#" "#, r#" - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::utils::Instant; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &bevy_utils::Instant) -> bool; "#] )] @@ -3507,6 +3507,12 @@ functions[r#" #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &glam::EulerRot) -> bool; + "#, r#" @@ -3517,12 +3523,6 @@ functions[r#" )] fn clone(&self) -> bevy::math::EulerRot; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &glam::EulerRot) -> bool; - "#] )] @@ -3599,12 +3599,6 @@ functions[r#" #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] fn eq(&self, #[proxy] other: &glam::BVec2) -> bool; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" @@ -3615,6 +3609,12 @@ functions[r#" )] fn clone(&self) -> bevy::math::BVec2; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#] )] @@ -3690,8 +3690,8 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &glam::BVec3) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -3706,8 +3706,8 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &glam::BVec3) -> bool; "#] )] @@ -3784,14 +3784,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &glam::BVec4) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &glam::BVec4) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -3877,12 +3877,6 @@ functions[r#" #[lua(kind = "MutatingMethod")] fn set(&mut self, index: usize, value: bool) -> (); -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] rhs: &glam::BVec3A) -> bool; - "#, r#" @@ -3893,6 +3887,12 @@ functions[r#" )] fn clone(&self) -> bevy::math::BVec3A; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] rhs: &glam::BVec3A) -> bool; + "#] )] @@ -3968,12 +3968,6 @@ functions[r#" #[lua(kind = "MutatingMethod")] fn set(&mut self, index: usize, value: bool) -> (); -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] rhs: &glam::BVec4A) -> bool; - "#, r#" @@ -3984,6 +3978,12 @@ functions[r#" )] fn clone(&self) -> bevy::math::BVec4A; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] rhs: &glam::BVec4A) -> bool; + "#] )] @@ -4174,12 +4174,6 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn inverse(&self) -> bevy::math::Affine2; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] rhs: &glam::Affine2) -> bool; - "#, r#" @@ -4190,6 +4184,12 @@ functions[r#" )] fn clone(&self) -> bevy::math::Affine2; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] rhs: &glam::Affine2) -> bool; + "#] )] @@ -4862,18 +4862,6 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn as_dmat3(&self) -> bevy::math::DMat3; -"#, - r#" - - #[lua( - as_trait = "std::ops::Sub", - kind = "Function", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: bevy::math::Mat3) -> bevy::math::Mat3; - "#, r#" @@ -4902,11 +4890,13 @@ functions[r#" r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Sub", + kind = "Function", output(proxy), + composite = "sub", + metamethod = "Sub", )] - fn clone(&self) -> bevy::math::Mat3; + fn sub(self, #[proxy] rhs: bevy::math::Mat3) -> bevy::math::Mat3; "#, r#" @@ -4914,6 +4904,16 @@ functions[r#" #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] fn eq(&self, #[proxy] rhs: &glam::Mat3) -> bool; +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::Mat3; + "#] )] @@ -5500,6 +5500,16 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn as_u64vec2(&self) -> bevy::math::U64Vec2; +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::Vec2; + "#, r#" @@ -5520,14 +5530,10 @@ functions[r#" "#, r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::Vec2; - +#[lua(kind="Method", raw , metamethod="Index")] +fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { + Ok(self.inner()?[*idx]) +} "#] )] @@ -6107,16 +6113,6 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn as_u64vec3(&self) -> bevy::math::U64Vec3; -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::Vec3; - "#, r#" @@ -6135,6 +6131,22 @@ functions[r#" )] fn neg(self) -> bevy::math::Vec3; +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::Vec3; + +"#, + r#" +#[lua(kind="Method", raw , metamethod="Index")] +fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { + Ok(self.inner()?[*idx]) +} "#] )] @@ -6340,30 +6352,18 @@ functions[r#" "#, r#" - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::Mat2; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] rhs: &glam::Mat2) -> bool; "#, r#" #[lua( - as_trait = "std::ops::Sub", - kind = "Function", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "sub", - metamethod = "Sub", )] - fn sub(self, #[proxy] rhs: bevy::math::Mat2) -> bevy::math::Mat2; - -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] rhs: &glam::Mat2) -> bool; + fn clone(&self) -> bevy::math::Mat2; "#, r#" @@ -6389,6 +6389,18 @@ functions[r#" )] fn add(self, #[proxy] rhs: bevy::math::Mat2) -> bevy::math::Mat2; +"#, + r#" + + #[lua( + as_trait = "std::ops::Sub", + kind = "Function", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: bevy::math::Mat2) -> bevy::math::Mat2; + "#] )] @@ -6741,8 +6753,12 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] rhs: &glam::Mat3A) -> bool; + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::Mat3A; "#, r#" @@ -6760,11 +6776,13 @@ functions[r#" r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Sub", + kind = "Function", output(proxy), + composite = "sub", + metamethod = "Sub", )] - fn clone(&self) -> bevy::math::Mat3A; + fn sub(self, #[proxy] rhs: bevy::math::Mat3A) -> bevy::math::Mat3A; "#, r#" @@ -6781,14 +6799,8 @@ functions[r#" "#, r#" - #[lua( - as_trait = "std::ops::Sub", - kind = "Function", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: bevy::math::Mat3A) -> bevy::math::Mat3A; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] rhs: &glam::Mat3A) -> bool; "#] )] @@ -7406,18 +7418,6 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn as_dmat4(&self) -> bevy::math::DMat4; -"#, - r#" - - #[lua( - as_trait = "std::ops::Add", - kind = "Function", - output(proxy), - composite = "add", - metamethod = "Add", - )] - fn add(self, #[proxy] rhs: bevy::math::Mat4) -> bevy::math::Mat4; - "#, r#" @@ -7446,6 +7446,18 @@ functions[r#" #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] fn eq(&self, #[proxy] rhs: &glam::Mat4) -> bool; +"#, + r#" + + #[lua( + as_trait = "std::ops::Add", + kind = "Function", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: bevy::math::Mat4) -> bevy::math::Mat4; + "#, r#" @@ -7864,65 +7876,65 @@ functions[r#" "#, r#" -/// Divides a quaternion by a scalar value. -/// The quotient is not guaranteed to be normalized. #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Neg", kind = "Function", output(proxy), - composite = "div", - metamethod = "Div", + composite = "neg", + metamethod = "Unm", )] - fn div(self, rhs: f32) -> bevy::math::Quat; + fn neg(self) -> bevy::math::Quat; "#, r#" -/// Subtracts the `rhs` quaternion from `self`. -/// The difference is not guaranteed to be normalized. +/// Adds two quaternions. +/// The sum is not guaranteed to be normalized. +/// Note that addition is not the same as combining the rotations represented by the +/// two quaternions! That corresponds to multiplication. #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Add", kind = "Function", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "add", + metamethod = "Add", )] - fn sub(self, #[proxy] rhs: bevy::math::Quat) -> bevy::math::Quat; - -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] rhs: &glam::Quat) -> bool; + fn add(self, #[proxy] rhs: bevy::math::Quat) -> bevy::math::Quat; "#, r#" +/// Divides a quaternion by a scalar value. +/// The quotient is not guaranteed to be normalized. #[lua( - as_trait = "std::ops::Neg", + as_trait = "std::ops::Div", kind = "Function", output(proxy), - composite = "neg", - metamethod = "Unm", + composite = "div", + metamethod = "Div", )] - fn neg(self) -> bevy::math::Quat; + fn div(self, rhs: f32) -> bevy::math::Quat; "#, r#" -/// Adds two quaternions. -/// The sum is not guaranteed to be normalized. -/// Note that addition is not the same as combining the rotations represented by the -/// two quaternions! That corresponds to multiplication. + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] rhs: &glam::Quat) -> bool; + +"#, + r#" +/// Subtracts the `rhs` quaternion from `self`. +/// The difference is not guaranteed to be normalized. #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Sub", kind = "Function", output(proxy), - composite = "add", - metamethod = "Add", + composite = "sub", + metamethod = "Sub", )] - fn add(self, #[proxy] rhs: bevy::math::Quat) -> bevy::math::Quat; + fn sub(self, #[proxy] rhs: bevy::math::Quat) -> bevy::math::Quat; "#, r#" @@ -8560,6 +8572,12 @@ functions[r#" )] fn clone(&self) -> bevy::math::Vec3A; +"#, + r#" +#[lua(kind="Method", raw , metamethod="Index")] +fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { + Ok(self.inner()?[*idx]) +} "#] )] @@ -9113,12 +9131,6 @@ functions[r#" )] fn clone(&self) -> bevy::math::Vec4; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] rhs: &glam::Vec4) -> bool; - "#, r#" @@ -9131,6 +9143,18 @@ functions[r#" )] fn neg(self) -> bevy::math::Vec4; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] rhs: &glam::Vec4) -> bool; + +"#, + r#" +#[lua(kind="Method", raw , metamethod="Index")] +fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { + Ok(self.inner()?[*idx]) +} "#] )] @@ -9620,12 +9644,6 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn inverse(&self) -> bevy::math::DAffine3; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] rhs: &glam::DAffine3) -> bool; - "#, r#" @@ -9636,6 +9654,12 @@ functions[r#" )] fn clone(&self) -> bevy::math::DAffine3; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] rhs: &glam::DAffine3) -> bool; + "#] )] @@ -9827,6 +9851,12 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn as_mat2(&self) -> bevy::math::Mat2; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] rhs: &glam::DMat2) -> bool; + "#, r#" @@ -9843,11 +9873,13 @@ functions[r#" r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Add", + kind = "Function", output(proxy), + composite = "add", + metamethod = "Add", )] - fn clone(&self) -> bevy::math::DMat2; + fn add(self, #[proxy] rhs: bevy::math::DMat2) -> bevy::math::DMat2; "#, r#" @@ -9865,19 +9897,11 @@ functions[r#" r#" #[lua( - as_trait = "std::ops::Add", - kind = "Function", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "add", - metamethod = "Add", )] - fn add(self, #[proxy] rhs: bevy::math::DMat2) -> bevy::math::DMat2; - -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] rhs: &glam::DMat2) -> bool; + fn clone(&self) -> bevy::math::DMat2; "#] )] @@ -10228,13 +10252,11 @@ functions[r#" r#" #[lua( - as_trait = "std::ops::Neg", - kind = "Function", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "neg", - metamethod = "Unm", )] - fn neg(self) -> bevy::math::DMat3; + fn clone(&self) -> bevy::math::DMat3; "#, r#" @@ -10251,30 +10273,32 @@ functions[r#" "#, r#" - #[lua( - as_trait = "std::ops::Sub", - kind = "Function", - output(proxy), - composite = "sub", - metamethod = "Sub", - )] - fn sub(self, #[proxy] rhs: bevy::math::DMat3) -> bevy::math::DMat3; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] rhs: &glam::DMat3) -> bool; "#, r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Neg", + kind = "Function", output(proxy), + composite = "neg", + metamethod = "Unm", )] - fn clone(&self) -> bevy::math::DMat3; + fn neg(self) -> bevy::math::DMat3; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] rhs: &glam::DMat3) -> bool; + #[lua( + as_trait = "std::ops::Sub", + kind = "Function", + output(proxy), + composite = "sub", + metamethod = "Sub", + )] + fn sub(self, #[proxy] rhs: bevy::math::DMat3) -> bevy::math::DMat3; "#] )] @@ -10886,13 +10910,13 @@ functions[r#" r#" #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Neg", kind = "Function", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "neg", + metamethod = "Unm", )] - fn sub(self, #[proxy] rhs: bevy::math::DMat4) -> bevy::math::DMat4; + fn neg(self) -> bevy::math::DMat4; "#, r#" @@ -10904,13 +10928,13 @@ functions[r#" r#" #[lua( - as_trait = "std::ops::Neg", + as_trait = "std::ops::Sub", kind = "Function", output(proxy), - composite = "neg", - metamethod = "Unm", + composite = "sub", + metamethod = "Sub", )] - fn neg(self) -> bevy::math::DMat4; + fn sub(self, #[proxy] rhs: bevy::math::DMat4) -> bevy::math::DMat4; "#, r#" @@ -11314,37 +11338,47 @@ functions[r#" "#, r#" +/// Adds two quaternions. +/// The sum is not guaranteed to be normalized. +/// Note that addition is not the same as combining the rotations represented by the +/// two quaternions! That corresponds to multiplication. - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] rhs: &glam::DQuat) -> bool; + #[lua( + as_trait = "std::ops::Add", + kind = "Function", + output(proxy), + composite = "add", + metamethod = "Add", + )] + fn add(self, #[proxy] rhs: bevy::math::DQuat) -> bevy::math::DQuat; "#, r#" +/// Divides a quaternion by a scalar value. +/// The quotient is not guaranteed to be normalized. #[lua( - as_trait = "std::ops::Neg", + as_trait = "std::ops::Div", kind = "Function", output(proxy), - composite = "neg", - metamethod = "Unm", + composite = "div", + metamethod = "Div", )] - fn neg(self) -> bevy::math::DQuat; + fn div(self, rhs: f64) -> bevy::math::DQuat; "#, r#" -/// Adds two quaternions. -/// The sum is not guaranteed to be normalized. -/// Note that addition is not the same as combining the rotations represented by the -/// two quaternions! That corresponds to multiplication. +/// Subtracts the `rhs` quaternion from `self`. +/// The difference is not guaranteed to be normalized. #[lua( - as_trait = "std::ops::Add", + as_trait = "std::ops::Sub", kind = "Function", output(proxy), - composite = "add", - metamethod = "Add", + composite = "sub", + metamethod = "Sub", )] - fn add(self, #[proxy] rhs: bevy::math::DQuat) -> bevy::math::DQuat; + fn sub(self, #[proxy] rhs: bevy::math::DQuat) -> bevy::math::DQuat; "#, r#" @@ -11358,31 +11392,21 @@ functions[r#" "#, r#" -/// Divides a quaternion by a scalar value. -/// The quotient is not guaranteed to be normalized. - #[lua( - as_trait = "std::ops::Div", - kind = "Function", - output(proxy), - composite = "div", - metamethod = "Div", - )] - fn div(self, rhs: f64) -> bevy::math::DQuat; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] rhs: &glam::DQuat) -> bool; "#, r#" -/// Subtracts the `rhs` quaternion from `self`. -/// The difference is not guaranteed to be normalized. #[lua( - as_trait = "std::ops::Sub", + as_trait = "std::ops::Neg", kind = "Function", output(proxy), - composite = "sub", - metamethod = "Sub", + composite = "neg", + metamethod = "Unm", )] - fn sub(self, #[proxy] rhs: bevy::math::DQuat) -> bevy::math::DQuat; + fn neg(self) -> bevy::math::DQuat; "#] )] @@ -11982,13 +12006,11 @@ functions[r#" r#" #[lua( - as_trait = "std::ops::Neg", - kind = "Function", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "neg", - metamethod = "Unm", )] - fn neg(self) -> bevy::math::DVec2; + fn clone(&self) -> bevy::math::DVec2; "#, r#" @@ -12000,12 +12022,20 @@ functions[r#" r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Neg", + kind = "Function", output(proxy), + composite = "neg", + metamethod = "Unm", )] - fn clone(&self) -> bevy::math::DVec2; + fn neg(self) -> bevy::math::DVec2; +"#, + r#" +#[lua(kind="Method", raw , metamethod="Index")] +fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { + Ok(self.inner()?[*idx]) +} "#] )] @@ -12600,6 +12630,12 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn as_u64vec3(&self) -> bevy::math::U64Vec3; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &glam::DVec3) -> bool; + "#, r#" @@ -12624,10 +12660,10 @@ functions[r#" "#, r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &glam::DVec3) -> bool; - +#[lua(kind="Method", raw , metamethod="Index")] +fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { + Ok(self.inner()?[*idx]) +} "#] )] @@ -13173,18 +13209,6 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn as_u64vec4(&self) -> bevy::math::U64Vec4; -"#, - r#" - - #[lua( - as_trait = "std::ops::Neg", - kind = "Function", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> bevy::math::DVec4; - "#, r#" @@ -13201,6 +13225,24 @@ functions[r#" )] fn clone(&self) -> bevy::math::DVec4; +"#, + r#" + + #[lua( + as_trait = "std::ops::Neg", + kind = "Function", + output(proxy), + composite = "neg", + metamethod = "Unm", + )] + fn neg(self) -> bevy::math::DVec4; + +"#, + r#" +#[lua(kind="Method", raw , metamethod="Index")] +fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { + Ok(self.inner()?[*idx]) +} "#] )] @@ -13582,12 +13624,6 @@ functions[r#" #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] fn eq(&self, #[proxy] other: &glam::IVec2) -> bool; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" @@ -13610,6 +13646,18 @@ functions[r#" )] fn clone(&self) -> bevy::math::IVec2; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + +"#, + r#" +#[lua(kind="Method", raw , metamethod="Index")] +fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { + Ok(self.inner()?[*idx]) +} "#] )] @@ -13987,13 +14035,11 @@ functions[r#" r#" #[lua( - as_trait = "std::ops::Neg", - kind = "Function", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "neg", - metamethod = "Unm", )] - fn neg(self) -> bevy::math::IVec3; + fn clone(&self) -> bevy::math::IVec3; "#, r#" @@ -14001,22 +14047,30 @@ functions[r#" #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] fn eq(&self, #[proxy] other: &glam::IVec3) -> bool; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Neg", + kind = "Function", output(proxy), + composite = "neg", + metamethod = "Unm", )] - fn clone(&self) -> bevy::math::IVec3; + fn neg(self) -> bevy::math::IVec3; "#, r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - +#[lua(kind="Method", raw , metamethod="Index")] +fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { + Ok(self.inner()?[*idx]) +} "#] )] @@ -14372,18 +14426,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &glam::IVec4) -> bool; "#, r#" - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::IVec4; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -14400,9 +14450,19 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &glam::IVec4) -> bool; + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::IVec4; +"#, + r#" +#[lua(kind="Method", raw , metamethod="Index")] +fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { + Ok(self.inner()?[*idx]) +} "#] )] @@ -14702,6 +14762,16 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn saturating_div(self, #[proxy] rhs: bevy::math::UVec2) -> bevy::math::UVec2; +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::UVec2; + "#, r#" @@ -14716,14 +14786,10 @@ functions[r#" "#, r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::UVec2; - +#[lua(kind="Method", raw , metamethod="Index")] +fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { + Ok(self.inner()?[*idx]) +} "#] )] @@ -15067,6 +15133,12 @@ functions[r#" #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] fn eq(&self, #[proxy] other: &glam::UVec3) -> bool; +"#, + r#" +#[lua(kind="Method", raw , metamethod="Index")] +fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { + Ok(self.inner()?[*idx]) +} "#] )] @@ -15370,8 +15442,12 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &glam::UVec4) -> bool; + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::UVec4; "#, r#" @@ -15382,13 +15458,15 @@ functions[r#" "#, r#" - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::UVec4; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &glam::UVec4) -> bool; +"#, + r#" +#[lua(kind="Method", raw , metamethod="Index")] +fn index(&self, lua: &Lua, idx: crate::lua::util::LuaIndex) -> Result { + Ok(self.inner()?[*idx]) +} "#] )] @@ -15767,14 +15845,8 @@ functions[r#" "#, r#" - #[lua( - as_trait = "std::ops::Neg", - kind = "Function", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> bevy::math::I64Vec2; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -15785,18 +15857,24 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::I64Vec2; "#, r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Neg", + kind = "Function", output(proxy), + composite = "neg", + metamethod = "Unm", )] - fn clone(&self) -> bevy::math::I64Vec2; + fn neg(self) -> bevy::math::I64Vec2; "#] )] @@ -16177,6 +16255,16 @@ functions[r#" #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] fn eq(&self, #[proxy] other: &glam::I64Vec3) -> bool; +"#, + r#" + + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::I64Vec3; + "#, r#" @@ -16195,16 +16283,6 @@ functions[r#" )] fn neg(self) -> bevy::math::I64Vec3; -"#, - r#" - - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::I64Vec3; - "#] )] @@ -16570,14 +16648,8 @@ functions[r#" "#, r#" - #[lua( - as_trait = "std::ops::Neg", - kind = "Function", - output(proxy), - composite = "neg", - metamethod = "Unm", - )] - fn neg(self) -> bevy::math::I64Vec4; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -16588,8 +16660,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua( + as_trait = "std::ops::Neg", + kind = "Function", + output(proxy), + composite = "neg", + metamethod = "Unm", + )] + fn neg(self) -> bevy::math::I64Vec4; "#] )] @@ -17236,12 +17314,8 @@ functions[r#" "#, r#" - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> bevy::math::U64Vec3; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -17252,8 +17326,12 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> bevy::math::U64Vec3; "#] )] @@ -17555,6 +17633,12 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn saturating_div(self, #[proxy] rhs: bevy::math::U64Vec4) -> bevy::math::U64Vec4; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" @@ -17571,12 +17655,6 @@ functions[r#" )] fn clone(&self) -> bevy::math::U64Vec4; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#] )] @@ -17806,12 +17884,6 @@ functions[r#" #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &std::num::NonZeroU8) -> bool; - "#, r#" @@ -17822,6 +17894,12 @@ functions[r#" )] fn clone(&self) -> std::num::NonZeroU8; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &std::num::NonZeroU8) -> bool; + "#] )] @@ -18050,12 +18128,6 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn saturating_pow(self, other: u32) -> std::num::NonZeroU16; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &std::num::NonZeroU16) -> bool; - "#, r#" @@ -18072,6 +18144,12 @@ functions[r#" #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &std::num::NonZeroU16) -> bool; + "#] )] @@ -18300,12 +18378,6 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn saturating_pow(self, other: u32) -> std::num::NonZeroU32; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" @@ -18316,6 +18388,12 @@ functions[r#" )] fn clone(&self) -> std::num::NonZeroU32; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" @@ -18550,6 +18628,12 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn saturating_pow(self, other: u32) -> std::num::NonZeroU64; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &std::num::NonZeroU64) -> bool; + "#, r#" @@ -18566,12 +18650,6 @@ functions[r#" )] fn clone(&self) -> std::num::NonZeroU64; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &std::num::NonZeroU64) -> bool; - "#] )] @@ -18806,12 +18884,6 @@ functions[r#" #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] fn eq(&self, #[proxy] other: &std::num::NonZeroU128) -> bool; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" @@ -18822,6 +18894,12 @@ functions[r#" )] fn clone(&self) -> std::num::NonZeroU128; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#] )] @@ -19053,8 +19131,8 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &std::num::NonZeroUsize) -> bool; "#, r#" @@ -19069,8 +19147,8 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &std::num::NonZeroUsize) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#] )] @@ -19406,12 +19484,6 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn saturating_pow(self, other: u32) -> std::num::NonZeroI8; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &std::num::NonZeroI8) -> bool; - "#, r#" @@ -19430,6 +19502,12 @@ functions[r#" )] fn neg(self) -> std::num::NonZeroI8; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &std::num::NonZeroI8) -> bool; + "#, r#" @@ -19778,18 +19856,6 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn saturating_pow(self, other: u32) -> std::num::NonZeroI16; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &std::num::NonZeroI16) -> bool; - "#, r#" @@ -19812,6 +19878,18 @@ functions[r#" )] fn neg(self) -> std::num::NonZeroI16; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &std::num::NonZeroI16) -> bool; + "#] )] @@ -20162,12 +20240,6 @@ functions[r#" )] fn neg(self) -> std::num::NonZeroI32; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" @@ -20178,6 +20250,12 @@ functions[r#" )] fn clone(&self) -> std::num::NonZeroI32; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" @@ -20522,12 +20600,6 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn saturating_pow(self, other: u32) -> std::num::NonZeroI64; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" @@ -20550,6 +20622,12 @@ functions[r#" )] fn neg(self) -> std::num::NonZeroI64; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#, r#" @@ -20897,12 +20975,14 @@ functions[r#" "#, r#" - #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", - output(proxy), - )] - fn clone(&self) -> std::num::NonZeroI128; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &std::num::NonZeroI128) -> bool; "#, r#" @@ -20919,14 +20999,12 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &std::num::NonZeroI128) -> bool; - -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua( + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", + output(proxy), + )] + fn clone(&self) -> std::num::NonZeroI128; "#] )] @@ -21266,12 +21344,6 @@ functions[r#" #[lua(kind = "Method", output(proxy))] fn saturating_pow(self, other: u32) -> std::num::NonZeroIsize; -"#, - r#" - - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &std::num::NonZeroIsize) -> bool; - "#, r#" @@ -21284,12 +21356,6 @@ functions[r#" )] fn neg(self) -> std::num::NonZeroIsize; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" @@ -21300,6 +21366,18 @@ functions[r#" )] fn clone(&self) -> std::num::NonZeroIsize; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &std::num::NonZeroIsize) -> bool; + +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#] )] @@ -21376,12 +21454,6 @@ functions[r#" #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] fn eq(&self, #[proxy] other: &std::ops::RangeFull) -> bool; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" @@ -21392,6 +21464,12 @@ functions[r#" )] fn clone(&self) -> std::ops::RangeFull; +"#, + r#" + + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); + "#] )] @@ -21881,63 +21959,63 @@ functions[r#" )] fn sub(self, #[proxy] rhs: bevy::utils::Duration) -> bevy::utils::Duration; -"#, - r#" - - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); - "#, r#" #[lua( - as_trait = "std::ops::Div", + as_trait = "std::ops::Mul", kind = "Function", output(proxy), - composite = "div", - metamethod = "Div", + composite = "mul", + metamethod = "Mul", )] - fn div(self, rhs: u32) -> bevy::utils::Duration; + fn mul(self, rhs: u32) -> bevy::utils::Duration; "#, r#" #[lua( - as_trait = "std::ops::Add", - kind = "Function", + as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", + kind = "Method", output(proxy), - composite = "add", - metamethod = "Add", )] - fn add(self, #[proxy] rhs: bevy::utils::Duration) -> bevy::utils::Duration; + fn clone(&self) -> bevy::utils::Duration; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &bevy_utils::Duration) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" #[lua( - as_trait = "bevy::reflect::erased_serde::__private::serde::__private::Clone", - kind = "Method", + as_trait = "std::ops::Div", + kind = "Function", output(proxy), + composite = "div", + metamethod = "Div", )] - fn clone(&self) -> bevy::utils::Duration; + fn div(self, rhs: u32) -> bevy::utils::Duration; + +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &bevy_utils::Duration) -> bool; "#, r#" #[lua( - as_trait = "std::ops::Mul", + as_trait = "std::ops::Add", kind = "Function", output(proxy), - composite = "mul", - metamethod = "Mul", + composite = "add", + metamethod = "Add", )] - fn mul(self, rhs: u32) -> bevy::utils::Duration; + fn add(self, #[proxy] rhs: bevy::utils::Duration) -> bevy::utils::Duration; "#] )] @@ -21956,11 +22034,6 @@ pub struct Duration{ } - - -crate::impl_tealr_generic!(pub(crate) struct T); - - #[derive(Default)] pub(crate) struct Globals; @@ -21973,91 +22046,91 @@ impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { - instances.add_instance("LuaUuid", + instances.add_instance("Uuid", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaDirection2d", + instances.add_instance("Direction2d", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaCircle", + instances.add_instance("Circle", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaEllipse", + instances.add_instance("Ellipse", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaPlane2d", + instances.add_instance("Plane2d", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaSegment2d", + instances.add_instance("Segment2d", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaTriangle2d", + instances.add_instance("Triangle2d", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaRectangle", + instances.add_instance("Rectangle", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaRegularPolygon", + instances.add_instance("RegularPolygon", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaCapsule2d", + instances.add_instance("Capsule2d", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaDirection3d", + instances.add_instance("Direction3d", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaSphere", + instances.add_instance("Sphere", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaPlane3d", + instances.add_instance("Plane3d", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaSegment3d", + instances.add_instance("Segment3d", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaCuboid", + instances.add_instance("Cuboid", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaCylinder", + instances.add_instance("Cylinder", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaCapsule3d", + instances.add_instance("Capsule3d", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; @@ -22066,286 +22139,286 @@ impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { - instances.add_instance("LuaTorus", + instances.add_instance("Torus", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaIRect", + instances.add_instance("IRect", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaRect", + instances.add_instance("Rect", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaURect", + instances.add_instance("URect", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaPathBuf", + instances.add_instance("PathBuf", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaInstant", + instances.add_instance("Instant", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaBVec2", + instances.add_instance("BVec2", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaBVec3", + instances.add_instance("BVec3", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaBVec4", + instances.add_instance("BVec4", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaBVec3A", + instances.add_instance("BVec3A", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaBVec4A", + instances.add_instance("BVec4A", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaAffine2", + instances.add_instance("Affine2", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaAffine3A", + instances.add_instance("Affine3A", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaMat3", + instances.add_instance("Mat3", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaVec2", + instances.add_instance("Vec2", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaVec3", + instances.add_instance("Vec3", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaMat2", + instances.add_instance("Mat2", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaMat3A", + instances.add_instance("Mat3A", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaMat4", + instances.add_instance("Mat4", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaQuat", + instances.add_instance("Quat", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaVec3A", + instances.add_instance("Vec3A", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaVec4", + instances.add_instance("Vec4", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaDAffine2", + instances.add_instance("DAffine2", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaDAffine3", + instances.add_instance("DAffine3", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaDMat2", + instances.add_instance("DMat2", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaDMat3", + instances.add_instance("DMat3", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaDMat4", + instances.add_instance("DMat4", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaDQuat", + instances.add_instance("DQuat", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaDVec2", + instances.add_instance("DVec2", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaDVec3", + instances.add_instance("DVec3", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaDVec4", + instances.add_instance("DVec4", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaIVec2", + instances.add_instance("IVec2", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaIVec3", + instances.add_instance("IVec3", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaIVec4", + instances.add_instance("IVec4", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaUVec2", + instances.add_instance("UVec2", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaUVec3", + instances.add_instance("UVec3", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaUVec4", + instances.add_instance("UVec4", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaI64Vec2", + instances.add_instance("I64Vec2", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaI64Vec3", + instances.add_instance("I64Vec3", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaI64Vec4", + instances.add_instance("I64Vec4", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaU64Vec2", + instances.add_instance("U64Vec2", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaU64Vec3", + instances.add_instance("U64Vec3", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaU64Vec4", + instances.add_instance("U64Vec4", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaNonZeroU8", + instances.add_instance("NonZeroU8", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaNonZeroU16", + instances.add_instance("NonZeroU16", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaNonZeroU32", + instances.add_instance("NonZeroU32", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaNonZeroU64", + instances.add_instance("NonZeroU64", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaNonZeroU128", + instances.add_instance("NonZeroU128", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaNonZeroUsize", + instances.add_instance("NonZeroUsize", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaNonZeroI8", + instances.add_instance("NonZeroI8", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaNonZeroI16", + instances.add_instance("NonZeroI16", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaNonZeroI32", + instances.add_instance("NonZeroI32", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaNonZeroI64", + instances.add_instance("NonZeroI64", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaNonZeroI128", + instances.add_instance("NonZeroI128", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaNonZeroIsize", + instances.add_instance("NonZeroIsize", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaDuration", + instances.add_instance("Duration", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; diff --git a/crates/bevy_script_api/src/providers/bevy_time.rs b/crates/bevy_script_api/src/providers/bevy_time.rs index 43c08b88..567c410a 100644 --- a/crates/bevy_script_api/src/providers/bevy_time.rs +++ b/crates/bevy_script_api/src/providers/bevy_time.rs @@ -403,14 +403,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::time::Stopwatch; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &stopwatch::Stopwatch) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &stopwatch::Stopwatch) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::time::Stopwatch; "#, r#" @@ -779,14 +779,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::time::prelude::Timer; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &timer::Timer) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &timer::Timer) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::time::prelude::Timer; "#, r#" @@ -826,14 +826,14 @@ derive(clone,debug,), remote="bevy::time::prelude::TimerMode", 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::time::prelude::TimerMode; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::time::prelude::TimerMode; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -993,11 +993,6 @@ pub struct Virtual{ } - - -crate::impl_tealr_generic!(pub(crate) struct T); - - #[derive(Default)] pub(crate) struct Globals; @@ -1012,12 +1007,12 @@ impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { - instances.add_instance("LuaStopwatch", + instances.add_instance("Stopwatch", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaTimer", + instances.add_instance("Timer", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; diff --git a/crates/bevy_script_api/src/providers/bevy_transform.rs b/crates/bevy_script_api/src/providers/bevy_transform.rs index 4835f276..06ed2a39 100644 --- a/crates/bevy_script_api/src/providers/bevy_transform.rs +++ b/crates/bevy_script_api/src/providers/bevy_transform.rs @@ -252,14 +252,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::transform::components::GlobalTransform; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &components::global_transform::GlobalTransform) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &components::global_transform::GlobalTransform) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::transform::components::GlobalTransform; "#] )] @@ -637,14 +637,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &components::transform::Transform) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::transform::components::Transform; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::transform::components::Transform; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &components::transform::Transform) -> bool; "#] )] @@ -659,11 +659,6 @@ pub struct Transform{ } - - -crate::impl_tealr_generic!(pub(crate) struct T); - - #[derive(Default)] pub(crate) struct Globals; @@ -674,12 +669,12 @@ impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { ) -> bevy_mod_scripting_lua::tealr::mlu::mlua::Result<()> { - instances.add_instance("LuaGlobalTransform", + instances.add_instance("GlobalTransform", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaTransform", + instances.add_instance("Transform", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; diff --git a/crates/bevy_script_api/src/providers/bevy_window.rs b/crates/bevy_script_api/src/providers/bevy_window.rs index eb36a969..8fb9d217 100644 --- a/crates/bevy_script_api/src/providers/bevy_window.rs +++ b/crates/bevy_script_api/src/providers/bevy_window.rs @@ -49,14 +49,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::CursorIcon; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &cursor::CursorIcon) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &cursor::CursorIcon) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::prelude::CursorIcon; "#] )] @@ -78,14 +78,14 @@ derive(clone,debug,), remote="bevy::window::WindowResized", functions[r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &event::WindowResized) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::WindowResized; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowResized; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &event::WindowResized) -> bool; "#] )] @@ -111,12 +111,6 @@ derive(clone,debug,), remote="bevy::window::RequestRedraw", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::RequestRedraw; - -"#, - r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); @@ -126,6 +120,12 @@ functions[r#" #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] fn eq(&self, #[proxy] other: &event::RequestRedraw) -> bool; +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::RequestRedraw; + "#] )] @@ -150,20 +150,20 @@ derive(clone,debug,), remote="bevy::window::WindowCreated", 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::window::WindowCreated; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &event::WindowCreated) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowCreated; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &event::WindowCreated) -> bool; "#] )] @@ -201,12 +201,6 @@ derive(clone,debug,), remote="bevy::window::WindowCloseRequested", functions[r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &event::WindowCloseRequested) -> bool; - -"#, - r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); @@ -216,6 +210,12 @@ functions[r#" #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::window::WindowCloseRequested; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &event::WindowCloseRequested) -> bool; + "#] )] @@ -240,20 +240,20 @@ derive(clone,debug,), remote="bevy::window::WindowClosed", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowClosed; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &event::WindowClosed) -> bool; "#, 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::window::WindowClosed; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &event::WindowClosed) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#] )] @@ -287,14 +287,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowDestroyed; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &event::WindowDestroyed) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &event::WindowDestroyed) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::WindowDestroyed; "#] )] @@ -363,12 +363,6 @@ derive(clone,debug,), remote="bevy::window::prelude::CursorEntered", functions[r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &event::CursorEntered) -> bool; - -"#, - r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); @@ -378,6 +372,12 @@ functions[r#" #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::window::prelude::CursorEntered; +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &event::CursorEntered) -> bool; + "#] )] @@ -437,14 +437,14 @@ derive(clone,debug,), remote="bevy::window::prelude::ReceivedCharacter", functions[r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &event::ReceivedCharacter) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::prelude::ReceivedCharacter; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::ReceivedCharacter; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &event::ReceivedCharacter) -> bool; "#, r#" @@ -513,14 +513,14 @@ derive(clone,debug,), remote="bevy::window::WindowFocused", 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::window::WindowFocused; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowFocused; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -560,12 +560,6 @@ derive(clone,debug,), remote="bevy::window::WindowOccluded", functions[r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &event::WindowOccluded) -> bool; - -"#, - r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::window::WindowOccluded; @@ -575,6 +569,12 @@ functions[r#" #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &event::WindowOccluded) -> bool; + "#] )] @@ -628,14 +628,14 @@ derive(clone,debug,), remote="bevy::window::WindowBackendScaleFactorChanged", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowBackendScaleFactorChanged; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &event::WindowBackendScaleFactorChanged) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &event::WindowBackendScaleFactorChanged) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::WindowBackendScaleFactorChanged; "#] )] @@ -659,14 +659,14 @@ derive(clone,debug,), remote="bevy::window::prelude::FileDragAndDrop", functions[r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &event::FileDragAndDrop) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::prelude::FileDragAndDrop; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::FileDragAndDrop; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &event::FileDragAndDrop) -> bool; "#, r#" @@ -694,8 +694,8 @@ derive(clone,debug,), remote="bevy::window::prelude::WindowMoved", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::WindowMoved; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &event::WindowMoved) -> bool; "#, r#" @@ -706,8 +706,8 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &event::WindowMoved) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::prelude::WindowMoved; "#] )] @@ -735,12 +735,6 @@ derive(clone,debug,), remote="bevy::window::WindowThemeChanged", functions[r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &event::WindowThemeChanged) -> bool; - -"#, - r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] fn clone(&self) -> bevy::window::WindowThemeChanged; @@ -750,6 +744,12 @@ functions[r#" #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); +"#, + r#" + + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &event::WindowThemeChanged) -> bool; + "#] )] @@ -778,14 +778,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::ApplicationLifetime; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &event::ApplicationLifetime) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &event::ApplicationLifetime) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::ApplicationLifetime; "#] )] @@ -815,20 +815,20 @@ derive(clone,debug,), remote="bevy::window::PrimaryWindow", functions[r#" - #[lua(as_trait = "std::cmp::Eq", kind = "Method")] - fn assert_receiver_is_total_eq(&self) -> (); + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &window::PrimaryWindow) -> bool; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::PrimaryWindow; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &window::PrimaryWindow) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::PrimaryWindow; "#] )] @@ -886,14 +886,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::NormalizedWindowRef; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, 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::window::NormalizedWindowRef; "#, r#" @@ -1153,14 +1153,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &window::WindowPosition) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::prelude::WindowPosition; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::WindowPosition; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &window::WindowPosition) -> bool; "#] )] @@ -1403,20 +1403,20 @@ derive(clone,debug,), remote="bevy::window::CursorGrabMode", 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::window::CursorGrabMode; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &window::CursorGrabMode) -> bool; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::CursorGrabMode; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &window::CursorGrabMode) -> bool; "#] )] @@ -1497,14 +1497,14 @@ functions[r#" "#, 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::window::prelude::MonitorSelection; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::prelude::MonitorSelection; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#] )] @@ -1560,14 +1560,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::PresentMode; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &window::PresentMode) -> bool; "#, r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &window::PresentMode) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::PresentMode; "#] )] @@ -1589,14 +1589,14 @@ derive(clone,debug,), remote="bevy::window::CompositeAlphaMode", 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::window::CompositeAlphaMode; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::CompositeAlphaMode; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, r#" @@ -1630,14 +1630,14 @@ functions[r#" "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowMode; + #[lua(as_trait = "std::cmp::Eq", kind = "Method")] + fn assert_receiver_is_total_eq(&self) -> (); "#, 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::window::WindowMode; "#] )] @@ -1669,14 +1669,14 @@ derive(clone,debug,), remote="bevy::window::WindowLevel", functions[r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &window::WindowLevel) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::WindowLevel; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowLevel; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &window::WindowLevel) -> bool; "#, r#" @@ -1704,12 +1704,6 @@ derive(clone,debug,), remote="bevy::window::WindowTheme", functions[r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::WindowTheme; - -"#, - r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] fn eq(&self, #[proxy] other: &window::WindowTheme) -> bool; @@ -1719,6 +1713,12 @@ functions[r#" #[lua(as_trait = "std::cmp::Eq", kind = "Method")] fn assert_receiver_is_total_eq(&self) -> (); +"#, + r#" + + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::WindowTheme; + "#] )] @@ -1745,14 +1745,14 @@ derive(clone,debug,), remote="bevy::window::EnabledButtons", functions[r#" - #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] - fn eq(&self, #[proxy] other: &window::EnabledButtons) -> bool; + #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] + fn clone(&self) -> bevy::window::EnabledButtons; "#, r#" - #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))] - fn clone(&self) -> bevy::window::EnabledButtons; + #[lua(as_trait = "std::cmp::PartialEq", kind = "Function", composite = "eq")] + fn eq(&self, #[proxy] other: &window::EnabledButtons) -> bool; "#] )] @@ -1767,11 +1767,6 @@ pub struct EnabledButtons{ } - - -crate::impl_tealr_generic!(pub(crate) struct T); - - #[derive(Default)] pub(crate) struct Globals; @@ -1834,12 +1829,12 @@ impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { - instances.add_instance("LuaWindowPosition", + instances.add_instance("WindowPosition", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; - instances.add_instance("LuaWindowResolution", + instances.add_instance("WindowResolution", bevy_mod_scripting_lua::tealr::mlu::UserDataProxy::::new)?; diff --git a/examples/lua/bevy_api.rs b/examples/lua/bevy_api.rs index b956dd9a..a465c59d 100644 --- a/examples/lua/bevy_api.rs +++ b/examples/lua/bevy_api.rs @@ -3,7 +3,7 @@ use bevy::app::AppExit; use bevy::prelude::*; use bevy_mod_scripting::prelude::*; -use bevy_script_api::lua::{bevy::LuaBevyAPIProvider, RegisterForeignLuaType}; +use bevy_script_api::{lua::RegisterForeignLuaType, prelude::*}; #[derive(Component, Default, Reflect)] #[reflect(Component)] @@ -30,7 +30,8 @@ fn main() -> std::io::Result<()> { .register_foreign_lua_type::>() .register_foreign_lua_type::>>() .add_script_host::>(PostUpdate) - .add_api_provider::>(Box::new(LuaBevyAPIProvider)) + .add_api_provider::>(Box::new(BevyAPIProvider)) + .add_api_provider::>(Box::new(CoreBevyAPIProvider)) .add_systems(Startup, |world: &mut World| {