@@ -85,38 +85,73 @@ use bevy_script_api::{
85
85
r#"
86
86
#[lua(kind="MetaMethod", metamethod="ToString")]
87
87
fn index(&self) -> String {
88
- format!("{}", _self)
88
+ format!("{:? }", _self)
89
89
}
90
90
"# ]
91
91
) ]
92
92
struct Entity { }
93
93
#[ derive( bevy_mod_scripting_lua_derive:: LuaProxy ) ]
94
- #[ proxy( derive( ) , remote = "bevy::ecs::world::OnAdd" , functions[ ] ) ]
94
+ #[ proxy(
95
+ derive( ) ,
96
+ remote = "bevy::ecs::world::OnAdd" ,
97
+ functions[ r#"
98
+ #[lua(kind="MetaMethod", metamethod="ToString")]
99
+ fn index(&self) -> String {
100
+ format!("{:?}", _self)
101
+ }
102
+ "# ]
103
+ ) ]
95
104
struct OnAdd { }
96
105
#[ derive( bevy_mod_scripting_lua_derive:: LuaProxy ) ]
97
- #[ proxy( derive( ) , remote = "bevy::ecs::world::OnInsert" , functions[ ] ) ]
106
+ #[ proxy(
107
+ derive( ) ,
108
+ remote = "bevy::ecs::world::OnInsert" ,
109
+ functions[ r#"
110
+ #[lua(kind="MetaMethod", metamethod="ToString")]
111
+ fn index(&self) -> String {
112
+ format!("{:?}", _self)
113
+ }
114
+ "# ]
115
+ ) ]
98
116
struct OnInsert { }
99
117
#[ derive( bevy_mod_scripting_lua_derive:: LuaProxy ) ]
100
- #[ proxy( derive( ) , remote = "bevy::ecs::world::OnRemove" , functions[ ] ) ]
118
+ #[ proxy(
119
+ derive( ) ,
120
+ remote = "bevy::ecs::world::OnRemove" ,
121
+ functions[ r#"
122
+ #[lua(kind="MetaMethod", metamethod="ToString")]
123
+ fn index(&self) -> String {
124
+ format!("{:?}", _self)
125
+ }
126
+ "# ]
127
+ ) ]
101
128
struct OnRemove { }
102
129
#[ derive( bevy_mod_scripting_lua_derive:: LuaProxy ) ]
130
+ #[ proxy(
131
+ derive( ) ,
132
+ remote = "bevy::ecs::world::OnReplace" ,
133
+ functions[ r#"
134
+ #[lua(kind="MetaMethod", metamethod="ToString")]
135
+ fn index(&self) -> String {
136
+ format!("{:?}", _self)
137
+ }
138
+ "# ]
139
+ ) ]
140
+ struct OnReplace { }
141
+ #[ derive( bevy_mod_scripting_lua_derive:: LuaProxy ) ]
103
142
#[ proxy(
104
143
derive( clone) ,
105
144
remote = "bevy::ecs::component::ComponentId" ,
106
145
functions[ r#"
107
- /// Creates a new [`ComponentId`].
108
- /// The `index` is a unique value associated with each type of component in a given world.
109
- /// Usually, this value is taken from a counter incremented for each type of component registered with the world.
110
146
111
- #[lua(kind = "Function ", output(proxy) )]
112
- fn new(index: usize ) -> bevy::ecs::component::ComponentId ;
147
+ #[lua(as_trait = "std::cmp::Eq ", kind = "Method" )]
148
+ fn assert_receiver_is_total_eq(&self ) -> () ;
113
149
114
150
"# ,
115
151
r#"
116
- /// Returns the index of the current component.
117
152
118
- #[lua(kind = "Method")]
119
- fn index( self) -> usize ;
153
+ #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy) )]
154
+ fn clone(& self) -> bevy::ecs::component::ComponentId ;
120
155
121
156
"# ,
122
157
r#"
@@ -131,15 +166,19 @@ struct OnRemove {}
131
166
132
167
"# ,
133
168
r#"
169
+ /// Creates a new [`ComponentId`].
170
+ /// The `index` is a unique value associated with each type of component in a given world.
171
+ /// Usually, this value is taken from a counter incremented for each type of component registered with the world.
134
172
135
- #[lua(as_trait = "std::clone::Clone", kind = "Method ", output(proxy))]
136
- fn clone(&self ) -> bevy::ecs::component::ComponentId;
173
+ #[lua(kind = "Function ", output(proxy))]
174
+ fn new(index: usize ) -> bevy::ecs::component::ComponentId;
137
175
138
176
"# ,
139
177
r#"
178
+ /// Returns the index of the current component.
140
179
141
- #[lua(as_trait = "std::cmp::Eq", kind = "Method")]
142
- fn assert_receiver_is_total_eq(& self) -> () ;
180
+ #[lua(kind = "Method")]
181
+ fn index( self) -> usize ;
143
182
144
183
"# ,
145
184
r#"
@@ -156,13 +195,8 @@ struct ComponentId();
156
195
remote = "bevy::ecs::component::Tick" ,
157
196
functions[ r#"
158
197
159
- #[lua(
160
- as_trait = "std::cmp::PartialEq",
161
- kind = "MetaFunction",
162
- composite = "eq",
163
- metamethod = "Eq",
164
- )]
165
- fn eq(&self, #[proxy] other: &component::Tick) -> bool;
198
+ #[lua(as_trait = "std::cmp::Eq", kind = "Method")]
199
+ fn assert_receiver_is_total_eq(&self) -> ();
166
200
167
201
"# ,
168
202
r#"
@@ -208,8 +242,13 @@ struct ComponentId();
208
242
"# ,
209
243
r#"
210
244
211
- #[lua(as_trait = "std::cmp::Eq", kind = "Method")]
212
- fn assert_receiver_is_total_eq(&self) -> ();
245
+ #[lua(
246
+ as_trait = "std::cmp::PartialEq",
247
+ kind = "MetaFunction",
248
+ composite = "eq",
249
+ metamethod = "Eq",
250
+ )]
251
+ fn eq(&self, #[proxy] other: &component::Tick) -> bool;
213
252
214
253
"# ,
215
254
r#"
@@ -311,12 +350,6 @@ struct ComponentTicks {}
311
350
)]
312
351
fn eq(&self, #[proxy] other: &identifier::Identifier) -> bool;
313
352
314
- "# ,
315
- r#"
316
-
317
- #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
318
- fn clone(&self) -> bevy::ecs::identifier::Identifier;
319
-
320
353
"# ,
321
354
r#"
322
355
/// Returns the value of the low segment of the [`Identifier`].
@@ -348,6 +381,12 @@ struct ComponentTicks {}
348
381
#[lua(kind = "Function", output(proxy))]
349
382
fn from_bits(value: u64) -> bevy::ecs::identifier::Identifier;
350
383
384
+ "# ,
385
+ r#"
386
+
387
+ #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
388
+ fn clone(&self) -> bevy::ecs::identifier::Identifier;
389
+
351
390
"# ,
352
391
r#"
353
392
#[lua(kind="MetaMethod", metamethod="ToString")]
@@ -369,6 +408,27 @@ struct Identifier {}
369
408
"# ]
370
409
) ]
371
410
struct EntityHash { }
411
+ #[ derive( bevy_mod_scripting_lua_derive:: LuaProxy ) ]
412
+ #[ proxy(
413
+ derive( clone) ,
414
+ remote = "bevy::ecs::removal_detection::RemovedComponentEntity" ,
415
+ functions[ r#"
416
+
417
+ #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
418
+ fn clone(&self) -> bevy::ecs::removal_detection::RemovedComponentEntity;
419
+
420
+ "# ,
421
+ r#"
422
+ #[lua(kind="MetaMethod", metamethod="ToString")]
423
+ fn index(&self) -> String {
424
+ format!("{:?}", _self)
425
+ }
426
+ "# ]
427
+ ) ]
428
+ struct RemovedComponentEntity ( ) ;
429
+ #[ derive( bevy_mod_scripting_lua_derive:: LuaProxy ) ]
430
+ #[ proxy( derive( ) , remote = "bevy::ecs::system::SystemIdMarker" , functions[ ] ) ]
431
+ struct SystemIdMarker { }
372
432
#[ derive( Default ) ]
373
433
pub ( crate ) struct Globals ;
374
434
impl bevy_mod_scripting_lua:: tealr:: mlu:: ExportInstances for Globals {
@@ -428,6 +488,7 @@ impl bevy_mod_scripting_core::hosts::APIProvider for BevyEcsAPIProvider {
428
488
. process_type :: < LuaOnAdd > ( )
429
489
. process_type :: < LuaOnInsert > ( )
430
490
. process_type :: < LuaOnRemove > ( )
491
+ . process_type :: < LuaOnReplace > ( )
431
492
. process_type :: < LuaComponentId > ( )
432
493
. process_type :: <
433
494
bevy_mod_scripting_lua:: tealr:: mlu:: UserDataProxy <
@@ -446,6 +507,8 @@ impl bevy_mod_scripting_core::hosts::APIProvider for BevyEcsAPIProvider {
446
507
> ,
447
508
> ( )
448
509
. process_type :: < LuaEntityHash > ( )
510
+ . process_type :: < LuaRemovedComponentEntity > ( )
511
+ . process_type :: < LuaSystemIdMarker > ( )
449
512
} ,
450
513
) ,
451
514
)
@@ -470,10 +533,15 @@ impl bevy_mod_scripting_core::hosts::APIProvider for BevyEcsAPIProvider {
470
533
app. register_foreign_lua_type :: < bevy:: ecs:: world:: OnAdd > ( ) ;
471
534
app. register_foreign_lua_type :: < bevy:: ecs:: world:: OnInsert > ( ) ;
472
535
app. register_foreign_lua_type :: < bevy:: ecs:: world:: OnRemove > ( ) ;
536
+ app. register_foreign_lua_type :: < bevy:: ecs:: world:: OnReplace > ( ) ;
473
537
app. register_foreign_lua_type :: < bevy:: ecs:: component:: ComponentId > ( ) ;
474
538
app. register_foreign_lua_type :: < bevy:: ecs:: component:: Tick > ( ) ;
475
539
app. register_foreign_lua_type :: < bevy:: ecs:: component:: ComponentTicks > ( ) ;
476
540
app. register_foreign_lua_type :: < bevy:: ecs:: identifier:: Identifier > ( ) ;
477
541
app. register_foreign_lua_type :: < bevy:: ecs:: entity:: EntityHash > ( ) ;
542
+ app. register_foreign_lua_type :: <
543
+ bevy:: ecs:: removal_detection:: RemovedComponentEntity ,
544
+ > ( ) ;
545
+ app. register_foreign_lua_type :: < bevy:: ecs:: system:: SystemIdMarker > ( ) ;
478
546
}
479
547
}
0 commit comments