@@ -20,10 +20,14 @@ use crate::{
20
20
bms_lua_path = "crate" ,
21
21
functions[ r#"
22
22
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(
25
28
_self: LuaReflectRefProxy<bevy::ecs::entity::Entity>,
26
- ) -> LuaReflectValProxy<bevy::ecs::entity::Entity>;
29
+ other: LuaReflectRefProxy<bevy::ecs::entity::Entity>,
30
+ ) -> bool;
27
31
28
32
"# ,
29
33
r#"
@@ -82,14 +86,10 @@ use crate::{
82
86
"# ,
83
87
r#"
84
88
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(
90
91
_self: LuaReflectRefProxy<bevy::ecs::entity::Entity>,
91
- other: LuaReflectRefProxy<bevy::ecs::entity::Entity>,
92
- ) -> bool;
92
+ ) -> LuaReflectValProxy<bevy::ecs::entity::Entity>;
93
93
94
94
"# ,
95
95
r#"
@@ -158,6 +158,22 @@ pub struct OnReplace {}
158
158
bms_core_path = "bevy_mod_scripting_core" ,
159
159
bms_lua_path = "crate" ,
160
160
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#"
161
177
162
178
#[lua(as_trait = "std::clone::Clone")]
163
179
fn clone(
@@ -184,22 +200,6 @@ pub struct OnReplace {}
184
200
_self: LuaReflectRefProxy<bevy::ecs::component::ComponentId>,
185
201
) -> ();
186
202
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
-
203
203
"# ,
204
204
r#"
205
205
#[lua(metamethod="ToString")]
@@ -221,6 +221,26 @@ pub struct ComponentId();
221
221
_self: LuaReflectRefProxy<bevy::ecs::component::Tick>,
222
222
) -> LuaReflectValProxy<bevy::ecs::component::Tick>;
223
223
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
+
224
244
"# ,
225
245
r#"
226
246
/// Creates a new [`Tick`] wrapping the given value.
@@ -254,26 +274,6 @@ pub struct ComponentId();
254
274
this_run: LuaReflectValProxy<bevy::ecs::component::Tick>,
255
275
) -> bool;
256
276
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
-
277
277
"# ,
278
278
r#"
279
279
#[lua(metamethod="ToString")]
@@ -289,14 +289,6 @@ pub struct Tick {}
289
289
bms_core_path = "bevy_mod_scripting_core" ,
290
290
bms_lua_path = "crate" ,
291
291
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#"
300
292
/// Returns `true` if the component or resource was added after the system last ran
301
293
/// (or the system is running for the first time).
302
294
@@ -321,21 +313,12 @@ pub struct Tick {}
321
313
322
314
"# ,
323
315
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`.
334
317
335
318
#[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 >;
339
322
340
323
"# ,
341
324
r#"
@@ -357,6 +340,14 @@ pub struct Tick {}
357
340
change_tick: LuaReflectValProxy<bevy::ecs::component::Tick>,
358
341
) -> ();
359
342
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
+
360
351
"# ,
361
352
r#"
362
353
#[lua(metamethod="ToString")]
@@ -365,22 +356,17 @@ fn index(&self) -> String {
365
356
}
366
357
"# ]
367
358
) ]
368
- pub struct ComponentTicks { }
359
+ pub struct ComponentTicks {
360
+ added : bevy:: ecs:: component:: Tick ,
361
+ changed : bevy:: ecs:: component:: Tick ,
362
+ }
369
363
#[ derive( bevy_mod_scripting_derive:: LuaProxy ) ]
370
364
#[ proxy(
371
365
remote = "bevy::ecs::identifier::Identifier" ,
372
366
bms_core_path = "bevy_mod_scripting_core" ,
373
367
bms_lua_path = "crate" ,
374
368
functions[ r#"
375
369
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
-
384
370
#[lua(
385
371
as_trait = "std::cmp::PartialEq::<bevy::ecs::identifier::Identifier>",
386
372
composite = "eq",
@@ -421,6 +407,14 @@ pub struct ComponentTicks {}
421
407
#[lua()]
422
408
fn from_bits(value: u64) -> LuaReflectValProxy<bevy::ecs::identifier::Identifier>;
423
409
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
+
424
418
"# ,
425
419
r#"
426
420
#[lua(metamethod="ToString")]
@@ -490,6 +484,11 @@ impl crate::tealr::mlu::ExportInstances for Globals {
490
484
) ?;
491
485
instances
492
486
. add_instance ( "Tick" , crate :: tealr:: mlu:: UserDataProxy :: < LuaTick > :: new) ?;
487
+ instances
488
+ . add_instance (
489
+ "ComponentTicks" ,
490
+ crate :: tealr:: mlu:: UserDataProxy :: < LuaComponentTicks > :: new,
491
+ ) ?;
493
492
instances
494
493
. add_instance (
495
494
"Identifier" ,
@@ -540,6 +539,9 @@ impl bevy::app::Plugin for BevyEcsScriptingPlugin {
540
539
. process_type :: < LuaTick > ( )
541
540
. process_type :: < crate :: tealr:: mlu:: UserDataProxy < LuaTick > > ( )
542
541
. process_type :: < LuaComponentTicks > ( )
542
+ . process_type :: <
543
+ crate :: tealr:: mlu:: UserDataProxy < LuaComponentTicks > ,
544
+ > ( )
543
545
. process_type :: < LuaIdentifier > ( )
544
546
. process_type :: <
545
547
crate :: tealr:: mlu:: UserDataProxy < LuaIdentifier > ,
0 commit comments