roblox_emulator: add Instance.Destroy aliases
This commit is contained in:
parent
985a703811
commit
2c8954c2b4
@ -261,12 +261,16 @@ impl mlua::UserData for Instance{
|
||||
}
|
||||
methods.add_method("isA",is_a);
|
||||
methods.add_method("IsA",is_a);
|
||||
methods.add_method("Destroy",|lua,this,()|
|
||||
fn destroy(lua:&mlua::Lua,this:&Instance,_:())->mlua::Result<()>{
|
||||
dom_mut(lua,|dom|{
|
||||
dom.transfer_within(this.referent,Ref::none());
|
||||
Ok(())
|
||||
})
|
||||
);
|
||||
}
|
||||
methods.add_method("remove",destroy);
|
||||
methods.add_method("Remove",destroy);
|
||||
methods.add_method("destroy",destroy);
|
||||
methods.add_method("Destroy",destroy);
|
||||
methods.add_meta_function(mlua::MetaMethod::ToString,|lua,this:Instance|{
|
||||
dom_mut(lua,|dom|{
|
||||
let instance=this.get(dom)?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user