wip runservice

This commit is contained in:
Quaternions 2024-10-17 11:33:20 -07:00
parent da169ade70
commit 3dd46258b2

View File

@ -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))
}, },