roblox_emulator: support Workspace & MaterialService via GetService
This commit is contained in:
@ -427,7 +427,7 @@ const GET_SERVICE:ClassFunctionPointer=cf!(|lua,_this,service:mlua::String|{
|
|||||||
//dom.root_ref()==this.referent ?
|
//dom.root_ref()==this.referent ?
|
||||||
let service=&*service.to_str()?;
|
let service=&*service.to_str()?;
|
||||||
match service{
|
match service{
|
||||||
"Lighting"|"RunService"|"Players"=>{
|
"Lighting"|"RunService"|"Players"|"Workspace"|"MaterialService"=>{
|
||||||
let referent=find_first_child_of_class(dom,dom.root(),service)
|
let referent=find_first_child_of_class(dom,dom.root(),service)
|
||||||
.map(|instance|instance.referent())
|
.map(|instance|instance.referent())
|
||||||
.unwrap_or_else(||
|
.unwrap_or_else(||
|
||||||
@ -435,7 +435,7 @@ const GET_SERVICE:ClassFunctionPointer=cf!(|lua,_this,service:mlua::String|{
|
|||||||
);
|
);
|
||||||
Ok(Instance::new_unchecked(referent))
|
Ok(Instance::new_unchecked(referent))
|
||||||
},
|
},
|
||||||
other=>Err::<Instance,_>(mlua::Error::runtime(format!("Service '{other}' not supported"))),
|
other=>Err(mlua::Error::runtime(format!("Service '{other}' not supported"))),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user