Skip to content

Commit e01c516

Browse files
committed
merge
1 parent 34164ed commit e01c516

File tree

12 files changed

+3569
-5557
lines changed

12 files changed

+3569
-5557
lines changed

crates/languages/bevy_mod_scripting_lua/src/bindings/providers/bevy_a11y.rs

Lines changed: 0 additions & 58 deletions
This file was deleted.

crates/languages/bevy_mod_scripting_lua/src/bindings/providers/bevy_core.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ use crate::{
2121
bms_lua_path = "crate",
2222
functions[r#"
2323
24-
#[lua(as_trait = "std::clone::Clone")]
25-
fn clone(
26-
_self: LuaReflectRefProxy<bevy::core::prelude::Name>,
27-
) -> LuaReflectValProxy<bevy::core::prelude::Name>;
28-
29-
"#,
30-
r#"
31-
3224
#[lua(
3325
as_trait = "std::cmp::PartialEq::<bevy::core::prelude::Name>",
3426
composite = "eq",
@@ -38,6 +30,14 @@ use crate::{
3830
other: LuaReflectRefProxy<bevy::core::prelude::Name>,
3931
) -> bool;
4032
33+
"#,
34+
r#"
35+
36+
#[lua(as_trait = "std::clone::Clone")]
37+
fn clone(
38+
_self: LuaReflectRefProxy<bevy::core::prelude::Name>,
39+
) -> LuaReflectValProxy<bevy::core::prelude::Name>;
40+
4141
"#,
4242
r#"
4343
#[lua(metamethod="ToString")]

crates/languages/bevy_mod_scripting_lua/src/bindings/providers/bevy_ecs.rs

Lines changed: 78 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -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>,

crates/languages/bevy_mod_scripting_lua/src/bindings/providers/bevy_hierarchy.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ pub struct Parent();
7979
bms_lua_path = "crate",
8080
functions[r#"
8181
82+
#[lua(as_trait = "std::clone::Clone")]
83+
fn clone(
84+
_self: LuaReflectRefProxy<bevy::hierarchy::HierarchyEvent>,
85+
) -> LuaReflectValProxy<bevy::hierarchy::HierarchyEvent>;
86+
87+
"#,
88+
r#"
89+
8290
#[lua(
8391
as_trait = "std::cmp::PartialEq::<bevy::hierarchy::HierarchyEvent>",
8492
composite = "eq",
@@ -88,14 +96,6 @@ pub struct Parent();
8896
other: LuaReflectRefProxy<bevy::hierarchy::HierarchyEvent>,
8997
) -> bool;
9098
91-
"#,
92-
r#"
93-
94-
#[lua(as_trait = "std::clone::Clone")]
95-
fn clone(
96-
_self: LuaReflectRefProxy<bevy::hierarchy::HierarchyEvent>,
97-
) -> LuaReflectValProxy<bevy::hierarchy::HierarchyEvent>;
98-
9999
"#,
100100
r#"
101101

0 commit comments

Comments
 (0)