Remove AssemblyLocation from PluginInterface ctor

Hooks work better.
This commit is contained in:
Raymond 2021-08-09 11:06:18 -04:00
parent 64bc2ddee4
commit ff5502baa8
4 changed files with 5 additions and 12 deletions

View file

@ -83,7 +83,7 @@ namespace Dalamud.Interface.Internal.Scratchpad
{
var script = CSharpScript.Create(code, options);
var pi = new DalamudPluginInterface(this.dalamud, "Scratch-" + doc.Id, null, PluginLoadReason.Unknown);
var pi = new DalamudPluginInterface(this.dalamud, "Scratch-" + doc.Id, PluginLoadReason.Unknown);
var plugin = script.ContinueWith<IDalamudPlugin>("return new ScratchPlugin() as IDalamudPlugin;")
.RunAsync().GetAwaiter().GetResult().ReturnValue;

View file

@ -468,8 +468,8 @@ namespace Dalamud.Interface.Internal.Windows
private void DrawPluginIPC()
{
#pragma warning disable CS0618 // Type or member is obsolete
var i1 = new DalamudPluginInterface(this.dalamud, "DalamudTestSub", null, PluginLoadReason.Unknown);
var i2 = new DalamudPluginInterface(this.dalamud, "DalamudTestPub", null, PluginLoadReason.Unknown);
var i1 = new DalamudPluginInterface(this.dalamud, "DalamudTestSub", PluginLoadReason.Unknown);
var i2 = new DalamudPluginInterface(this.dalamud, "DalamudTestPub", PluginLoadReason.Unknown);
if (ImGui.Button("Add test sub"))
{

View file

@ -35,9 +35,8 @@ namespace Dalamud.Plugin
/// </summary>
/// <param name="dalamud">The dalamud instance to expose.</param>
/// <param name="pluginName">The internal name of the plugin.</param>
/// <param name="assemblyLocation">The equivalent of what Assembly.GetExecutingAssembly().Location should return.</param>
/// <param name="reason">The reason the plugin was loaded.</param>
internal DalamudPluginInterface(Dalamud dalamud, string pluginName, string assemblyLocation, PluginLoadReason reason)
internal DalamudPluginInterface(Dalamud dalamud, string pluginName, PluginLoadReason reason)
{
this.CommandManager = dalamud.CommandManager;
this.Framework = dalamud.Framework;
@ -50,7 +49,6 @@ namespace Dalamud.Plugin
this.dalamud = dalamud;
this.pluginName = pluginName;
this.configs = dalamud.PluginManager.PluginConfigs;
this.AssemblyLocation = assemblyLocation;
this.Reason = reason;
this.GeneralChatType = this.dalamud.Configuration.GeneralChatType;
@ -88,11 +86,6 @@ namespace Dalamud.Plugin
/// </summary>
public PluginLoadReason Reason { get; }
/// <summary>
/// Gets the plugin assembly location.
/// </summary>
public string AssemblyLocation { get; private set; }
/// <summary>
/// Gets the directory Dalamud assets are stored in.
/// </summary>

View file

@ -272,7 +272,7 @@ namespace Dalamud.Plugin.Internal
this.Manifest.Save(this.manifestFile);
}
this.DalamudInterface = new DalamudPluginInterface(this.dalamud, this.pluginAssembly.GetName().Name, this.DllFile.FullName, reason);
this.DalamudInterface = new DalamudPluginInterface(this.dalamud, this.pluginAssembly.GetName().Name, reason);
if (this.IsDev)
{