From 748f544a4b94f85a417218fe057af5ab96b0b455 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 3 Oct 2024 18:03:42 -0700 Subject: [PATCH] ClassName --- src/runner/instance.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/runner/instance.rs b/src/runner/instance.rs index 2464224..720b7a3 100644 --- a/src/runner/instance.rs +++ b/src/runner/instance.rs @@ -112,6 +112,12 @@ impl Instance{ Ok(()) }) }); + fields.add_field_method_get("ClassName",|lua,this|{ + dom(lua,|dom|{ + let instance=this.get(dom)?; + Ok(instance.class.clone()) + }) + }); } fn composition_add_methods<'lua,T:Referent,M:mlua::UserDataMethods<'lua,T>>(methods:&mut M){ methods.add_method("GetChildren",|lua,this,_:()|