Updates for v9, begin ui rework
This commit is contained in:
+16
-18
@@ -1,6 +1,7 @@
|
||||
using Craftimizer.Plugin.Windows;
|
||||
using Craftimizer.Simulator;
|
||||
using Craftimizer.Utils;
|
||||
using Craftimizer.Windows;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.IoC;
|
||||
using Dalamud.Plugin;
|
||||
@@ -16,39 +17,35 @@ public sealed class Plugin : IDalamudPlugin
|
||||
public string Name => "Craftimizer";
|
||||
public string Version { get; }
|
||||
public string Author { get; }
|
||||
public string Configuration { get; }
|
||||
public string BuildConfiguration { get; }
|
||||
public TextureWrap Icon { get; }
|
||||
|
||||
public WindowSystem WindowSystem { get; }
|
||||
public Settings SettingsWindow { get; }
|
||||
public CraftingLog RecipeNoteWindow { get; }
|
||||
public Craftimizer.Windows.RecipeNote RecipeNoteWindow { get; }
|
||||
public Craft SynthesisWindow { get; }
|
||||
public Windows.Simulator? SimulatorWindow { get; set; }
|
||||
|
||||
public Configuration Configuration { get; }
|
||||
public Hooks Hooks { get; }
|
||||
public RecipeNote RecipeNote { get; }
|
||||
public Craftimizer.Utils.RecipeNote RecipeNote { get; }
|
||||
public IconManager IconManager { get; }
|
||||
|
||||
public Plugin([RequiredVersion("1.0")] DalamudPluginInterface pluginInterface)
|
||||
{
|
||||
Service.Plugin = this;
|
||||
pluginInterface.Create<Service>();
|
||||
Service.Configuration = pluginInterface.GetPluginConfig() as Configuration ?? new Configuration();
|
||||
Service.Initialize(this, pluginInterface);
|
||||
|
||||
Configuration = pluginInterface.GetPluginConfig() as Configuration ?? new();
|
||||
Hooks = new();
|
||||
RecipeNote = new();
|
||||
IconManager = new();
|
||||
WindowSystem = new(Name);
|
||||
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
Version = assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()!.InformationalVersion;
|
||||
Author = assembly.GetCustomAttribute<AssemblyCompanyAttribute>()!.Company;
|
||||
Configuration = assembly.GetCustomAttribute<AssemblyConfigurationAttribute>()!.Configuration;
|
||||
byte[] iconData;
|
||||
using (var stream = assembly.GetManifestResourceStream("Craftimizer.icon.png")!)
|
||||
{
|
||||
iconData = new byte[stream.Length];
|
||||
_ = stream.Read(iconData);
|
||||
}
|
||||
Icon = Service.PluginInterface.UiBuilder.LoadImage(iconData);
|
||||
|
||||
Hooks = new();
|
||||
RecipeNote = new();
|
||||
WindowSystem = new(Name);
|
||||
BuildConfiguration = assembly.GetCustomAttribute<AssemblyConfigurationAttribute>()!.Configuration;
|
||||
Icon = IconManager.GetAssemblyTexture("icon.png");
|
||||
|
||||
SettingsWindow = new();
|
||||
RecipeNoteWindow = new();
|
||||
@@ -86,5 +83,6 @@ public sealed class Plugin : IDalamudPlugin
|
||||
SynthesisWindow.Dispose();
|
||||
RecipeNote.Dispose();
|
||||
Hooks.Dispose();
|
||||
IconManager.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user