58 lines
1.7 KiB
C#
58 lines
1.7 KiB
C#
using System;
|
|
using System.Numerics;
|
|
using Dalamud.Interface.Windowing;
|
|
using ImGuiNET;
|
|
|
|
namespace DalamudShock.Windows
|
|
{
|
|
public class ConfigWindow : Window, IDisposable
|
|
{
|
|
private Configuration Configuration;
|
|
public ConfigWindow(Plugin plugin) : base("DalamudShock Config###With a constant ID")
|
|
{
|
|
Flags = ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoScrollbar |
|
|
ImGuiWindowFlags.NoScrollWithMouse;
|
|
Size = new Vector2(400, 200);
|
|
SizeCondition = ImGuiCond.Always;
|
|
Configuration = plugin.Configuration;
|
|
}
|
|
|
|
public void Dispose() { }
|
|
|
|
public override void PreDraw()
|
|
{
|
|
if (Configuration.IsConfigWindowMovable)
|
|
{
|
|
Flags &= ~ImGuiWindowFlags.NoMove;
|
|
}
|
|
else
|
|
{
|
|
Flags |= ImGuiWindowFlags.NoMove;
|
|
}
|
|
}
|
|
|
|
public override void Draw()
|
|
{
|
|
var apiKey = Configuration.openshockApiKey;
|
|
if (ImGui.InputText("OpenShock API Key", ref apiKey, 100))
|
|
{
|
|
Configuration.openshockApiKey = apiKey;
|
|
Configuration.Save();
|
|
}
|
|
|
|
var shockerID = Configuration.OpenshockShockerID;
|
|
if (ImGui.InputText("OpenShock Shocker ID", ref shockerID, 100))
|
|
{
|
|
Configuration.OpenshockShockerID = shockerID;
|
|
Configuration.Save();
|
|
}
|
|
var maxShock = Configuration.MaxValue;
|
|
if (ImGui.SliderInt("Intensity cap", ref maxShock, 0, 100))
|
|
{
|
|
Configuration.MaxValue = maxShock;
|
|
Configuration.Save();
|
|
}
|
|
}
|
|
}
|
|
}
|