mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 12:23:39 +01:00
Add Complicated Tweaks
This commit is contained in:
parent
0d621bc944
commit
81aacb56ee
2 changed files with 77 additions and 0 deletions
|
|
@ -144,6 +144,15 @@ internal class FoolsManager : IDisposable, IServiceType
|
||||||
RealAuthor = "Berna",
|
RealAuthor = "Berna",
|
||||||
Type = typeof(YesHealMePlugin),
|
Type = typeof(YesHealMePlugin),
|
||||||
},
|
},
|
||||||
|
new()
|
||||||
|
{
|
||||||
|
Name = "Complicated Tweaks",
|
||||||
|
InternalName = "ComplicatedTweaksPlugin",
|
||||||
|
Description = "As complicated as it gets!",
|
||||||
|
Author = "Caraxi",
|
||||||
|
RealAuthor = "NotNite",
|
||||||
|
Type = typeof(ComplicatedTweaksPlugin),
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
68
Dalamud/Fools/Plugins/ComplicatedTweaksPlugin.cs
Normal file
68
Dalamud/Fools/Plugins/ComplicatedTweaksPlugin.cs
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using ImGuiNET;
|
||||||
|
|
||||||
|
namespace Dalamud.Fools.Plugins;
|
||||||
|
|
||||||
|
public class ComplicatedTweaksPlugin : IFoolsPlugin
|
||||||
|
{
|
||||||
|
enum Widget
|
||||||
|
{
|
||||||
|
Button,
|
||||||
|
Checkbox,
|
||||||
|
DragFloat,
|
||||||
|
InputFloat,
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Widget> widgets;
|
||||||
|
|
||||||
|
public ComplicatedTweaksPlugin()
|
||||||
|
{
|
||||||
|
this.widgets = new List<Widget>();
|
||||||
|
|
||||||
|
var random = new Random();
|
||||||
|
var possibleWidgets = Enum.GetValues(typeof(Widget)).Cast<Widget>().ToList();
|
||||||
|
|
||||||
|
for (var i = 0; i < 100; i++)
|
||||||
|
{
|
||||||
|
var widget = possibleWidgets[random.Next(possibleWidgets.Count)];
|
||||||
|
this.widgets.Add(widget);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DrawUi()
|
||||||
|
{
|
||||||
|
if (ImGui.Begin("Complicated Tweaks"))
|
||||||
|
{
|
||||||
|
foreach (var widget in this.widgets)
|
||||||
|
{
|
||||||
|
switch (widget)
|
||||||
|
{
|
||||||
|
case Widget.Button:
|
||||||
|
ImGui.Button("Click me!");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Widget.Checkbox:
|
||||||
|
var iHateImgui = false;
|
||||||
|
ImGui.Checkbox(string.Empty, ref iHateImgui);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Widget.DragFloat:
|
||||||
|
var dragFloat = 0f;
|
||||||
|
ImGui.DragFloat(string.Empty, ref dragFloat);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Widget.InputFloat:
|
||||||
|
var inputFloat = 0f;
|
||||||
|
ImGui.InputFloat(string.Empty, ref inputFloat);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose() { }
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue