roblox_emulator: implement __newindex Instance
This commit is contained in:
parent
3b8d32913e
commit
5ea0a1b07d
@ -345,6 +345,11 @@ impl mlua::UserData for Instance{
|
||||
let typed_value=value.as_str().ok_or_else(||mlua::Error::runtime("Expected string"))?.to_owned();
|
||||
rbx_types::Variant::ContentId(typed_value.into())
|
||||
},
|
||||
rbx_reflection::DataType::Value(rbx_types::VariantType::Ref)=>{
|
||||
// why clone?
|
||||
let typed_value=Option::<Instance>::from_lua(value.clone(),lua)?;
|
||||
rbx_types::Variant::Ref(typed_value.map_or(Ref::none(),|instance|instance.referent))
|
||||
},
|
||||
other=>return Err(mlua::Error::runtime(format!("Unimplemented property type: {other:?}"))),
|
||||
};
|
||||
// the index is known to be a real property at this point
|
||||
|
Loading…
x
Reference in New Issue
Block a user