Revamp UI and all sortsa stuff
This commit is contained in:
+24
-11
@@ -1,8 +1,13 @@
|
||||
using Craftimizer.Plugin.Windows;
|
||||
using Craftimizer.Simulator;
|
||||
using Craftimizer.Simulator.Actions;
|
||||
using Dalamud.Game.Command;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.IoC;
|
||||
using Dalamud.Plugin;
|
||||
using Lumina.Excel.GeneratedSheets;
|
||||
using System.Collections.Generic;
|
||||
using ClassJob = Craftimizer.Simulator.ClassJob;
|
||||
|
||||
namespace Craftimizer.Plugin;
|
||||
|
||||
@@ -10,22 +15,21 @@ public sealed class Plugin : IDalamudPlugin
|
||||
{
|
||||
public string Name => "Craftimizer";
|
||||
|
||||
public Configuration Configuration { get; }
|
||||
public WindowSystem WindowSystem { get; } = new("Craftimizer");
|
||||
public SimulatorWindow SimulatorWindow { get; }
|
||||
public WindowSystem WindowSystem { get; }
|
||||
public SettingsWindow SettingsWindow { get; }
|
||||
public CraftingLog RecipeNoteWindow { get; }
|
||||
public SimulatorWindow? SimulatorWindow { get; set; }
|
||||
|
||||
public Plugin(
|
||||
[RequiredVersion("1.0")] DalamudPluginInterface pluginInterface)
|
||||
public Plugin([RequiredVersion("1.0")] DalamudPluginInterface pluginInterface)
|
||||
{
|
||||
Service.Plugin = this;
|
||||
pluginInterface.Create<Service>();
|
||||
Service.Configuration = pluginInterface.GetPluginConfig() as Configuration ?? new Configuration();
|
||||
|
||||
Configuration = pluginInterface.GetPluginConfig() as Configuration ?? new Configuration();
|
||||
WindowSystem = new(Name);
|
||||
|
||||
SimulatorWindow = new();
|
||||
WindowSystem.AddWindow(SimulatorWindow);
|
||||
RecipeNoteWindow = new();
|
||||
WindowSystem.AddWindow(RecipeNoteWindow);
|
||||
SettingsWindow = new();
|
||||
|
||||
Service.CommandManager.AddHandler("/craft", new CommandInfo(OnCommand)
|
||||
{
|
||||
@@ -33,8 +37,17 @@ public sealed class Plugin : IDalamudPlugin
|
||||
});
|
||||
|
||||
Service.PluginInterface.UiBuilder.Draw += WindowSystem.Draw;
|
||||
Service.PluginInterface.UiBuilder.OpenConfigUi += () => SimulatorWindow.IsOpen = true;
|
||||
Service.PluginInterface.UiBuilder.OpenConfigUi += () => SettingsWindow.IsOpen = true;
|
||||
}
|
||||
|
||||
public void OpenSimulatorWindow(Item item, SimulationInput input, ClassJob classJob, List<ActionType> actions)
|
||||
{
|
||||
if (SimulatorWindow != null)
|
||||
{
|
||||
SimulatorWindow.IsOpen = false;
|
||||
WindowSystem.RemoveWindow(SimulatorWindow);
|
||||
}
|
||||
SimulatorWindow = new(item, input, classJob, actions);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
@@ -47,6 +60,6 @@ public sealed class Plugin : IDalamudPlugin
|
||||
if (command != "/craft")
|
||||
return;
|
||||
|
||||
SimulatorWindow.IsOpen = true;
|
||||
SettingsWindow.IsOpen = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user