wip runservice
This commit is contained in:
parent
bffc5bb8f1
commit
43ab764b18
@ -369,12 +369,13 @@ static CLASS_FUNCTION_DATABASE:CFD=phf::phf_map!{
|
|||||||
"GetService"=>cf!(|lua,_this,service:mlua::String|{
|
"GetService"=>cf!(|lua,_this,service:mlua::String|{
|
||||||
dom_mut(lua,|dom|{
|
dom_mut(lua,|dom|{
|
||||||
//dom.root_ref()==this.referent ?
|
//dom.root_ref()==this.referent ?
|
||||||
match &*service.to_str()?{
|
let service=&*service.to_str()?;
|
||||||
"Lighting"=>{
|
match service{
|
||||||
let referent=find_first_child_of_class(dom,dom.root(),"Lighting")
|
"Lighting"|"RunService"=>{
|
||||||
|
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(||
|
||||||
dom.insert(dom.root_ref(),InstanceBuilder::new("Lighting"))
|
dom.insert(dom.root_ref(),InstanceBuilder::new(service))
|
||||||
);
|
);
|
||||||
Ok(Instance::new(referent))
|
Ok(Instance::new(referent))
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user