pass in docs dependency to LuaFunctionsForm

This commit is contained in:
adelikat 2019-12-22 09:28:05 -06:00
parent eb6a2c3315
commit 75fee8c4af
2 changed files with 11 additions and 9 deletions

View File

@ -1161,7 +1161,7 @@ namespace BizHawk.Client.EmuHawk
private void FunctionsListMenuItem_Click(object sender, EventArgs e) private void FunctionsListMenuItem_Click(object sender, EventArgs e)
{ {
new LuaFunctionsForm().Show(); new LuaFunctionsForm(LuaImp.Docs).Show();
} }
private void OnlineDocsMenuItem_Click(object sender, EventArgs e) private void OnlineDocsMenuItem_Click(object sender, EventArgs e)

View File

@ -10,11 +10,19 @@ namespace BizHawk.Client.EmuHawk
{ {
public partial class LuaFunctionsForm : Form public partial class LuaFunctionsForm : Form
{ {
private readonly LuaDocumentation _docs;
private readonly Sorting _columnSort = new Sorting(); private readonly Sorting _columnSort = new Sorting();
private List<LibraryFunction> _functionList = new List<LibraryFunction>(); private List<LibraryFunction> _functionList = new List<LibraryFunction>();
private List<LibraryFunction> _filteredList = new List<LibraryFunction>(); private List<LibraryFunction> _filteredList = new List<LibraryFunction>();
public LuaFunctionsForm(LuaDocumentation docs)
{
_docs = docs;
InitializeComponent();
FunctionView.RetrieveVirtualItem += FunctionView_QueryItemText;
}
private void GenerateFilteredList() private void GenerateFilteredList()
{ {
if (!string.IsNullOrWhiteSpace(FilterBox.Text)) if (!string.IsNullOrWhiteSpace(FilterBox.Text))
@ -29,15 +37,9 @@ namespace BizHawk.Client.EmuHawk
} }
} }
public LuaFunctionsForm()
{
InitializeComponent();
FunctionView.RetrieveVirtualItem += FunctionView_QueryItemText;
}
private void LuaFunctionList_Load(object sender, EventArgs e) private void LuaFunctionList_Load(object sender, EventArgs e)
{ {
_functionList = GlobalWin.Tools.LuaConsole.LuaImp.Docs _functionList = _docs
.OrderBy(l => l.Library) .OrderBy(l => l.Library)
.ThenBy(l => l.Name) .ThenBy(l => l.Name)
.ToList(); .ToList();
@ -183,7 +185,7 @@ namespace BizHawk.Client.EmuHawk
private void ToWikiMarkupButton_Click(object sender, EventArgs e) private void ToWikiMarkupButton_Click(object sender, EventArgs e)
{ {
Clipboard.SetDataObject(GlobalWin.Tools.LuaConsole.LuaImp.Docs.ToTASVideosWikiMarkup()); Clipboard.SetDataObject(_docs.ToTASVideosWikiMarkup());
} }
} }
} }