66 tealr::mlu::mlua::MetaMethod,
77 docs::LuaDocFragment
88 },
9- crate::{common::bevy::GetWorld, lua::{RegisterForeignLuaType}},
9+ crate::{common::bevy::GetWorld, lua::{RegisterForeignLuaType, util::LuaIndex }},
1010};
1111use std::ops::*;
1212use crate::{script_ref::{ReflectedValue,ValueIndex},
1313 sub_reflect::ReflectPathElem,
14- error::ReflectionError
14+ error::ReflectionError,
1515};
1616use std::sync::Mutex;
1717use bevy_mod_scripting_core::prelude::*;
@@ -145,10 +145,6 @@ source="bevy_ui"
145145type =" CalculatedClip"
146146source =" bevy_ui"
147147
148- [[types ]]
149- type =" CalculatedSize"
150- source =" bevy_ui"
151-
152148[[types ]]
153149type =" Node"
154150source =" bevy_ui"
@@ -493,26 +489,26 @@ source="bevy_asset"
493489type =" Vec2"
494490source =" bevy_math"
495491lua_methods =[
496- " (MetaMethod::Index) => |_,s,idx: usize | {Ok(s.inner()?[idx])}" ,
497- " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (usize ,f32)| {s.val_mut(|s| Ok(s[idx] = val))?}"
492+ " (MetaMethod::Index) => |_,s,idx: LuaIndex | {Ok(s.inner()?[* idx])}" ,
493+ " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (LuaIndex ,f32)| {s.val_mut(|s| Ok(s[* idx] = val))?}"
498494]
499495import_path =" glam::f32::Vec2"
500496
501497[[types ]]
502498type =" Vec3"
503499source =" bevy_math"
504500lua_methods =[
505- " (MetaMethod::Index) => |_,s,idx: usize | {Ok(s.inner()?[idx])}" ,
506- " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (usize ,f32)| {s.val_mut(|s| Ok(s[idx] = val))?}"
501+ " (MetaMethod::Index) => |_,s,idx: LuaIndex | {Ok(s.inner()?[* idx])}" ,
502+ " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (LuaIndex ,f32)| {s.val_mut(|s| Ok(s[* idx] = val))?}"
507503]
508504import_path =" glam::f32::Vec3"
509505
510506[[types ]]
511507type =" Vec3A"
512508source =" bevy_math"
513509lua_methods =[
514- " (MetaMethod::Index) => |_,s,idx: usize | {Ok(s.inner()?[idx])}" ,
515- " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (usize ,f32)| {s.val_mut(|s| Ok(s[idx] = val))?}"
510+ " (MetaMethod::Index) => |_,s,idx: LuaIndex | {Ok(s.inner()?[* idx])}" ,
511+ " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (LuaIndex ,f32)| {s.val_mut(|s| Ok(s[* idx] = val))?}"
516512]
517513import_path =" glam::f32::Vec3A"
518514
@@ -521,8 +517,8 @@ import_path="glam::f32::Vec3A"
521517type =" Vec4"
522518source =" bevy_math"
523519lua_methods =[
524- " (MetaMethod::Index) => |_,s,idx: usize | {Ok(s.inner()?[idx])}" ,
525- " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (usize ,f32)| {s.val_mut(|s| Ok(s[idx] = val))?}"
520+ " (MetaMethod::Index) => |_,s,idx: LuaIndex | {Ok(s.inner()?[* idx])}" ,
521+ " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (LuaIndex ,f32)| {s.val_mut(|s| Ok(s[* idx] = val))?}"
526522]
527523import_path =" glam::f32::Vec4"
528524
@@ -555,80 +551,80 @@ import_path="glam::bool::BVec4A"
555551type =" DVec2"
556552source =" bevy_math"
557553lua_methods =[
558- " (MetaMethod::Index) => |_,s,idx: usize | {Ok(s.inner()?[idx])}" ,
559- " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (usize ,f64)| {s.val_mut(|s| Ok(s[idx] = val))?}"
554+ " (MetaMethod::Index) => |_,s,idx: LuaIndex | {Ok(s.inner()?[* idx])}" ,
555+ " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (LuaIndex ,f64)| {s.val_mut(|s| Ok(s[* idx] = val))?}"
560556]
561557import_path =" glam::f64::DVec2"
562558
563559[[types ]]
564560type =" DVec3"
565561source =" bevy_math"
566562lua_methods =[
567- " (MetaMethod::Index) => |_,s,idx: usize | {Ok(s.inner()?[idx])}" ,
568- " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (usize ,f64)| {s.val_mut(|s| Ok(s[idx] = val))?}"
563+ " (MetaMethod::Index) => |_,s,idx: LuaIndex | {Ok(s.inner()?[* idx])}" ,
564+ " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (LuaIndex ,f64)| {s.val_mut(|s| Ok(s[* idx] = val))?}"
569565]
570566import_path =" glam::f64::DVec3"
571567
572568[[types ]]
573569type =" DVec4"
574570source =" bevy_math"
575571lua_methods =[
576- " (MetaMethod::Index) => |_,s,idx: usize | {Ok(s.inner()?[idx])}" ,
577- " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (usize ,f64)| {s.val_mut(|s| Ok(s[idx] = val))?}"
572+ " (MetaMethod::Index) => |_,s,idx: LuaIndex | {Ok(s.inner()?[* idx])}" ,
573+ " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (LuaIndex ,f64)| {s.val_mut(|s| Ok(s[* idx] = val))?}"
578574]
579575import_path =" glam::f64::DVec4"
580576
581577[[types ]]
582578type =" IVec2"
583579source =" bevy_math"
584580lua_methods =[
585- " (MetaMethod::Index) => |_,s,idx: usize | {Ok(s.inner()?[idx])}" ,
586- " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (usize ,i32)| {s.val_mut(|s| Ok(s[idx] = val))?}"
581+ " (MetaMethod::Index) => |_,s,idx: LuaIndex | {Ok(s.inner()?[* idx])}" ,
582+ " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (LuaIndex ,i32)| {s.val_mut(|s| Ok(s[* idx] = val))?}"
587583]
588584import_path =" glam::i32::IVec2"
589585
590586[[types ]]
591587type =" IVec3"
592588source =" bevy_math"
593589lua_methods =[
594- " (MetaMethod::Index) => |_,s,idx: usize | {Ok(s.inner()?[idx])}" ,
595- " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (usize ,i32)| {s.val_mut(|s| Ok(s[idx] = val))?}"
590+ " (MetaMethod::Index) => |_,s,idx: LuaIndex | {Ok(s.inner()?[* idx])}" ,
591+ " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (LuaIndex ,i32)| {s.val_mut(|s| Ok(s[* idx] = val))?}"
596592]
597593import_path =" glam::i32::IVec3"
598594
599595[[types ]]
600596type =" IVec4"
601597source =" bevy_math"
602598lua_methods =[
603- " (MetaMethod::Index) => |_,s,idx: usize | {Ok(s.inner()?[idx])}" ,
604- " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (usize ,i32)| {s.val_mut(|s| Ok(s[idx] = val))?}"
599+ " (MetaMethod::Index) => |_,s,idx: LuaIndex | {Ok(s.inner()?[* idx])}" ,
600+ " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (LuaIndex ,i32)| {s.val_mut(|s| Ok(s[* idx] = val))?}"
605601]
606602import_path =" glam::i32::IVec4"
607603
608604[[types ]]
609605type =" UVec2"
610606source =" bevy_math"
611607lua_methods =[
612- " (MetaMethod::Index) => |_,s,idx: usize | {Ok(s.inner()?[idx])}" ,
613- " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (usize ,u32)| {s.val_mut(|s| Ok(s[idx] = val))?}"
608+ " (MetaMethod::Index) => |_,s,idx: LuaIndex | {Ok(s.inner()?[* idx])}" ,
609+ " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (LuaIndex ,u32)| {s.val_mut(|s| Ok(s[* idx] = val))?}"
614610]
615611import_path =" glam::u32::UVec2"
616612
617613[[types ]]
618614type =" UVec3"
619615source =" bevy_math"
620616lua_methods =[
621- " (MetaMethod::Index) => |_,s,idx: usize | {Ok(s.inner()?[idx])}" ,
622- " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (usize ,u32)| {s.val_mut(|s| Ok(s[idx] = val))?}"
617+ " (MetaMethod::Index) => |_,s,idx: LuaIndex | {Ok(s.inner()?[* idx])}" ,
618+ " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (LuaIndex ,u32)| {s.val_mut(|s| Ok(s[* idx] = val))?}"
623619]
624620import_path =" glam::u32::UVec3"
625621
626622[[types ]]
627623type =" UVec4"
628624source =" bevy_math"
629625lua_methods =[
630- " (MetaMethod::Index) => |_,s,idx: usize | {Ok(s.inner()?[idx])}" ,
631- " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (usize ,u32)| {s.val_mut(|s| Ok(s[idx] = val))?}"
626+ " (MetaMethod::Index) => |_,s,idx: LuaIndex | {Ok(s.inner()?[* idx])}" ,
627+ " mut (MetaMethod::NewIndex) => |_,s,(idx,val): (LuaIndex ,u32)| {s.val_mut(|s| Ok(s[* idx] = val))?}"
632628]
633629import_path =" glam::u32::UVec4"
634630
@@ -637,11 +633,11 @@ type="Mat3"
637633source =" bevy_math"
638634lua_methods =[
639635"""
640- mut (MetaMethod::Index) => |ctx,s,idx : usize | {
636+ mut (MetaMethod::Index) => |ctx,s,idx : LuaIndex | {
641637 Ok(LuaVec3::new_ref(
642638 s.script_ref(ctx.get_world()?).sub_ref(ReflectPathElem::SubReflectionIndexed{
643639 label:"col",
644- index: idx,
640+ index: * idx,
645641 get: |idx,ref_| Err(ReflectionError::InsufficientProvenance{
646642 path: "".to_owned(),
647643 msg: "Cannot get column of matrix with immutable reference".to_owned()
@@ -668,11 +664,11 @@ type="Mat2"
668664source =" bevy_math"
669665lua_methods =[
670666"""
671- mut (MetaMethod::Index) => |ctx,s,idx : usize | {
667+ mut (MetaMethod::Index) => |ctx,s,idx : LuaIndex | {
672668 Ok(LuaVec2::new_ref(
673669 s.script_ref(ctx.get_world()?).sub_ref(ReflectPathElem::SubReflectionIndexed{
674670 label:"col",
675- index: idx,
671+ index: * idx,
676672 get: |idx,ref_| Err(ReflectionError::InsufficientProvenance{
677673 path: "".to_owned(),
678674 msg: "Cannot get column of matrix with immutable reference".to_owned()
@@ -700,11 +696,11 @@ type="Mat3A"
700696source =" bevy_math"
701697lua_methods =[
702698"""
703- mut (MetaMethod::Index) => |ctx,s,idx : usize | {
699+ mut (MetaMethod::Index) => |ctx,s,idx : LuaIndex | {
704700 Ok(LuaVec3A::new_ref(
705701 s.script_ref(ctx.get_world()?).sub_ref(ReflectPathElem::SubReflectionIndexed{
706702 label:"col",
707- index: idx,
703+ index: * idx,
708704 get: |idx,ref_| Err(ReflectionError::InsufficientProvenance{
709705 path: "".to_owned(),
710706 msg: "Cannot get column of matrix with immutable reference".to_owned()
@@ -731,11 +727,11 @@ type="Mat4"
731727source =" bevy_math"
732728lua_methods =[
733729"""
734- mut (MetaMethod::Index) => |ctx,s,idx : usize | {
730+ mut (MetaMethod::Index) => |ctx,s,idx : LuaIndex | {
735731 Ok(LuaVec4::new_ref(
736732 s.script_ref(ctx.get_world()?).sub_ref(ReflectPathElem::SubReflectionIndexed{
737733 label:"col",
738- index: idx,
734+ index: * idx,
739735 get: |idx,ref_| Err(ReflectionError::InsufficientProvenance{
740736 path: "".to_owned(),
741737 msg: "Cannot get column of matrix with immutable reference".to_owned()
@@ -763,11 +759,11 @@ type="DMat2"
763759source =" bevy_math"
764760lua_methods =[
765761"""
766- mut (MetaMethod::Index) => |ctx,s,idx : usize | {
762+ mut (MetaMethod::Index) => |ctx,s,idx : LuaIndex | {
767763 Ok(LuaDVec2::new_ref(
768764 s.script_ref(ctx.get_world()?).sub_ref(ReflectPathElem::SubReflectionIndexed{
769765 label:"col",
770- index: idx,
766+ index: * idx,
771767 get: |idx,ref_| Err(ReflectionError::InsufficientProvenance{
772768 path: "".to_owned(),
773769 msg: "Cannot get column of matrix with immutable reference".to_owned()
@@ -794,11 +790,11 @@ type="DMat3"
794790source =" bevy_math"
795791lua_methods =[
796792"""
797- mut (MetaMethod::Index) => |ctx,s,idx : usize | {
793+ mut (MetaMethod::Index) => |ctx,s,idx : LuaIndex | {
798794 Ok(LuaDVec3::new_ref(
799795 s.script_ref(ctx.get_world()?).sub_ref(ReflectPathElem::SubReflectionIndexed{
800796 label:"col",
801- index: idx,
797+ index: * idx,
802798 get: |idx,ref_| Err(ReflectionError::InsufficientProvenance{
803799 path: "".to_owned(),
804800 msg: "Cannot get column of matrix with immutable reference".to_owned()
@@ -825,11 +821,11 @@ type="DMat4"
825821source =" bevy_math"
826822lua_methods =[
827823"""
828- mut (MetaMethod::Index) => |ctx,s,idx : usize | {
824+ mut (MetaMethod::Index) => |ctx,s,idx : LuaIndex | {
829825 Ok(LuaDVec4::new_ref(
830826 s.script_ref(ctx.get_world()?).sub_ref(ReflectPathElem::SubReflectionIndexed{
831827 label:"col",
832- index: idx,
828+ index: * idx,
833829 get: |idx,ref_| Err(ReflectionError::InsufficientProvenance{
834830 path: "".to_owned(),
835831 msg: "Cannot get column of matrix with immutable reference".to_owned()
0 commit comments