Workship/Workshoppa/Windows/ConfigWindow.cs

47 lines
1.5 KiB
C#
Raw Normal View History

2023-10-13 20:08:22 +00:00
using System.Numerics;
using Dalamud.Plugin;
using ImGuiNET;
2024-03-20 18:52:54 +00:00
using LLib.ImGui;
2023-10-13 20:08:22 +00:00
namespace Workshoppa.Windows;
2024-03-20 18:52:54 +00:00
internal sealed class ConfigWindow : LWindow
2023-10-13 20:08:22 +00:00
{
private readonly DalamudPluginInterface _pluginInterface;
private readonly Configuration _configuration;
public ConfigWindow(DalamudPluginInterface pluginInterface, Configuration configuration)
: base("Workshoppa - Configuration###WorkshoppaConfigWindow")
{
_pluginInterface = pluginInterface;
_configuration = configuration;
Position = new Vector2(100, 100);
PositionCondition = ImGuiCond.FirstUseEver;
Flags = ImGuiWindowFlags.AlwaysAutoResize;
2024-05-11 12:02:08 +00:00
SizeConstraints = new WindowSizeConstraints
{
MinimumSize = new Vector2(270, 50),
};
2023-10-13 20:08:22 +00:00
}
public override void Draw()
{
bool enableRepairKitCalculator = _configuration.EnableRepairKitCalculator;
if (ImGui.Checkbox("Enable Repair Kit Calculator", ref enableRepairKitCalculator))
{
_configuration.EnableRepairKitCalculator = enableRepairKitCalculator;
_pluginInterface.SavePluginConfig(_configuration);
}
2023-10-24 22:19:42 +00:00
bool enableCeruleumTankCalculator = _configuration.EnableCeruleumTankCalculator;
if (ImGui.Checkbox("Enable Ceruleum Tank Calculator", ref enableCeruleumTankCalculator))
{
_configuration.EnableCeruleumTankCalculator = enableCeruleumTankCalculator;
_pluginInterface.SavePluginConfig(_configuration);
}
2023-10-13 20:08:22 +00:00
}
}