mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Add standalone testbed
This commit is contained in:
parent
5ddf473450
commit
b8ce2d4001
21 changed files with 948 additions and 2 deletions
36
imgui/StandaloneImGuiTestbed/Testbed.cs
Normal file
36
imgui/StandaloneImGuiTestbed/Testbed.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace StandaloneImGuiTestbed;
|
||||
|
||||
public class Testbed
|
||||
{
|
||||
private bool showDemoWindow = false;
|
||||
|
||||
public unsafe void Draw()
|
||||
{
|
||||
if (ImGui.Begin("Testbed"))
|
||||
{
|
||||
ImGui.Text("Hello!");
|
||||
|
||||
if (ImGui.Button("Open demo"))
|
||||
{
|
||||
this.showDemoWindow = true;
|
||||
}
|
||||
|
||||
if (this.showDemoWindow)
|
||||
{
|
||||
ImGui.ShowDemoWindow(ref this.showDemoWindow);
|
||||
}
|
||||
|
||||
if (ImGui.Button("Access context"))
|
||||
{
|
||||
var context = ImGui.GetCurrentContext();
|
||||
var currentWindow = context.CurrentWindow;
|
||||
ref var dc = ref currentWindow.DC; // BREAKPOINT HERE, currentWindow will be invalid
|
||||
dc.CurrLineTextBaseOffset = 0;
|
||||
}
|
||||
|
||||
ImGui.End();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue