diff --git a/src/BizHawk.Client.Common/Api/Interfaces/IToolApi.cs b/src/BizHawk.Client.Common/Api/Interfaces/IToolApi.cs index 37b3e0eaa75..924384f155a 100644 --- a/src/BizHawk.Client.Common/Api/Interfaces/IToolApi.cs +++ b/src/BizHawk.Client.Common/Api/Interfaces/IToolApi.cs @@ -6,14 +6,23 @@ namespace BizHawk.Client.Common public interface IToolApi : IExternalApi { IEnumerable AvailableTools { get; } - Type GetTool(string name); + object CreateInstance(string name); + + IToolForm GetTool(string name); + void OpenCheats(); + void OpenHexEditor(); - void OpenRamWatch(); + void OpenRamSearch(); + + void OpenRamWatch(); + void OpenTasStudio(); + void OpenToolBox(); + void OpenTraceLogger(); } } diff --git a/src/BizHawk.Client.EmuHawk/Api/Libraries/ToolApi.cs b/src/BizHawk.Client.EmuHawk/Api/Libraries/ToolApi.cs index eb058ba65ab..b46073ee063 100644 --- a/src/BizHawk.Client.EmuHawk/Api/Libraries/ToolApi.cs +++ b/src/BizHawk.Client.EmuHawk/Api/Libraries/ToolApi.cs @@ -15,11 +15,11 @@ public sealed class ToolApi : IToolApi public ToolApi(ToolManager toolManager) => _toolManager = toolManager; - public Type GetTool(string name) + public IToolForm GetTool(string name) { var toolType = Util.GetTypeByName(name).FirstOrDefault(x => typeof(IToolForm).IsAssignableFrom(x) && !x.IsInterface); - if (toolType != null) _toolManager.Load(toolType); - return _toolManager.AvailableTools.FirstOrDefault(tool => tool.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)); + if (toolType == null) return null; + return _toolManager.Load(toolType); } public object CreateInstance(string name)