File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/BizHawk.Client.EmuHawk/tools/Lua Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -37,16 +37,18 @@ public LuaLibraries(
3737
3838 void EnumerateLuaFunctions ( string name , Type type , LuaLibraryBase instance )
3939 {
40+ var libraryDesc = type . GetCustomAttributes ( typeof ( DescriptionAttribute ) , false ) . Cast < DescriptionAttribute > ( )
41+ . Select ( static descAttr => descAttr . Description )
42+ . FirstOrDefault ( ) ?? string . Empty ;
4043 if ( instance != null ) _lua . NewTable ( name ) ;
4144 foreach ( var method in type . GetMethods ( ) )
4245 {
4346 var foundAttrs = method . GetCustomAttributes ( typeof ( LuaMethodAttribute ) , false ) ;
4447 if ( foundAttrs . Length == 0 ) continue ;
4548 if ( instance != null ) _lua . RegisterFunction ( $ "{ name } .{ ( ( LuaMethodAttribute ) foundAttrs [ 0 ] ) . Name } ", instance , method ) ;
4649 LibraryFunction libFunc = new (
47- name ,
48- type . GetCustomAttributes ( typeof ( DescriptionAttribute ) , false ) . Cast < DescriptionAttribute > ( )
49- . Select ( descAttr => descAttr . Description ) . FirstOrDefault ( ) ?? string . Empty ,
50+ library : name ,
51+ libraryDescription : libraryDesc ,
5052 method ,
5153 suggestInREPL : false
5254 ) ;
You can’t perform that action at this time.
0 commit comments