roblox_emulator: implement __index Color3
This commit is contained in:
parent
3928431ac7
commit
3b8d32913e
lib/roblox_emulator/src/runner
@ -12,9 +12,14 @@ impl Color3{
|
||||
Color3::new(r as f32/255.0,g as f32/255.0,b as f32/255.0)
|
||||
}
|
||||
}
|
||||
impl Into<rbx_types::Color3> for Color3{
|
||||
fn into(self)->rbx_types::Color3{
|
||||
rbx_types::Color3::new(self.r,self.g,self.b)
|
||||
impl From<rbx_types::Color3> for Color3{
|
||||
fn from(value:rbx_types::Color3)->Color3{
|
||||
Color3::new(value.r,value.g,value.b)
|
||||
}
|
||||
}
|
||||
impl From<Color3> for rbx_types::Color3{
|
||||
fn from(value:Color3)->rbx_types::Color3{
|
||||
rbx_types::Color3::new(value.r,value.g,value.b)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -252,6 +252,7 @@ impl mlua::UserData for Instance{
|
||||
Some(rbx_types::Variant::Float64(val))=>return val.into_lua(lua),
|
||||
Some(rbx_types::Variant::String(val))=>return val.into_lua(lua),
|
||||
Some(rbx_types::Variant::Ref(val))=>return Instance::new_unchecked(val).into_lua(lua),
|
||||
Some(rbx_types::Variant::Color3(c))=>return Into::<crate::runner::color3::Color3>::into(c).into_lua(lua),
|
||||
Some(rbx_types::Variant::CFrame(cf))=>return Into::<crate::runner::cframe::CFrame>::into(cf).into_lua(lua),
|
||||
Some(rbx_types::Variant::Vector3(v))=>return Into::<crate::runner::vector3::Vector3>::into(v).into_lua(lua),
|
||||
None=>(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user