mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-20 15:44:18 +01:00
commit
245742589c
3 changed files with 10 additions and 3 deletions
|
|
@ -107,7 +107,7 @@ namespace Dalamud.Interface.Internal.Scratchpad
|
||||||
var pluginType = script.ContinueWith<Type>("return typeof(ScratchPlugin);")
|
var pluginType = script.ContinueWith<Type>("return typeof(ScratchPlugin);")
|
||||||
.RunAsync().GetAwaiter().GetResult().ReturnValue;
|
.RunAsync().GetAwaiter().GetResult().ReturnValue;
|
||||||
|
|
||||||
var pi = new DalamudPluginInterface($"Scratch-{doc.Id}", PluginLoadReason.Unknown);
|
var pi = new DalamudPluginInterface($"Scratch-{doc.Id}", PluginLoadReason.Unknown, false);
|
||||||
|
|
||||||
var ioc = Service<ServiceContainer>.Get();
|
var ioc = Service<ServiceContainer>.Get();
|
||||||
var plugin = ioc.Create(pluginType, pi);
|
var plugin = ioc.Create(pluginType, pi);
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,8 @@ namespace Dalamud.Plugin
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="pluginName">The internal name of the plugin.</param>
|
/// <param name="pluginName">The internal name of the plugin.</param>
|
||||||
/// <param name="reason">The reason the plugin was loaded.</param>
|
/// <param name="reason">The reason the plugin was loaded.</param>
|
||||||
internal DalamudPluginInterface(string pluginName, PluginLoadReason reason)
|
/// <param name="isDev">A value indicating whether this is a dev plugin.</param>
|
||||||
|
internal DalamudPluginInterface(string pluginName, PluginLoadReason reason, bool isDev)
|
||||||
{
|
{
|
||||||
var configuration = Service<DalamudConfiguration>.Get();
|
var configuration = Service<DalamudConfiguration>.Get();
|
||||||
var dataManager = Service<DataManager>.Get();
|
var dataManager = Service<DataManager>.Get();
|
||||||
|
|
@ -47,6 +48,7 @@ namespace Dalamud.Plugin
|
||||||
this.pluginName = pluginName;
|
this.pluginName = pluginName;
|
||||||
this.configs = Service<PluginManager>.Get().PluginConfigs;
|
this.configs = Service<PluginManager>.Get().PluginConfigs;
|
||||||
this.Reason = reason;
|
this.Reason = reason;
|
||||||
|
this.IsDev = isDev;
|
||||||
|
|
||||||
this.LoadTime = DateTime.Now;
|
this.LoadTime = DateTime.Now;
|
||||||
this.LoadTimeUTC = DateTime.UtcNow;
|
this.LoadTimeUTC = DateTime.UtcNow;
|
||||||
|
|
@ -86,6 +88,11 @@ namespace Dalamud.Plugin
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public PluginLoadReason Reason { get; }
|
public PluginLoadReason Reason { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether this is a dev plugin.
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDev { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the time that this plugin was loaded.
|
/// Gets the time that this plugin was loaded.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -288,7 +288,7 @@ namespace Dalamud.Plugin.Internal
|
||||||
// Update the location for the Location and CodeBase patches
|
// Update the location for the Location and CodeBase patches
|
||||||
PluginManager.PluginLocations[this.pluginType.Assembly.FullName] = new(this.DllFile);
|
PluginManager.PluginLocations[this.pluginType.Assembly.FullName] = new(this.DllFile);
|
||||||
|
|
||||||
this.DalamudInterface = new DalamudPluginInterface(this.pluginAssembly.GetName().Name!, reason);
|
this.DalamudInterface = new DalamudPluginInterface(this.pluginAssembly.GetName().Name!, reason, this.IsDev);
|
||||||
|
|
||||||
var ioc = Service<ServiceContainer>.Get();
|
var ioc = Service<ServiceContainer>.Get();
|
||||||
this.instance = ioc.Create(this.pluginType, this.DalamudInterface) as IDalamudPlugin;
|
this.instance = ioc.Create(this.pluginType, this.DalamudInterface) as IDalamudPlugin;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue