@@ -20,10 +20,14 @@ use crate::{
2020 bms_lua_path = "crate" ,
2121 functions[ r#"
2222
23- #[lua(as_trait = "std::clone::Clone")]
24- fn clone(
23+ #[lua(
24+ as_trait = "std::cmp::PartialEq::<bevy::ecs::entity::Entity>",
25+ composite = "eq",
26+ )]
27+ fn eq(
2528 _self: LuaReflectRefProxy<bevy::ecs::entity::Entity>,
26- ) -> LuaReflectValProxy<bevy::ecs::entity::Entity>;
29+ other: LuaReflectRefProxy<bevy::ecs::entity::Entity>,
30+ ) -> bool;
2731
2832"# ,
2933 r#"
@@ -82,14 +86,10 @@ use crate::{
8286"# ,
8387 r#"
8488
85- #[lua(
86- as_trait = "std::cmp::PartialEq::<bevy::ecs::entity::Entity>",
87- composite = "eq",
88- )]
89- fn eq(
89+ #[lua(as_trait = "std::clone::Clone")]
90+ fn clone(
9091 _self: LuaReflectRefProxy<bevy::ecs::entity::Entity>,
91- other: LuaReflectRefProxy<bevy::ecs::entity::Entity>,
92- ) -> bool;
92+ ) -> LuaReflectValProxy<bevy::ecs::entity::Entity>;
9393
9494"# ,
9595 r#"
@@ -158,6 +158,22 @@ pub struct OnReplace {}
158158 bms_core_path = "bevy_mod_scripting_core" ,
159159 bms_lua_path = "crate" ,
160160 functions[ r#"
161+ /// Creates a new [`ComponentId`].
162+ /// The `index` is a unique value associated with each type of component in a given world.
163+ /// Usually, this value is taken from a counter incremented for each type of component registered with the world.
164+
165+ #[lua()]
166+ fn new(index: usize) -> LuaReflectValProxy<bevy::ecs::component::ComponentId>;
167+
168+ "# ,
169+ r#"
170+ /// Returns the index of the current component.
171+
172+ #[lua()]
173+ fn index(_self: LuaReflectValProxy<bevy::ecs::component::ComponentId>) -> usize;
174+
175+ "# ,
176+ r#"
161177
162178 #[lua(as_trait = "std::clone::Clone")]
163179 fn clone(
@@ -184,22 +200,6 @@ pub struct OnReplace {}
184200 _self: LuaReflectRefProxy<bevy::ecs::component::ComponentId>,
185201 ) -> ();
186202
187- "# ,
188- r#"
189- /// Creates a new [`ComponentId`].
190- /// The `index` is a unique value associated with each type of component in a given world.
191- /// Usually, this value is taken from a counter incremented for each type of component registered with the world.
192-
193- #[lua()]
194- fn new(index: usize) -> LuaReflectValProxy<bevy::ecs::component::ComponentId>;
195-
196- "# ,
197- r#"
198- /// Returns the index of the current component.
199-
200- #[lua()]
201- fn index(_self: LuaReflectValProxy<bevy::ecs::component::ComponentId>) -> usize;
202-
203203"# ,
204204 r#"
205205#[lua(metamethod="ToString")]
@@ -221,6 +221,26 @@ pub struct ComponentId();
221221 _self: LuaReflectRefProxy<bevy::ecs::component::Tick>,
222222 ) -> LuaReflectValProxy<bevy::ecs::component::Tick>;
223223
224+ "# ,
225+ r#"
226+
227+ #[lua(
228+ as_trait = "std::cmp::PartialEq::<bevy::ecs::component::Tick>",
229+ composite = "eq",
230+ )]
231+ fn eq(
232+ _self: LuaReflectRefProxy<bevy::ecs::component::Tick>,
233+ other: LuaReflectRefProxy<bevy::ecs::component::Tick>,
234+ ) -> bool;
235+
236+ "# ,
237+ r#"
238+
239+ #[lua(as_trait = "std::cmp::Eq")]
240+ fn assert_receiver_is_total_eq(
241+ _self: LuaReflectRefProxy<bevy::ecs::component::Tick>,
242+ ) -> ();
243+
224244"# ,
225245 r#"
226246/// Creates a new [`Tick`] wrapping the given value.
@@ -254,26 +274,6 @@ pub struct ComponentId();
254274 this_run: LuaReflectValProxy<bevy::ecs::component::Tick>,
255275 ) -> bool;
256276
257- "# ,
258- r#"
259-
260- #[lua(as_trait = "std::cmp::Eq")]
261- fn assert_receiver_is_total_eq(
262- _self: LuaReflectRefProxy<bevy::ecs::component::Tick>,
263- ) -> ();
264-
265- "# ,
266- r#"
267-
268- #[lua(
269- as_trait = "std::cmp::PartialEq::<bevy::ecs::component::Tick>",
270- composite = "eq",
271- )]
272- fn eq(
273- _self: LuaReflectRefProxy<bevy::ecs::component::Tick>,
274- other: LuaReflectRefProxy<bevy::ecs::component::Tick>,
275- ) -> bool;
276-
277277"# ,
278278 r#"
279279#[lua(metamethod="ToString")]
@@ -289,14 +289,6 @@ pub struct Tick {}
289289 bms_core_path = "bevy_mod_scripting_core" ,
290290 bms_lua_path = "crate" ,
291291 functions[ r#"
292-
293- #[lua(as_trait = "std::clone::Clone")]
294- fn clone(
295- _self: LuaReflectRefProxy<bevy::ecs::component::ComponentTicks>,
296- ) -> LuaReflectValProxy<bevy::ecs::component::ComponentTicks>;
297-
298- "# ,
299- r#"
300292/// Returns `true` if the component or resource was added after the system last ran
301293/// (or the system is running for the first time).
302294
@@ -321,21 +313,12 @@ pub struct Tick {}
321313
322314"# ,
323315 r#"
324- /// Returns the tick recording the time this component or resource was most recently changed.
325-
326- #[lua()]
327- fn last_changed_tick(
328- _self: LuaReflectRefProxy<bevy::ecs::component::ComponentTicks>,
329- ) -> LuaReflectValProxy<bevy::ecs::component::Tick>;
330-
331- "# ,
332- r#"
333- /// Returns the tick recording the time this component or resource was added.
316+ /// Creates a new instance with the same change tick for `added` and `changed`.
334317
335318 #[lua()]
336- fn added_tick (
337- _self: LuaReflectRefProxy <bevy::ecs::component::ComponentTicks >,
338- ) -> LuaReflectValProxy<bevy::ecs::component::Tick >;
319+ fn new (
320+ change_tick: LuaReflectValProxy <bevy::ecs::component::Tick >,
321+ ) -> LuaReflectValProxy<bevy::ecs::component::ComponentTicks >;
339322
340323"# ,
341324 r#"
@@ -357,6 +340,14 @@ pub struct Tick {}
357340 change_tick: LuaReflectValProxy<bevy::ecs::component::Tick>,
358341 ) -> ();
359342
343+ "# ,
344+ r#"
345+
346+ #[lua(as_trait = "std::clone::Clone")]
347+ fn clone(
348+ _self: LuaReflectRefProxy<bevy::ecs::component::ComponentTicks>,
349+ ) -> LuaReflectValProxy<bevy::ecs::component::ComponentTicks>;
350+
360351"# ,
361352 r#"
362353#[lua(metamethod="ToString")]
@@ -365,22 +356,17 @@ fn index(&self) -> String {
365356}
366357"# ]
367358) ]
368- pub struct ComponentTicks { }
359+ pub struct ComponentTicks {
360+ added : bevy:: ecs:: component:: Tick ,
361+ changed : bevy:: ecs:: component:: Tick ,
362+ }
369363#[ derive( bevy_mod_scripting_derive:: LuaProxy ) ]
370364#[ proxy(
371365 remote = "bevy::ecs::identifier::Identifier" ,
372366 bms_core_path = "bevy_mod_scripting_core" ,
373367 bms_lua_path = "crate" ,
374368 functions[ r#"
375369
376- #[lua(as_trait = "std::clone::Clone")]
377- fn clone(
378- _self: LuaReflectRefProxy<bevy::ecs::identifier::Identifier>,
379- ) -> LuaReflectValProxy<bevy::ecs::identifier::Identifier>;
380-
381- "# ,
382- r#"
383-
384370 #[lua(
385371 as_trait = "std::cmp::PartialEq::<bevy::ecs::identifier::Identifier>",
386372 composite = "eq",
@@ -421,6 +407,14 @@ pub struct ComponentTicks {}
421407 #[lua()]
422408 fn from_bits(value: u64) -> LuaReflectValProxy<bevy::ecs::identifier::Identifier>;
423409
410+ "# ,
411+ r#"
412+
413+ #[lua(as_trait = "std::clone::Clone")]
414+ fn clone(
415+ _self: LuaReflectRefProxy<bevy::ecs::identifier::Identifier>,
416+ ) -> LuaReflectValProxy<bevy::ecs::identifier::Identifier>;
417+
424418"# ,
425419 r#"
426420#[lua(metamethod="ToString")]
@@ -490,6 +484,11 @@ impl crate::tealr::mlu::ExportInstances for Globals {
490484 ) ?;
491485 instances
492486 . add_instance ( "Tick" , crate :: tealr:: mlu:: UserDataProxy :: < LuaTick > :: new) ?;
487+ instances
488+ . add_instance (
489+ "ComponentTicks" ,
490+ crate :: tealr:: mlu:: UserDataProxy :: < LuaComponentTicks > :: new,
491+ ) ?;
493492 instances
494493 . add_instance (
495494 "Identifier" ,
@@ -540,6 +539,9 @@ impl bevy::app::Plugin for BevyEcsScriptingPlugin {
540539 . process_type :: < LuaTick > ( )
541540 . process_type :: < crate :: tealr:: mlu:: UserDataProxy < LuaTick > > ( )
542541 . process_type :: < LuaComponentTicks > ( )
542+ . process_type :: <
543+ crate :: tealr:: mlu:: UserDataProxy < LuaComponentTicks > ,
544+ > ( )
543545 . process_type :: < LuaIdentifier > ( )
544546 . process_type :: <
545547 crate :: tealr:: mlu:: UserDataProxy < LuaIdentifier > ,
0 commit comments