parent
7149609229
commit
ea810cb89b
|
@ -198,11 +198,14 @@ namespace BizHawk.Client.Common
|
|||
private readonly LuaMethodAttribute _luaAttributes;
|
||||
private readonly LuaMethodExampleAttribute _luaExampleAttribute;
|
||||
|
||||
public LibraryFunction(string library, string libraryDescription, MethodInfo method)
|
||||
public readonly bool SuggestInREPL;
|
||||
|
||||
public LibraryFunction(string library, string libraryDescription, MethodInfo method, bool suggestInREPL = true)
|
||||
{
|
||||
_luaAttributes = method.GetCustomAttribute<LuaMethodAttribute>(false);
|
||||
_luaExampleAttribute = method.GetCustomAttribute<LuaMethodExampleAttribute>(false);
|
||||
Method = method;
|
||||
SuggestInREPL = suggestInREPL;
|
||||
|
||||
IsDeprecated = method.GetCustomAttribute<LuaDeprecatedMethodAttribute>(false) != null;
|
||||
Library = library;
|
||||
|
|
|
@ -220,7 +220,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
Emulator,
|
||||
Game);
|
||||
|
||||
InputBox.AutoCompleteCustomSource.AddRange(LuaImp.Docs.Select(a => $"{a.Library}.{a.Name}").ToArray());
|
||||
InputBox.AutoCompleteCustomSource.AddRange(LuaImp.Docs.Where(static f => f.SuggestInREPL)
|
||||
.Select(static f => $"{f.Library}.{f.Name}")
|
||||
.ToArray());
|
||||
|
||||
foreach (var file in runningScripts)
|
||||
{
|
||||
|
|
|
@ -47,7 +47,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
name,
|
||||
type.GetCustomAttributes(typeof(DescriptionAttribute), false).Cast<DescriptionAttribute>()
|
||||
.Select(descAttr => descAttr.Description).FirstOrDefault() ?? string.Empty,
|
||||
method
|
||||
method,
|
||||
suggestInREPL: false
|
||||
);
|
||||
Docs.Add(libFunc);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue