roblox_emulator: implement __newindex ContentId

This commit is contained in:
Quaternions 2025-04-22 18:10:01 -07:00
parent 081c95190f
commit d722bcb46f
Signed by: Quaternions
GPG Key ID: D0DF5964F79AC131

@ -342,6 +342,10 @@ impl mlua::UserData for Instance{
let typed_value:crate::runner::color_sequence::ColorSequence=*value.as_userdata().ok_or_else(||mlua::Error::runtime("Expected ColorSequence"))?.borrow()?;
rbx_types::Variant::ColorSequence(typed_value.into())
},
rbx_reflection::DataType::Value(rbx_types::VariantType::ContentId)=>{
let typed_value=value.as_str().ok_or_else(||mlua::Error::runtime("Expected string"))?.to_owned();
rbx_types::Variant::ContentId(typed_value.into())
},
other=>return Err(mlua::Error::runtime(format!("Unimplemented property type: {other:?}"))),
};
// the index is known to be a real property at this point