parent
3c3ab6578e
commit
a86860faaa
|
@ -187,11 +187,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (requestedExtToolDll != null)
|
if (requestedExtToolDll != null)
|
||||||
{
|
{
|
||||||
var found = ExtToolManager.ToolStripMenu.Where(static item => item.Enabled)
|
var found = ExtToolManager.ToolStripMenu.Where(static item => item.Enabled)
|
||||||
.Select(static item => ((string, string)) item.Tag)
|
.Select(static item => (ExternalToolManager.MenuItemInfo) item.Tag)
|
||||||
.FirstOrNull(tuple => tuple.Item1 == requestedExtToolDll
|
.FirstOrNull(info => info.AsmFilename == requestedExtToolDll
|
||||||
|| Path.GetFileName(tuple.Item1) == requestedExtToolDll
|
|| Path.GetFileName(info.AsmFilename) == requestedExtToolDll
|
||||||
|| Path.GetFileNameWithoutExtension(tuple.Item1) == requestedExtToolDll);
|
|| Path.GetFileNameWithoutExtension(info.AsmFilename) == requestedExtToolDll);
|
||||||
if (found is not null) Tools.LoadExternalToolForm(found.Value.Item1, found.Value.Item2, skipExtToolWarning: true);
|
if (found is not null) found.Value.TryLoad();
|
||||||
else Console.WriteLine($"requested ext. tool dll {requestedExtToolDll} could not be loaded");
|
else Console.WriteLine($"requested ext. tool dll {requestedExtToolDll} could not be loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,14 +18,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
private readonly string _asmChecksum;
|
private readonly string _asmChecksum;
|
||||||
|
|
||||||
private readonly string _asmFilename;
|
|
||||||
|
|
||||||
private readonly string _entryPointTypeName;
|
private readonly string _entryPointTypeName;
|
||||||
|
|
||||||
private readonly ExternalToolManager _extToolMan;
|
private readonly ExternalToolManager _extToolMan;
|
||||||
|
|
||||||
private bool _skipExtToolWarning;
|
private bool _skipExtToolWarning;
|
||||||
|
|
||||||
|
public readonly string AsmFilename;
|
||||||
|
|
||||||
public MenuItemInfo(
|
public MenuItemInfo(
|
||||||
ExternalToolManager extToolMan,
|
ExternalToolManager extToolMan,
|
||||||
string asmChecksum,
|
string asmChecksum,
|
||||||
|
@ -33,21 +33,21 @@ namespace BizHawk.Client.EmuHawk
|
||||||
string entryPointTypeName)
|
string entryPointTypeName)
|
||||||
{
|
{
|
||||||
_asmChecksum = asmChecksum;
|
_asmChecksum = asmChecksum;
|
||||||
_asmFilename = asmFilename;
|
|
||||||
_entryPointTypeName = entryPointTypeName;
|
_entryPointTypeName = entryPointTypeName;
|
||||||
_extToolMan = extToolMan;
|
_extToolMan = extToolMan;
|
||||||
_skipExtToolWarning = _extToolMan._config.TrustedExtTools.TryGetValue(_asmFilename, out var s) && s == _asmChecksum;
|
_skipExtToolWarning = _extToolMan._config.TrustedExtTools.TryGetValue(asmFilename, out var s) && s == _asmChecksum;
|
||||||
|
AsmFilename = asmFilename;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TryLoad()
|
public void TryLoad()
|
||||||
{
|
{
|
||||||
var success = _extToolMan._loadCallback(
|
var success = _extToolMan._loadCallback(
|
||||||
/*toolPath:*/ _asmFilename,
|
/*toolPath:*/ AsmFilename,
|
||||||
/*customFormTypeName:*/ _entryPointTypeName,
|
/*customFormTypeName:*/ _entryPointTypeName,
|
||||||
/*skipExtToolWarning:*/ _skipExtToolWarning);
|
/*skipExtToolWarning:*/ _skipExtToolWarning);
|
||||||
if (!success || _skipExtToolWarning) return;
|
if (!success || _skipExtToolWarning) return;
|
||||||
_skipExtToolWarning = true;
|
_skipExtToolWarning = true;
|
||||||
_extToolMan._config.TrustedExtTools[_asmFilename] = _asmChecksum;
|
_extToolMan._config.TrustedExtTools[AsmFilename] = _asmChecksum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue