wip bindings upgrade

This commit is contained in:
goaaats 2025-04-06 20:59:23 +02:00
parent bd7e56850a
commit 0690cce995
272 changed files with 139041 additions and 1541 deletions

View file

@ -140,12 +140,6 @@ internal class DalamudCommands : IServiceType
"Open Dalamud's startup timing profiler."),
});
commandManager.AddHandler("/imdebug", new CommandInfo(this.OnDebugImInfoCommand)
{
HelpMessage = "ImGui DEBUG",
ShowInHelp = false,
});
commandManager.AddHandler("/xlcopylog", new CommandInfo(this.OnCopyLogCommand)
{
HelpMessage = Loc.Localize(
@ -300,29 +294,6 @@ internal class DalamudCommands : IServiceType
Service<DalamudInterface>.Get().ToggleLogWindow();
}
private void OnDebugImInfoCommand(string command, string arguments)
{
var io = Service<InterfaceManager>.Get().LastImGuiIoPtr;
var info = $"WantCaptureKeyboard: {io.WantCaptureKeyboard}\n";
info += $"WantCaptureMouse: {io.WantCaptureMouse}\n";
info += $"WantSetMousePos: {io.WantSetMousePos}\n";
info += $"WantTextInput: {io.WantTextInput}\n";
info += $"WantSaveIniSettings: {io.WantSaveIniSettings}\n";
info += $"BackendFlags: {(int)io.BackendFlags}\n";
info += $"DeltaTime: {io.DeltaTime}\n";
info += $"DisplaySize: {io.DisplaySize.X} {io.DisplaySize.Y}\n";
info += $"Framerate: {io.Framerate}\n";
info += $"MetricsActiveWindows: {io.MetricsActiveWindows}\n";
info += $"MetricsRenderWindows: {io.MetricsRenderWindows}\n";
info += $"MousePos: {io.MousePos.X} {io.MousePos.Y}\n";
info += $"MouseClicked: {io.MouseClicked}\n";
info += $"MouseDown: {io.MouseDown}\n";
info += $"NavActive: {io.NavActive}\n";
info += $"NavVisible: {io.NavVisible}\n";
Log.Information(info);
}
private void OnVersionInfoCommand(string command, string arguments)
{
var chatGui = Service<ChatGui>.Get();

View file

@ -19,7 +19,7 @@ using Dalamud.Interface.GameFonts;
using Dalamud.Interface.ManagedFontAtlas.Internals;
using Dalamud.Interface.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
#if IMEDEBUG
using Serilog;
@ -136,7 +136,8 @@ internal sealed unsafe class DalamudIme : IInternalDisposableService
this.interfaceManager = imws.Manager;
this.setPlatformImeDataDelegate = this.ImGuiSetPlatformImeData;
ImGui.GetIO().SetPlatformImeDataFn = Marshal.GetFunctionPointerForDelegate(this.setPlatformImeDataDelegate);
var io = ImGui.GetIO();
io.SetPlatformImeDataFn = Marshal.GetFunctionPointerForDelegate(this.setPlatformImeDataDelegate).ToPointer();
this.interfaceManager.Draw += this.Draw;
this.wndProcHookManager.PreWndProc += this.WndProcHookManagerOnPreWndProc;
}
@ -278,7 +279,10 @@ internal sealed unsafe class DalamudIme : IInternalDisposableService
private void ReleaseUnmanagedResources()
{
if (ImGuiHelpers.IsImGuiInitialized)
ImGui.GetIO().SetPlatformImeDataFn = nint.Zero;
{
var io = ImGui.GetIO();
io.SetPlatformImeDataFn = null;
}
}
private void WndProcHookManagerOnPreWndProc(WndProcEventArgs args)
@ -477,7 +481,7 @@ internal sealed unsafe class DalamudIme : IInternalDisposableService
if (!string.IsNullOrEmpty(ImmGetCompositionString(hImc, GCS.GCS_COMPSTR)))
{
ImmNotifyIME(hImc, NI.NI_COMPOSITIONSTR, CPS_COMPLETE, 0);
// Disable further handling of mouse button down event, or something would lock up the cursor.
args.SuppressWithValue(1);
}
@ -670,7 +674,7 @@ internal sealed unsafe class DalamudIme : IInternalDisposableService
return;
var viewport = ime.associatedViewport;
if (viewport.NativePtr is null)
if (viewport.Handle is null)
return;
var drawCand = ime.candidateStrings.Count != 0;

View file

@ -40,9 +40,9 @@ using FFXIVClientStructs.FFXIV.Client.System.Framework;
using FFXIVClientStructs.FFXIV.Client.UI;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Dalamud.Bindings.ImPlot;
using ImPlotNET;
using PInvoke;
using Serilog.Events;
@ -580,7 +580,10 @@ internal class DalamudInterface : IInternalDisposableService
var io = ImGui.GetIO();
if (!io.WantCaptureMouse && (User32.GetKeyState((int)User32.VirtualKey.VK_LBUTTON) & 0x8000) != 0)
{
ImGui.SetWindowFocus(null);
unsafe
{
ImGui.SetWindowFocus((byte*)null);
}
}
}
catch (Exception ex)
@ -661,7 +664,7 @@ internal class DalamudInterface : IInternalDisposableService
}
}
private void DrawDevMenu()
private unsafe void DrawDevMenu()
{
if (this.isImGuiDrawDevMenu)
{
@ -702,7 +705,7 @@ internal class DalamudInterface : IInternalDisposableService
}
var logSynchronously = this.configuration.LogSynchronously;
if (ImGui.MenuItem("Log Synchronously", null, ref logSynchronously))
if (ImGui.MenuItem("Log Synchronously", (byte*)null, ref logSynchronously))
{
this.configuration.LogSynchronously = logSynchronously;
this.configuration.QueueSave();
@ -715,7 +718,7 @@ internal class DalamudInterface : IInternalDisposableService
}
var antiDebug = Service<AntiDebug>.Get();
if (ImGui.MenuItem("Disable Debugging Protections", null, antiDebug.IsEnabled))
if (ImGui.MenuItem("Disable Debugging Protections", (byte*)null, antiDebug.IsEnabled))
{
var newEnabled = !antiDebug.IsEnabled;
if (newEnabled)
@ -854,7 +857,7 @@ internal class DalamudInterface : IInternalDisposableService
ImGui.EndMenu();
}
if (ImGui.MenuItem("Report crashes at shutdown", null, this.configuration.ReportShutdownCrashes))
if (ImGui.MenuItem("Report crashes at shutdown", (byte*)null, this.configuration.ReportShutdownCrashes))
{
this.configuration.ReportShutdownCrashes = !this.configuration.ReportShutdownCrashes;
this.configuration.QueueSave();
@ -896,7 +899,7 @@ internal class DalamudInterface : IInternalDisposableService
}
var assertsEnabled = this.configuration.ImGuiAssertsEnabledAtStartup ?? false;
if (ImGui.MenuItem("Enable asserts at startup", null, assertsEnabled))
if (ImGui.MenuItem("Enable asserts at startup", (byte*)null, assertsEnabled))
{
this.configuration.ImGuiAssertsEnabledAtStartup = !assertsEnabled;
this.configuration.QueueSave();
@ -906,7 +909,7 @@ internal class DalamudInterface : IInternalDisposableService
if (ImGui.MenuItem("Clear focus"))
{
ImGui.SetWindowFocus(null);
ImGui.SetWindowFocus((byte*)null);
}
if (ImGui.MenuItem("Clear stacks"))
@ -947,7 +950,7 @@ internal class DalamudInterface : IInternalDisposableService
Log.Information(info);
}
if (ImGui.MenuItem("Show dev bar info", null, this.configuration.ShowDevBarInfo))
if (ImGui.MenuItem("Show dev bar info", (byte*)null, this.configuration.ShowDevBarInfo))
{
this.configuration.ShowDevBarInfo = !this.configuration.ShowDevBarInfo;
}
@ -1018,12 +1021,12 @@ internal class DalamudInterface : IInternalDisposableService
ImGui.Separator();
if (ImGui.MenuItem("Load all API levels (ONLY FOR DEVELOPERS!!!)", null, pluginManager.LoadAllApiLevels))
if (ImGui.MenuItem("Load all API levels", (byte*)null, pluginManager.LoadAllApiLevels))
{
pluginManager.LoadAllApiLevels = !pluginManager.LoadAllApiLevels;
}
if (ImGui.MenuItem("Load blacklisted plugins", null, pluginManager.LoadBannedPlugins))
if (ImGui.MenuItem("Load blacklisted plugins", (byte*)null, pluginManager.LoadBannedPlugins))
{
pluginManager.LoadBannedPlugins = !pluginManager.LoadBannedPlugins;
}

View file

@ -4,7 +4,7 @@ using Dalamud.Interface.Colors;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.DesignSystem;
@ -45,7 +45,7 @@ internal static partial class DalamudComponents
return Button(text);
}
}
private static bool Button(string text)
{
using (ImRaii.PushStyle(ImGuiStyleVar.FramePadding, ButtonPadding))

View file

@ -9,7 +9,7 @@ using Dalamud.Plugin.Internal;
using Dalamud.Plugin.Internal.Types;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.DesignSystem;

View file

@ -8,7 +8,7 @@ using Dalamud.Game.Gui.Toast;
using Dalamud.Interface.Utility;
using Dalamud.Logging.Internal;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using TerraFX.Interop.Windows;
@ -38,13 +38,13 @@ namespace Dalamud.Interface.Internal;
internal sealed unsafe class ImGuiClipboardFunctionProvider : IInternalDisposableService
{
private static readonly ModuleLog Log = new(nameof(ImGuiClipboardFunctionProvider));
private readonly nint clipboardUserDataOriginal;
private readonly nint setTextOriginal;
private readonly nint getTextOriginal;
private readonly void* clipboardUserDataOriginal;
private readonly void* setTextOriginal;
private readonly void* getTextOriginal;
[ServiceManager.ServiceDependency]
private readonly ToastGui toastGui = Service<ToastGui>.Get();
private ImVectorWrapper<byte> clipboardData;
private GCHandle clipboardUserData;
@ -58,9 +58,9 @@ internal sealed unsafe class ImGuiClipboardFunctionProvider : IInternalDisposabl
this.clipboardUserDataOriginal = io.ClipboardUserData;
this.setTextOriginal = io.SetClipboardTextFn;
this.getTextOriginal = io.GetClipboardTextFn;
io.ClipboardUserData = GCHandle.ToIntPtr(this.clipboardUserData = GCHandle.Alloc(this));
io.SetClipboardTextFn = (nint)(delegate* unmanaged<nint, byte*, void>)&StaticSetClipboardTextImpl;
io.GetClipboardTextFn = (nint)(delegate* unmanaged<nint, byte*>)&StaticGetClipboardTextImpl;
io.ClipboardUserData = GCHandle.ToIntPtr(this.clipboardUserData = GCHandle.Alloc(this)).ToPointer();
io.SetClipboardTextFn = (delegate* unmanaged<nint, byte*, void>)&StaticSetClipboardTextImpl;
io.GetClipboardTextFn = (delegate* unmanaged<nint, byte*>)&StaticGetClipboardTextImpl;
this.clipboardData = new(0);
return;
@ -118,7 +118,7 @@ internal sealed unsafe class ImGuiClipboardFunctionProvider : IInternalDisposabl
var hMem = GlobalAlloc(GMEM.GMEM_MOVEABLE, (nuint)((str.Length + 1) * 2));
if (hMem == 0)
throw new OutOfMemoryException();
var ptr = (char*)GlobalLock(hMem);
if (ptr == null)
{
@ -150,7 +150,7 @@ internal sealed unsafe class ImGuiClipboardFunctionProvider : IInternalDisposabl
private byte* GetClipboardTextImpl()
{
this.clipboardData.Clear();
var formats = stackalloc uint[] { CF.CF_UNICODETEXT, CF.CF_TEXT };
if (GetPriorityClipboardFormat(formats, 2) < 1 || !this.OpenClipboardOrShowError())
{

View file

@ -37,7 +37,7 @@ using Dalamud.Utility.Timing;
using FFXIVClientStructs.FFXIV.Client.Graphics.Environment;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using JetBrains.Annotations;
@ -826,7 +826,7 @@ internal partial class InterfaceManager : IInternalDisposableService
() =>
{
// Update the ImGui default font.
ImGui.GetIO().NativePtr->FontDefault = fontLocked.ImFont;
ImGui.GetIO().Handle->FontDefault = fontLocked.ImFont;
// Update the reference to the resources of the default font.
this.defaultFontResourceLock?.Dispose();

View file

@ -10,7 +10,7 @@ using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Client.System.String;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Lumina.Text.ReadOnly;
@ -213,7 +213,7 @@ internal unsafe class UiDebug
ImGui.SameLine();
Service<SeStringRenderer>.Get().Draw(textNode->NodeText);
ImGui.InputText($"Replace Text##{(ulong)textNode:X}", new IntPtr(textNode->NodeText.StringPtr), (uint)textNode->NodeText.BufSize);
ImGui.InputText($"Replace Text##{(ulong)textNode:X}", textNode->NodeText.StringPtr, (uint)textNode->NodeText.BufSize);
ImGui.SameLine();
if (ImGui.Button($"Encode##{(ulong)textNode:X}"))
@ -301,7 +301,7 @@ internal unsafe class UiDebug
if (ImGui.TreeNode($"Texture##{(ulong)kernelTexture->D3D11ShaderResourceView:X}"))
{
ImGui.Image(
new IntPtr(kernelTexture->D3D11ShaderResourceView),
new ImTextureID(kernelTexture->D3D11ShaderResourceView),
new Vector2(kernelTexture->ActualWidth, kernelTexture->ActualHeight));
ImGui.TreePop();
}
@ -312,7 +312,7 @@ internal unsafe class UiDebug
$"Texture##{(ulong)textureInfo->AtkTexture.KernelTexture->D3D11ShaderResourceView:X}"))
{
ImGui.Image(
new IntPtr(textureInfo->AtkTexture.KernelTexture->D3D11ShaderResourceView),
new ImTextureID(textureInfo->AtkTexture.KernelTexture->D3D11ShaderResourceView),
new Vector2(
textureInfo->AtkTexture.KernelTexture->ActualWidth,
textureInfo->AtkTexture.KernelTexture->ActualHeight));

View file

@ -5,7 +5,7 @@ using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using ValueType = FFXIVClientStructs.FFXIV.Component.GUI.ValueType;

View file

@ -5,7 +5,7 @@ using System.Numerics;
using Dalamud.Interface.Components;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using static Dalamud.Interface.FontAwesomeIcon;
using static Dalamud.Interface.Internal.UiDebug2.ElementSelector;

View file

@ -4,10 +4,10 @@ using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using static ImGuiNET.ImGuiTableColumnFlags;
using static ImGuiNET.ImGuiTableFlags;
using static Dalamud.Bindings.ImGui.ImGuiTableColumnFlags;
using static Dalamud.Bindings.ImGui.ImGuiTableFlags;
namespace Dalamud.Interface.Internal.UiDebug2.Browsing;

View file

@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using static Dalamud.Interface.Internal.UiDebug2.Utility.Gui;
using static Dalamud.Utility.Util;

View file

@ -6,16 +6,16 @@ using Dalamud.Interface.Internal.UiDebug2.Utility;
using Dalamud.Interface.Utility.Raii;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using static Dalamud.Interface.ColorHelpers;
using static Dalamud.Interface.FontAwesomeIcon;
using static Dalamud.Interface.Internal.UiDebug2.Utility.Gui;
using static Dalamud.Interface.Utility.ImGuiHelpers;
using static ImGuiNET.ImGuiColorEditFlags;
using static ImGuiNET.ImGuiInputTextFlags;
using static ImGuiNET.ImGuiTableColumnFlags;
using static ImGuiNET.ImGuiTableFlags;
using static Dalamud.Bindings.ImGui.ImGuiColorEditFlags;
using static Dalamud.Bindings.ImGui.ImGuiInputTextFlags;
using static Dalamud.Bindings.ImGui.ImGuiTableColumnFlags;
using static Dalamud.Bindings.ImGui.ImGuiTableFlags;
namespace Dalamud.Interface.Internal.UiDebug2.Browsing;
@ -266,7 +266,7 @@ internal unsafe partial class NineGridNodeTree
ImGui.Text("Ninegrid Offsets:");
ImGui.TableNextColumn();
ImGui.SetNextItemWidth(150);
if (ImGui.DragFloat2($"##{(nint)this.Node:X}ngOffsetLR", ref lr, 1, 0))
if (ImGui.DragFloat2($"##{(nint)this.Node:X}ngOffsetLR", ref lr, 1f, 0f))
{
this.NgNode->LeftOffset = (short)Math.Max(0, lr.X);
this.NgNode->RightOffset = (short)Math.Max(0, lr.Y);
@ -278,7 +278,7 @@ internal unsafe partial class NineGridNodeTree
ImGui.TableNextColumn();
ImGui.TableNextColumn();
ImGui.SetNextItemWidth(150);
if (ImGui.DragFloat2($"##{(nint)this.Node:X}ngOffsetTB", ref tb, 1, 0))
if (ImGui.DragFloat2($"##{(nint)this.Node:X}ngOffsetTB", ref tb, 1f, 0f))
{
this.NgNode->TopOffset = (short)Math.Max(0, tb.X);
this.NgNode->BottomOffset = (short)Math.Max(0, tb.Y);

View file

@ -5,15 +5,15 @@ using Dalamud.Interface.Utility.Raii;
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using static Dalamud.Interface.ColorHelpers;
using static Dalamud.Interface.Internal.UiDebug2.Utility.Gui;
using static Dalamud.Utility.Util;
using static FFXIVClientStructs.FFXIV.Component.GUI.TextureType;
using static ImGuiNET.ImGuiTableColumnFlags;
using static ImGuiNET.ImGuiTableFlags;
using static ImGuiNET.ImGuiTreeNodeFlags;
using static Dalamud.Bindings.ImGui.ImGuiTableColumnFlags;
using static Dalamud.Bindings.ImGui.ImGuiTableFlags;
using static Dalamud.Bindings.ImGui.ImGuiTreeNodeFlags;
namespace Dalamud.Interface.Internal.UiDebug2.Browsing;

View file

@ -1,7 +1,7 @@
using Dalamud.Interface.Internal.UiDebug2.Utility;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using static Dalamud.Interface.ColorHelpers;
using static Dalamud.Utility.Util;

View file

@ -2,13 +2,14 @@ using System.Linq;
using System.Numerics;
using System.Runtime.InteropServices;
using Dalamud.Bindings.ImGui;
using Dalamud.Interface.Components;
using Dalamud.Interface.Internal.UiDebug2.Utility;
using Dalamud.Interface.Utility.Raii;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using static Dalamud.Bindings.ImGui.ImGuiCol;
using static Dalamud.Bindings.ImGui.ImGuiTreeNodeFlags;
using static Dalamud.Interface.ColorHelpers;
using static Dalamud.Interface.FontAwesomeIcon;
using static Dalamud.Interface.Internal.UiDebug2.Browsing.Events;
@ -18,9 +19,6 @@ using static Dalamud.Interface.Internal.UiDebug2.Utility.Gui;
using static Dalamud.Utility.Util;
using static FFXIVClientStructs.FFXIV.Component.GUI.NodeFlags;
using static ImGuiNET.ImGuiCol;
using static ImGuiNET.ImGuiTreeNodeFlags;
namespace Dalamud.Interface.Internal.UiDebug2.Browsing;
/// <summary>

View file

@ -9,7 +9,7 @@ using Dalamud.Interface.Utility.Raii;
using FFXIVClientStructs.FFXIV.Client.System.String;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using static Dalamud.Interface.ColorHelpers;
using static Dalamud.Interface.Internal.UiDebug2.Utility.Gui;

View file

@ -1,6 +1,6 @@
using System.Collections.Generic;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.UiDebug2.Browsing;

View file

@ -7,15 +7,15 @@ using Dalamud.Interface.Utility.Raii;
using FFXIVClientStructs.FFXIV.Client.Graphics;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using static Dalamud.Interface.ColorHelpers;
using static Dalamud.Interface.Internal.UiDebug2.Utility.Gui;
using static Dalamud.Utility.Util;
using static FFXIVClientStructs.FFXIV.Component.GUI.NodeType;
using static ImGuiNET.ImGuiTableColumnFlags;
using static ImGuiNET.ImGuiTableFlags;
using static ImGuiNET.ImGuiTreeNodeFlags;
using static Dalamud.Bindings.ImGui.ImGuiTableColumnFlags;
using static Dalamud.Bindings.ImGui.ImGuiTableFlags;
using static Dalamud.Bindings.ImGui.ImGuiTreeNodeFlags;
// ReSharper disable SuggestBaseTypeForParameter
namespace Dalamud.Interface.Internal.UiDebug2.Browsing;

View file

@ -9,7 +9,7 @@ using Dalamud.Interface.Internal.UiDebug2.Utility;
using Dalamud.Interface.Utility.Raii;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using static System.Globalization.NumberFormatInfo;
@ -18,8 +18,8 @@ using static Dalamud.Interface.Internal.UiDebug2.UiDebug2;
using static Dalamud.Interface.UiBuilder;
using static Dalamud.Interface.Utility.ImGuiHelpers;
using static FFXIVClientStructs.FFXIV.Component.GUI.NodeFlags;
using static ImGuiNET.ImGuiCol;
using static ImGuiNET.ImGuiWindowFlags;
using static Dalamud.Bindings.ImGui.ImGuiCol;
using static Dalamud.Bindings.ImGui.ImGuiWindowFlags;
// ReSharper disable StructLacksIEquatable.Global
#pragma warning disable CS0659

View file

@ -3,7 +3,7 @@ using System.Numerics;
using Dalamud.Interface.Internal.UiDebug2.Browsing;
using Dalamud.Interface.Utility.Raii;
using Dalamud.Interface.Windowing;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.UiDebug2;

View file

@ -4,7 +4,7 @@ using Dalamud.Interface.Internal.UiDebug2.Browsing;
using Dalamud.Interface.Utility.Raii;
using Dalamud.Interface.Windowing;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using static Dalamud.Interface.Internal.UiDebug2.UiDebug2;

View file

@ -6,7 +6,7 @@ using Dalamud.Interface.Utility.Raii;
using FFXIVClientStructs.FFXIV.Client.UI;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using static System.StringComparison;
using static Dalamud.Interface.FontAwesomeIcon;

View file

@ -9,9 +9,9 @@ using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using static ImGuiNET.ImGuiWindowFlags;
using static Dalamud.Bindings.ImGui.ImGuiWindowFlags;
namespace Dalamud.Interface.Internal.UiDebug2;

View file

@ -4,10 +4,10 @@ using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using FFXIVClientStructs.FFXIV.Client.Graphics;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using static Dalamud.Interface.ColorHelpers;
using static ImGuiNET.ImGuiCol;
using static Dalamud.Bindings.ImGui.ImGuiCol;
namespace Dalamud.Interface.Internal.UiDebug2.Utility;

View file

@ -4,7 +4,7 @@ using System.Numerics;
using Dalamud.Interface.Utility;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using static System.MathF;
using static Dalamud.Interface.ColorHelpers;

View file

@ -11,7 +11,7 @@ using Dalamud.Interface.Utility;
using Dalamud.Interface.Windowing;
using Dalamud.Networking.Http;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Newtonsoft.Json;
namespace Dalamud.Interface.Internal.Windows;

View file

@ -25,7 +25,7 @@ using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Client.UI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows;
@ -35,7 +35,7 @@ namespace Dalamud.Interface.Internal.Windows;
internal sealed class ChangelogWindow : Window, IDisposable
{
private const string WarrantsChangelogForMajorMinor = "10.0.";
private const string ChangeLog =
@"• Updated Dalamud for compatibility with Patch 7.0
Made a lot of behind-the-scenes changes to make Dalamud and plugins more stable and reliable
@ -43,7 +43,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
Refreshed the Dalamud/plugin installer UI
";
private static readonly TimeSpan TitleScreenWaitTime = TimeSpan.FromSeconds(0.5f);
private static readonly TimeSpan TitleScreenWaitTime = TimeSpan.FromSeconds(0.5f);
private readonly TitleScreenMenuWindow tsmWindow;
@ -54,40 +54,40 @@ internal sealed class ChangelogWindow : Window, IDisposable
private readonly Lazy<IFontHandle> bannerFont;
private readonly Lazy<IDalamudTextureWrap> apiBumpExplainerTexture;
private readonly Lazy<IDalamudTextureWrap> logoTexture;
private readonly InOutCubic windowFade = new(TimeSpan.FromSeconds(2.5f))
{
Point1 = Vector2.Zero,
Point2 = new Vector2(2f),
};
private readonly InOutCubic bodyFade = new(TimeSpan.FromSeconds(0.8f))
{
Point1 = Vector2.Zero,
Point2 = Vector2.One,
};
private readonly InOutCubic titleFade = new(TimeSpan.FromSeconds(0.5f))
{
Point1 = Vector2.Zero,
Point2 = Vector2.One,
};
private readonly InOutCubic fadeOut = new(TimeSpan.FromSeconds(0.5f))
{
Point1 = Vector2.One,
Point2 = Vector2.Zero,
};
private State state = State.WindowFadeIn;
private bool needFadeRestart = false;
private bool isFadingOutForStateChange = false;
private State? stateAfterFadeOut;
private AutoUpdateBehavior? chosenAutoUpdateBehavior;
private Dictionary<string, int> currentFtueLevels = new();
private DateTime? isEligibleSince;
@ -110,7 +110,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
: base("What's new in Dalamud?##ChangelogWindow", ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoTitleBar | ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse, true)
{
this.gameGui = gameGui;
this.tsmWindow = tsmWindow;
this.Namespace = "DalamudChangelogWindow";
this.privateAtlas = this.scopedFinalizer.Add(
@ -125,7 +125,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
// If we are going to show a changelog, make sure we have the font ready, otherwise it will hitch
if (WarrantsChangelog())
_ = this.bannerFont.Value;
framework.Update += this.FrameworkOnUpdate;
this.scopedFinalizer.Add(() => framework.Update -= this.FrameworkOnUpdate);
}
@ -138,7 +138,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
AskAutoUpdate,
Links,
}
/// <summary>
/// Check if a changelog should be shown.
/// </summary>
@ -163,7 +163,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
this.isFadingOutForStateChange = false;
this.stateAfterFadeOut = null;
this.state = State.WindowFadeIn;
this.windowFade.Reset();
this.bodyFade.Reset();
@ -172,9 +172,9 @@ internal sealed class ChangelogWindow : Window, IDisposable
this.needFadeRestart = true;
this.chosenAutoUpdateBehavior = null;
this.currentFtueLevels = Service<DalamudConfiguration>.Get().SeenFtueLevels;
base.OnOpen();
}
@ -182,17 +182,17 @@ internal sealed class ChangelogWindow : Window, IDisposable
public override void OnClose()
{
base.OnClose();
this.tsmWindow.AllowDrawing = true;
Service<DalamudInterface>.Get().SetCreditsDarkeningAnimation(false);
var configuration = Service<DalamudConfiguration>.Get();
if (this.chosenAutoUpdateBehavior.HasValue)
{
configuration.AutoUpdateBehavior = this.chosenAutoUpdateBehavior.Value;
}
configuration.SeenFtueLevels = this.currentFtueLevels;
configuration.QueueSave();
}
@ -203,7 +203,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
ImGui.PushStyleVar(ImGuiStyleVar.WindowBorderSize, 0);
ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, Vector2.Zero);
ImGui.PushStyleVar(ImGuiStyleVar.WindowRounding, 10f);
base.PreDraw();
if (this.needFadeRestart)
@ -212,15 +212,15 @@ internal sealed class ChangelogWindow : Window, IDisposable
this.titleFade.Restart();
this.needFadeRestart = false;
}
this.windowFade.Update();
this.titleFade.Update();
this.fadeOut.Update();
ImGui.SetNextWindowBgAlpha(Math.Clamp(this.windowFade.EasedPoint.X, 0, 0.9f));
this.Size = new Vector2(900, 400);
this.SizeCondition = ImGuiCond.Always;
// Center the window on the main viewport
var viewportPos = ImGuiHelpers.MainViewport.Pos;
var viewportSize = ImGuiHelpers.MainViewport.Size;
@ -233,9 +233,9 @@ internal sealed class ChangelogWindow : Window, IDisposable
public override void PostDraw()
{
ImGui.PopStyleVar(3);
this.ResetMovieTimer();
base.PostDraw();
}
@ -248,13 +248,13 @@ internal sealed class ChangelogWindow : Window, IDisposable
configuration.LastChangelogMajorMinor = WarrantsChangelogForMajorMinor;
configuration.QueueSave();
}
var windowSize = ImGui.GetWindowSize();
var dummySize = 10 * ImGuiHelpers.GlobalScale;
ImGui.Dummy(new Vector2(dummySize));
ImGui.SameLine();
var logoContainerSize = new Vector2(windowSize.X * 0.2f - dummySize, windowSize.Y);
using (var child = ImRaii.Child("###logoContainer", logoContainerSize, false))
{
@ -262,23 +262,23 @@ internal sealed class ChangelogWindow : Window, IDisposable
return;
var logoSize = new Vector2(logoContainerSize.X);
// Center the logo in the container
ImGui.SetCursorPos(new Vector2(logoContainerSize.X / 2 - logoSize.X / 2, logoContainerSize.Y / 2 - logoSize.Y / 2));
using (ImRaii.PushStyle(ImGuiStyleVar.Alpha, Math.Clamp(this.windowFade.EasedPoint.X - 0.5f, 0f, 1f)))
ImGui.Image(this.logoTexture.Value.ImGuiHandle, logoSize);
}
ImGui.SameLine();
ImGui.Dummy(new Vector2(dummySize));
ImGui.SameLine();
using (var child = ImRaii.Child("###textContainer", new Vector2((windowSize.X * 0.8f) - dummySize * 4, windowSize.Y), false))
{
if (!child)
return;
ImGuiHelpers.ScaledDummy(20);
var titleFadeVal = this.isFadingOutForStateChange ? this.fadeOut.EasedPoint.X : this.titleFade.EasedPoint.X;
@ -292,21 +292,21 @@ internal sealed class ChangelogWindow : Window, IDisposable
case State.ExplainerIntro:
ImGuiHelpers.CenteredText("New And Improved");
break;
case State.ExplainerApiBump:
ImGuiHelpers.CenteredText("Plugin Updates");
break;
case State.AskAutoUpdate:
ImGuiHelpers.CenteredText("Auto-Updates");
break;
case State.Links:
ImGuiHelpers.CenteredText("Enjoy!");
break;
}
}
ImGuiHelpers.ScaledDummy(8);
if (this.state == State.WindowFadeIn && this.windowFade.EasedPoint.X > 1.5f)
@ -321,11 +321,11 @@ internal sealed class ChangelogWindow : Window, IDisposable
this.bodyFade.Restart();
this.titleFade.Restart();
this.isFadingOutForStateChange = false;
this.stateAfterFadeOut = null;
}
this.bodyFade.Update();
var bodyFadeVal = this.isFadingOutForStateChange ? this.fadeOut.EasedPoint.X : this.bodyFade.EasedPoint.X;
using (ImRaii.PushStyle(ImGuiStyleVar.Alpha, Math.Clamp(bodyFadeVal, 0, 1f)))
@ -334,10 +334,10 @@ internal sealed class ChangelogWindow : Window, IDisposable
{
this.isFadingOutForStateChange = true;
this.stateAfterFadeOut = nextState;
this.fadeOut.Restart();
}
bool DrawNextButton(State nextState)
{
// Draw big, centered next button at the bottom of the window
@ -346,7 +346,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
var buttonWidth = ImGui.CalcTextSize(buttonText).X + 40 * ImGuiHelpers.GlobalScale;
ImGui.SetCursorPosY(windowSize.Y - buttonHeight - (20 * ImGuiHelpers.GlobalScale));
ImGuiHelpers.CenterCursorFor((int)buttonWidth);
if (ImGui.Button(buttonText, new Vector2(buttonWidth, buttonHeight)) && !this.isFadingOutForStateChange)
{
GoToNextState(nextState);
@ -355,7 +355,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
return false;
}
switch (this.state)
{
case State.WindowFadeIn:
@ -366,10 +366,10 @@ internal sealed class ChangelogWindow : Window, IDisposable
ImGuiHelpers.ScaledDummy(5);
ImGui.TextWrapped("This changelog is a quick overview of the most important changes in this version.");
ImGui.TextWrapped("Please click next to see a quick guide to updating your plugins.");
DrawNextButton(State.ExplainerApiBump);
break;
case State.ExplainerApiBump:
ImGui.TextWrapped("Take care! Due to changes in this patch, all of your plugins need to be updated and were disabled automatically.");
ImGui.TextWrapped("This is normal and required for major game updates.");
@ -378,14 +378,14 @@ internal sealed class ChangelogWindow : Window, IDisposable
ImGuiHelpers.ScaledDummy(5);
ImGui.TextWrapped("Please keep in mind that not all of your plugins may already be updated for the new version.");
ImGui.TextWrapped("If some plugins are displayed with a red cross in the 'Installed Plugins' tab, they may not yet be available.");
ImGuiHelpers.ScaledDummy(15);
ImGuiHelpers.CenterCursorFor(this.apiBumpExplainerTexture.Value.Width);
ImGui.Image(
this.apiBumpExplainerTexture.Value.ImGuiHandle,
this.apiBumpExplainerTexture.Value.Size);
if (!this.currentFtueLevels.TryGetValue(FtueLevels.AutoUpdate.Name, out var autoUpdateLevel) || autoUpdateLevel < FtueLevels.AutoUpdate.AutoUpdateInitial)
{
if (DrawNextButton(State.AskAutoUpdate))
@ -397,23 +397,23 @@ internal sealed class ChangelogWindow : Window, IDisposable
{
DrawNextButton(State.Links);
}
break;
case State.AskAutoUpdate:
ImGuiHelpers.SafeTextColoredWrapped(ImGuiColors.DalamudWhite, Loc.Localize("DalamudSettingsAutoUpdateHint",
"Dalamud can update your plugins automatically, making sure that you always " +
"have the newest features and bug fixes. You can choose when and how auto-updates are run here."));
ImGuiHelpers.ScaledDummy(2);
ImGuiHelpers.SafeTextColoredWrapped(ImGuiColors.DalamudGrey, Loc.Localize("DalamudSettingsAutoUpdateDisclaimer1",
"You can always update your plugins manually by clicking the update button in the plugin list. " +
"You can also opt into updates for specific plugins by right-clicking them and selecting \"Always auto-update\"."));
ImGuiHelpers.SafeTextColoredWrapped(ImGuiColors.DalamudGrey, Loc.Localize("DalamudSettingsAutoUpdateDisclaimer2",
"Dalamud will only notify you about updates while you are idle."));
ImGuiHelpers.ScaledDummy(15);
bool DrawCenteredButton(string text, float height)
{
var buttonHeight = height * ImGuiHelpers.GlobalScale;
@ -427,97 +427,97 @@ internal sealed class ChangelogWindow : Window, IDisposable
using (ImRaii.PushColor(ImGuiCol.Button, ImGuiColors.DPSRed))
{
if (DrawCenteredButton("Enable auto-updates", 30))
{
{
this.chosenAutoUpdateBehavior = AutoUpdateBehavior.UpdateMainRepo;
GoToNextState(State.Links);
}
}
ImGuiHelpers.ScaledDummy(2);
using (ImRaii.PushStyle(ImGuiStyleVar.FrameBorderSize, 1))
using (var buttonColor = ImRaii.PushColor(ImGuiCol.Button, Vector4.Zero))
{
buttonColor.Push(ImGuiCol.Border, ImGuiColors.DalamudGrey3);
if (DrawCenteredButton("Disable auto-updates", 25))
{
{
this.chosenAutoUpdateBehavior = AutoUpdateBehavior.OnlyNotify;
GoToNextState(State.Links);
}
}
break;
case State.Links:
ImGui.TextWrapped("If you note any issues or need help, please check the FAQ, and reach out on our Discord if you need help.");
ImGui.TextWrapped("Enjoy your time with the game and Dalamud!");
ImGuiHelpers.ScaledDummy(45);
bool CenteredIconButton(FontAwesomeIcon icon, string text)
{
var buttonWidth = ImGuiComponents.GetIconButtonWithTextWidth(icon, text);
ImGuiHelpers.CenterCursorFor((int)buttonWidth);
return ImGuiComponents.IconButtonWithText(icon, text);
}
if (CenteredIconButton(FontAwesomeIcon.Download, "Open Plugin Installer"))
{
Service<DalamudInterface>.Get().OpenPluginInstaller();
this.IsOpen = false;
Dismiss();
}
ImGuiHelpers.ScaledDummy(5);
ImGuiHelpers.CenterCursorFor(
(int)(ImGuiComponents.GetIconButtonWithTextWidth(FontAwesomeIcon.Globe, "See the FAQ") +
ImGuiComponents.GetIconButtonWithTextWidth(FontAwesomeIcon.LaughBeam, "Join our Discord server") +
(5 * ImGuiHelpers.GlobalScale) +
(5 * ImGuiHelpers.GlobalScale) +
(ImGui.GetStyle().ItemSpacing.X * 4)));
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Globe, "See the FAQ"))
{
Util.OpenLink("https://goatcorp.github.io/faq/");
}
ImGui.SameLine();
ImGuiHelpers.ScaledDummy(5);
ImGui.SameLine();
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.LaughBeam, "Join our Discord server"))
{
Util.OpenLink("https://discord.gg/3NMcUV5");
}
ImGuiHelpers.ScaledDummy(5);
if (CenteredIconButton(FontAwesomeIcon.Heart, "Support what we care about"))
{
Util.OpenLink("https://goatcorp.github.io/faq/support");
}
var buttonHeight = 30 * ImGuiHelpers.GlobalScale;
var buttonText = "Close";
var buttonWidth = ImGui.CalcTextSize(buttonText).X + 40 * ImGuiHelpers.GlobalScale;
ImGui.SetCursorPosY(windowSize.Y - buttonHeight - (20 * ImGuiHelpers.GlobalScale));
ImGuiHelpers.CenterCursorFor((int)buttonWidth);
if (ImGui.Button(buttonText, new Vector2(buttonWidth, buttonHeight)))
{
this.IsOpen = false;
Dismiss();
}
break;
}
}
// Draw close button in the top right corner
ImGui.PushStyleVar(ImGuiStyleVar.FrameRounding, 100f);
var btnAlpha = Math.Clamp(this.windowFade.EasedPoint.X - 0.5f, 0f, 1f);
ImGui.PushStyleColor(ImGuiCol.Button, ImGuiColors.DPSRed.WithAlpha(btnAlpha).Desaturate(0.3f));
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudWhite.WithAlpha(btnAlpha));
var childSize = ImGui.GetWindowSize();
var closeButtonSize = 15 * ImGuiHelpers.GlobalScale;
ImGui.SetCursorPos(new Vector2(childSize.X - closeButtonSize - (10 * ImGuiHelpers.GlobalScale), 10 * ImGuiHelpers.GlobalScale));
@ -544,7 +544,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
{
this.scopedFinalizer.Dispose();
}
private void FrameworkOnUpdate(IFramework unused)
{
if (!WarrantsChangelog())
@ -555,7 +555,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
if (this.openedThroughEligibility)
return;
var isEligible = this.gameGui.GetAddonByName("_TitleMenu", 1) != IntPtr.Zero;
var charaSelect = this.gameGui.GetAddonByName("CharaSelect", 1);
@ -572,14 +572,14 @@ internal sealed class ChangelogWindow : Window, IDisposable
{
this.isEligibleSince = null;
}
if (this.isEligibleSince != null && DateTime.Now - this.isEligibleSince > TitleScreenWaitTime)
{
this.IsOpen = true;
this.openedThroughEligibility = true;
}
}
private unsafe void ResetMovieTimer()
{
var uiModule = UIModule.Instance();

View file

@ -5,7 +5,7 @@ using System.Reflection;
using Dalamud.Interface.Colors;
using Dalamud.Interface.Windowing;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows;

View file

@ -7,7 +7,7 @@ using Dalamud.Interface.Colors;
using Dalamud.Interface.Components;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Windowing;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows;

View file

@ -22,7 +22,7 @@ using Dalamud.Plugin.Internal;
using Dalamud.Plugin.Services;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Serilog;
using Serilog.Events;
@ -41,9 +41,9 @@ internal class ConsoleWindow : Window, IDisposable
// Fields below should be touched only from the main thread.
private readonly RollingList<LogEntry> logText;
private readonly RollingList<LogEntry> filteredLogEntries;
private readonly List<PluginFilterEntry> pluginFilters = new();
private readonly DalamudConfiguration configuration;
private int newRolledLines;
@ -87,14 +87,14 @@ internal class ConsoleWindow : Window, IDisposable
: base("Dalamud Console", ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse)
{
this.configuration = configuration;
this.autoScroll = configuration.LogAutoScroll;
this.autoOpen = configuration.LogOpenAtStartup;
Service<Framework>.GetAsync().ContinueWith(r => r.Result.Update += this.FrameworkOnUpdate);
var cm = Service<ConsoleManager>.Get();
cm.AddCommand("clear", "Clear the console log", () =>
cm.AddCommand("clear", "Clear the console log", () =>
{
this.QueueClear();
return true;
@ -116,7 +116,7 @@ internal class ConsoleWindow : Window, IDisposable
unsafe
{
this.clipperPtr = new(ImGuiNative.ImGuiListClipper_ImGuiListClipper());
this.clipperPtr = new(ImGui.ImGuiListClipper());
}
}
@ -578,7 +578,7 @@ internal class ConsoleWindow : Window, IDisposable
inputWidth = ImGui.GetWindowWidth() - (ImGui.GetStyle().WindowPadding.X * 2);
if (!breakInputLines)
inputWidth = (inputWidth - ImGui.GetStyle().ItemSpacing.X) / 2;
inputWidth = (inputWidth - ImGui.GetStyle().ItemSpacing.X) / 2;
}
else
{
@ -799,15 +799,15 @@ internal class ConsoleWindow : Window, IDisposable
{
if (string.IsNullOrEmpty(this.commandText))
return;
this.historyPos = -1;
if (this.commandText != this.configuration.LogCommandHistory.LastOrDefault())
this.configuration.LogCommandHistory.Add(this.commandText);
if (this.configuration.LogCommandHistory.Count > HistorySize)
this.configuration.LogCommandHistory.RemoveAt(0);
this.configuration.QueueSave();
this.lastCmdSuccess = Service<ConsoleManager>.Get().ProcessCommand(this.commandText);
@ -832,7 +832,7 @@ internal class ConsoleWindow : Window, IDisposable
this.completionZipText = null;
this.completionTabIdx = 0;
break;
case ImGuiInputTextFlags.CallbackCompletion:
var textBytes = new byte[data->BufTextLen];
Marshal.Copy((IntPtr)data->Buf, textBytes, 0, data->BufTextLen);
@ -843,11 +843,11 @@ internal class ConsoleWindow : Window, IDisposable
// We can't do any completion for parameters at the moment since it just calls into CommandHandler
if (words.Length > 1)
return 0;
var wordToComplete = words[0];
if (wordToComplete.IsNullOrWhitespace())
return 0;
if (this.completionZipText is not null)
wordToComplete = this.completionZipText;
@ -878,7 +878,7 @@ internal class ConsoleWindow : Window, IDisposable
toComplete = candidates.ElementAt(this.completionTabIdx);
this.completionTabIdx = (this.completionTabIdx + 1) % candidates.Count();
}
if (toComplete != null)
{
ptr.DeleteChars(0, ptr.BufTextLen);
@ -1103,7 +1103,7 @@ internal class ConsoleWindow : Window, IDisposable
charOffsets[charOffsetsIndex++] = line.Length;
var screenPos = ImGui.GetCursorScreenPos();
var drawList = ImGui.GetWindowDrawList().NativePtr;
var drawList = ImGui.GetWindowDrawList().Handle;
var font = ImGui.GetFont();
var size = ImGui.GetFontSize();
var scale = size / font.FontSize;

View file

@ -8,7 +8,7 @@ using Dalamud.Interface.Utility;
using Dalamud.Interface.Windowing;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Serilog;
namespace Dalamud.Interface.Internal.Windows.Data;

View file

@ -3,7 +3,7 @@ using System.Numerics;
using Dalamud.Interface.ImGuiNotification;
using Dalamud.Interface.ImGuiNotification.Internal;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data;
@ -50,7 +50,7 @@ internal static class DataWindowWidgetExtensions
{
ImGui.SetClipboardText(s);
Service<NotificationManager>.Get().AddNotification(
$"Copied {ImGui.TableGetColumnName()} to clipboard.",
$"Copied {ImGui.TableGetColumnNameS()} to clipboard.",
widget.DisplayName,
NotificationType.Success);
}

View file

@ -8,7 +8,7 @@ using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using Dalamud.Logging.Internal;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Serilog.Events;
@ -46,7 +46,7 @@ internal class GameInventoryTestWidget : IDataWindowWidget
ImGuiColors.DalamudRed,
"Enable LogLevel=Information display to see the logs.");
}
using var table = ImRaii.Table(this.DisplayName, 3, ImGuiTableFlags.SizingFixedFit);
if (!table.Success)
return;

View file

@ -1,6 +1,6 @@
using Dalamud.Interface.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data;

View file

@ -5,7 +5,7 @@ using Dalamud.Game.Addon.Lifecycle;
using Dalamud.Interface.Colors;
using Dalamud.Interface.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -19,11 +19,11 @@ public class AddonLifecycleWidget : IDataWindowWidget
/// <inheritdoc/>
public string DisplayName { get; init; } = "Addon Lifecycle";
/// <inheritdoc/>
[MemberNotNullWhen(true, "AddonLifecycle")]
public bool Ready { get; set; }
private AddonLifecycle? AddonLifecycle { get; set; }
/// <inheritdoc/>
@ -38,7 +38,7 @@ public class AddonLifecycleWidget : IDataWindowWidget
this.Ready = true;
});
}
/// <inheritdoc/>
public void Draw()
{
@ -62,11 +62,11 @@ public class AddonLifecycleWidget : IDataWindowWidget
ImGui.Unindent();
}
}
private void DrawEventListeners()
{
if (!this.Ready) return;
foreach (var eventType in Enum.GetValues<AddonEvent>())
{
if (ImGui.CollapsingHeader(eventType.ToString()))
@ -78,7 +78,7 @@ public class AddonLifecycleWidget : IDataWindowWidget
{
ImGui.Text("No Listeners Registered for Event");
}
if (ImGui.BeginTable("AddonLifecycleListenersTable", 2))
{
ImGui.TableSetupColumn("##AddonName", ImGuiTableColumnFlags.WidthFixed, 100.0f * ImGuiHelpers.GlobalScale);
@ -92,10 +92,10 @@ public class AddonLifecycleWidget : IDataWindowWidget
ImGui.TableNextColumn();
ImGui.Text($"{listener.FunctionDelegate.Method.DeclaringType?.FullName ?? "Unknown Declaring Type"}::{listener.FunctionDelegate.Method.Name}");
}
ImGui.EndTable();
}
ImGui.Unindent();
}
}
@ -111,7 +111,7 @@ public class AddonLifecycleWidget : IDataWindowWidget
{
ImGui.Text("No ReceiveEvent Hooks are Registered");
}
foreach (var receiveEventListener in this.AddonLifecycle.ReceiveEventListeners)
{
if (ImGui.CollapsingHeader(string.Join(", ", receiveEventListener.AddonNames)))
@ -135,7 +135,7 @@ public class AddonLifecycleWidget : IDataWindowWidget
var text = receiveEventListener.Hook.IsEnabled ? "Enabled" : "Disabled";
ImGui.TextColored(color, text);
}
ImGui.Columns(1);
}
}

View file

@ -1,7 +1,7 @@
using Dalamud.Game.Gui;
using Dalamud.Memory;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -15,7 +15,7 @@ internal unsafe class AddonWidget : IDataWindowWidget
private nint findAgentInterfacePtr;
/// <inheritdoc/>
public string DisplayName { get; init; } = "Addon";
public string DisplayName { get; init; } = "Addon";
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; }

View file

@ -3,7 +3,7 @@
using Dalamud.Game;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -19,7 +19,7 @@ internal class AddressesWidget : IDataWindowWidget
public string[]? CommandShortcuts { get; init; } = { "address" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Addresses";
public string DisplayName { get; init; } = "Addresses";
/// <inheritdoc/>
public bool Ready { get; set; }
@ -29,7 +29,7 @@ internal class AddressesWidget : IDataWindowWidget
{
this.Ready = true;
}
/// <inheritdoc/>
public void Draw()
{

View file

@ -1,6 +1,6 @@
using Dalamud.Game.ClientState.Aetherytes;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -14,9 +14,9 @@ internal class AetherytesWidget : IDataWindowWidget
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "aetherytes" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Aetherytes";
public string DisplayName { get; init; } = "Aetherytes";
/// <inheritdoc/>
public void Load()

View file

@ -6,7 +6,7 @@ using Dalamud.Interface.Utility.Raii;
using FFXIVClientStructs.FFXIV.Client.UI;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Lumina.Text.ReadOnly;
@ -36,7 +36,7 @@ internal unsafe class AtkArrayDataBrowserWidget : IDataWindowWidget
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "atkarray" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Atk Array Data";

View file

@ -1,6 +1,6 @@
using Dalamud.Game.ClientState.Buddy;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -16,9 +16,9 @@ internal class BuddyListWidget : IDataWindowWidget
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "buddy", "buddylist" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Buddy List";
public string DisplayName { get; init; } = "Buddy List";
/// <inheritdoc/>
public void Load()

View file

@ -3,7 +3,7 @@
using Dalamud.Game.Command;
using Dalamud.Interface.Utility.Raii;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -14,9 +14,9 @@ internal class CommandWidget : IDataWindowWidget
{
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "command" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Command";
public string DisplayName { get; init; } = "Command";
/// <inheritdoc/>
public bool Ready { get; set; }
@ -44,7 +44,7 @@ internal class CommandWidget : IDataWindowWidget
ImGui.TableSetupColumn("HelpMessage", ImGuiTableColumnFlags.NoSort);
ImGui.TableSetupColumn("In Help?", ImGuiTableColumnFlags.NoSort);
ImGui.TableHeadersRow();
var sortSpecs = ImGui.TableGetSortSpecs();
var commands = commandManager.Commands.ToArray();
@ -65,16 +65,16 @@ internal class CommandWidget : IDataWindowWidget
foreach (var command in commands)
{
ImGui.TableNextRow();
ImGui.TableSetColumnIndex(0);
ImGui.Text(command.Key);
ImGui.TableNextColumn();
ImGui.Text(commandManager.GetHandlerAssemblyName(command.Key, command.Value));
ImGui.TableNextColumn();
ImGui.TextWrapped(command.Value.HelpMessage);
ImGui.TableNextColumn();
ImGui.Text(command.Value.ShowInHelp ? "Yes" : "No");
}

View file

@ -1,7 +1,7 @@
using Dalamud.Game.ClientState.Conditions;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -15,9 +15,9 @@ internal class ConditionWidget : IDataWindowWidget
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "condition" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Condition";
public string DisplayName { get; init; } = "Condition";
/// <inheritdoc/>
public void Load()

View file

@ -11,7 +11,7 @@ using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using Dalamud.Plugin.Ipc.Internal;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Newtonsoft.Json;
@ -124,13 +124,13 @@ internal class DataShareWidget : IDataWindowWidget
if (ImGui.Button("Copy"))
{
fixed (byte* pData = data)
ImGuiNative.igSetClipboardText(pData);
ImGui.SetClipboardText(pData);
}
fixed (byte* pLabel = "text"u8)
fixed (byte* pData = data)
{
ImGuiNative.igInputTextMultiline(
ImGui.InputTextMultiline(
pLabel,
pData,
(uint)data.Length,
@ -148,7 +148,7 @@ internal class DataShareWidget : IDataWindowWidget
{
if (mi is null)
return "-";
var sb = new StringBuilder();
sb.Append(ReprType(mi.DeclaringType))
.Append("::")
@ -245,7 +245,7 @@ internal class DataShareWidget : IDataWindowWidget
{
ImGui.SetClipboardText(tooltip?.Invoke() ?? s);
Service<NotificationManager>.Get().AddNotification(
$"Copied {ImGui.TableGetColumnName()} to clipboard.",
$"Copied {ImGui.TableGetColumnNameS()} to clipboard.",
this.DisplayName,
NotificationType.Success);
}

View file

@ -5,7 +5,7 @@ using Dalamud.Configuration.Internal;
using Dalamud.Game;
using Dalamud.Game.Gui.Dtr;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;

View file

@ -3,7 +3,7 @@ using Dalamud.Interface.Textures.Internal;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -14,9 +14,9 @@ internal class FateTableWidget : IDataWindowWidget
{
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "fate", "fatetable" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Fate Table";
public string DisplayName { get; init; } = "Fate Table";
/// <inheritdoc/>
public bool Ready { get; set; }

View file

@ -2,7 +2,7 @@
using Dalamud.Game.Gui.FlyText;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -20,12 +20,12 @@ internal class FlyTextWidget : IDataWindowWidget
private int flyIcon;
private int flyDmgIcon;
private Vector4 flyColor = new(1, 0, 0, 1);
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "flytext" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Fly Text";
public string DisplayName { get; init; } = "Fly Text";
/// <inheritdoc/>
public bool Ready { get; set; }

View file

@ -3,7 +3,7 @@ using System.Linq;
using System.Numerics;
using Dalamud.Interface.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -19,12 +19,12 @@ internal class FontAwesomeTestWidget : IDataWindowWidget
private string iconSearchInput = string.Empty;
private bool iconSearchChanged = true;
private bool useFixedWidth = false;
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "fa", "fatest", "fontawesome" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Font Awesome Test";
public string DisplayName { get; init; } = "Font Awesome Test";
/// <inheritdoc/>
public bool Ready { get; set; }
@ -81,7 +81,7 @@ internal class FontAwesomeTestWidget : IDataWindowWidget
{
this.iconSearchChanged = true;
}
ImGui.Checkbox("Use fixed width font", ref this.useFixedWidth);
ImGuiHelpers.ScaledDummy(10f);
@ -96,7 +96,7 @@ internal class FontAwesomeTestWidget : IDataWindowWidget
ImGui.PopFont();
ImGuiHelpers.ScaledDummy(2f);
}
ImGui.PopStyleVar();
}
}

View file

@ -2,9 +2,11 @@
using System.Collections.Immutable;
using System.Linq;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using Dalamud.Bindings.ImGui;
using Dalamud.Game;
using Dalamud.Interface.FontIdentifier;
using Dalamud.Interface.GameFonts;
@ -13,9 +15,6 @@ using Dalamud.Interface.ManagedFontAtlas;
using Dalamud.Interface.ManagedFontAtlas.Internals;
using Dalamud.Interface.Utility;
using Dalamud.Utility;
using ImGuiNET;
using Serilog;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -66,10 +65,10 @@ internal class GamePrebakedFontsTestWidget : IDataWindowWidget, IDisposable
this.ClearAtlas();
fixed (byte* labelPtr = "Global Scale for Atlas"u8)
{
var v = (byte)(this.atlasScaleMode ? 1 : 0);
if (ImGuiNative.igCheckbox(labelPtr, &v) != 0)
var v = this.atlasScaleMode;
if (ImGui.Checkbox(labelPtr, ref v))
{
this.atlasScaleMode = v != 0;
this.atlasScaleMode = v;
this.ClearAtlas();
}
}
@ -77,40 +76,40 @@ internal class GamePrebakedFontsTestWidget : IDataWindowWidget, IDisposable
ImGui.SameLine();
fixed (byte* labelPtr = "Word Wrap"u8)
{
var v = (byte)(this.useWordWrap ? 1 : 0);
if (ImGuiNative.igCheckbox(labelPtr, &v) != 0)
this.useWordWrap = v != 0;
var v = this.useWordWrap;
if (ImGui.Checkbox(labelPtr, &v))
this.useWordWrap = v;
}
ImGui.SameLine();
fixed (byte* labelPtr = "Italic"u8)
{
var v = (byte)(this.useItalic ? 1 : 0);
if (ImGuiNative.igCheckbox(labelPtr, &v) != 0)
var v = this.useItalic;
if (ImGui.Checkbox(labelPtr, &v))
{
this.useItalic = v != 0;
this.useItalic = v;
this.ClearAtlas();
}
}
ImGui.SameLine();
fixed (byte* labelPtr = "Bold"u8)
{
var v = (byte)(this.useBold ? 1 : 0);
if (ImGuiNative.igCheckbox(labelPtr, &v) != 0)
var v = this.useBold;
if (ImGui.Checkbox(labelPtr, &v))
{
this.useBold = v != 0;
this.useBold = v;
this.ClearAtlas();
}
}
ImGui.SameLine();
fixed (byte* labelPtr = "Minimum Range"u8)
{
var v = (byte)(this.useMinimumBuild ? 1 : 0);
if (ImGuiNative.igCheckbox(labelPtr, &v) != 0)
var v = this.useMinimumBuild;
if (ImGui.Checkbox(labelPtr, &v))
{
this.useMinimumBuild = v != 0;
this.useMinimumBuild = v;
this.ClearAtlas();
}
}
@ -211,17 +210,17 @@ internal class GamePrebakedFontsTestWidget : IDataWindowWidget, IDisposable
fixed (byte* labelPtr = "Test Input"u8)
{
if (!this.atlasScaleMode)
ImGuiNative.igSetWindowFontScale(1 / ImGuiHelpers.GlobalScale);
ImGui.SetWindowFontScale(1 / ImGuiHelpers.GlobalScale);
using (this.fontDialogHandle.Push())
{
if (ImGuiNative.igInputTextMultiline(
if (ImGui.InputTextMultiline(
labelPtr,
this.testStringBuffer.Data,
(uint)this.testStringBuffer.Capacity,
new(ImGui.GetContentRegionAvail().X, ImGui.GetTextLineHeight() * 3),
0,
null,
null) != 0)
null))
{
var len = this.testStringBuffer.StorageSpan.IndexOf((byte)0);
if (len + 4 >= this.testStringBuffer.Capacity)
@ -238,7 +237,7 @@ internal class GamePrebakedFontsTestWidget : IDataWindowWidget, IDisposable
}
if (!this.atlasScaleMode)
ImGuiNative.igSetWindowFontScale(1);
ImGui.SetWindowFontScale(1);
}
this.fontHandles ??=
@ -285,7 +284,7 @@ internal class GamePrebakedFontsTestWidget : IDataWindowWidget, IDisposable
{
ImGui.TextUnformatted($"{gfs.SizePt}pt");
ImGui.SameLine(offsetX);
ImGuiNative.igPushTextWrapPos(this.useWordWrap ? 0f : -1f);
ImGui.PushTextWrapPos(this.useWordWrap ? 0f : -1f);
try
{
if (handle.Value.LoadException is { } exc)
@ -295,23 +294,23 @@ internal class GamePrebakedFontsTestWidget : IDataWindowWidget, IDisposable
else if (!handle.Value.Available)
{
fixed (byte* labelPtr = "Loading..."u8)
ImGuiNative.igTextUnformatted(labelPtr, labelPtr + 8 + ((Environment.TickCount / 200) % 3));
ImGui.TextUnformatted(labelPtr, labelPtr + 8 + ((Environment.TickCount / 200) % 3));
}
else
{
if (!this.atlasScaleMode)
ImGuiNative.igSetWindowFontScale(1 / ImGuiHelpers.GlobalScale);
ImGui.SetWindowFontScale(1 / ImGuiHelpers.GlobalScale);
if (counter++ % 2 == 0)
{
using var pushPop = handle.Value.Push();
ImGuiNative.igTextUnformatted(
ImGui.TextUnformatted(
this.testStringBuffer.Data,
this.testStringBuffer.Data + this.testStringBuffer.Length);
}
else
{
handle.Value.Push();
ImGuiNative.igTextUnformatted(
ImGui.TextUnformatted(
this.testStringBuffer.Data,
this.testStringBuffer.Data + this.testStringBuffer.Length);
handle.Value.Pop();
@ -320,8 +319,8 @@ internal class GamePrebakedFontsTestWidget : IDataWindowWidget, IDisposable
}
finally
{
ImGuiNative.igSetWindowFontScale(1);
ImGuiNative.igPopTextWrapPos();
ImGui.SetWindowFontScale(1);
ImGui.PopTextWrapPos();
}
}
}
@ -385,7 +384,7 @@ internal class GamePrebakedFontsTestWidget : IDataWindowWidget, IDisposable
var dim = default(Vector2);
var test = "Test string"u8;
fixed (byte* pTest = test)
ImGuiNative.ImFont_CalcTextSizeA(&dim, fontPtr, fontPtr.FontSize, float.MaxValue, 0, pTest, null, null);
ImGui.CalcTextSizeA(ref dim, fontPtr, fontPtr.FontSize, float.MaxValue, 0f, pTest, (string)null, null);
Log.Information($"{nameof(GamePrebakedFontsTestWidget)}: {handle} => {dim}");
}
}

View file

@ -1,7 +1,7 @@
using Dalamud.Game.ClientState.GamePad;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;

View file

@ -2,7 +2,7 @@ using Dalamud.Game.ClientState;
using Dalamud.Game.ClientState.JobGauge;
using Dalamud.Game.ClientState.JobGauge.Types;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -13,9 +13,9 @@ internal class GaugeWidget : IDataWindowWidget
{
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "gauge", "jobgauge", "job" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Job Gauge";
public string DisplayName { get; init; } = "Job Gauge";
/// <inheritdoc/>
public bool Ready { get; set; }

View file

@ -1,7 +1,10 @@
using System.Runtime.InteropServices;
using Windows.Win32.Foundation;
using Windows.Win32.UI.WindowsAndMessaging;
using Dalamud.Hooking;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using PInvoke;
using Serilog;
@ -14,19 +17,19 @@ internal class HookWidget : IDataWindowWidget
{
private Hook<MessageBoxWDelegate>? messageBoxMinHook;
private bool hookUseMinHook;
private delegate int MessageBoxWDelegate(
IntPtr hWnd,
[MarshalAs(UnmanagedType.LPWStr)] string text,
[MarshalAs(UnmanagedType.LPWStr)] string caption,
NativeFunctions.MessageBoxType type);
MESSAGEBOX_STYLE type);
/// <inheritdoc/>
public string DisplayName { get; init; } = "Hook";
public string DisplayName { get; init; } = "Hook";
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "hook" };
/// <inheritdoc/>
public bool Ready { get; set; }
@ -53,7 +56,7 @@ internal class HookWidget : IDataWindowWidget
this.messageBoxMinHook?.Disable();
if (ImGui.Button("Call Original"))
this.messageBoxMinHook?.Original(IntPtr.Zero, "Hello from .Original", "Hook Test", NativeFunctions.MessageBoxType.Ok);
this.messageBoxMinHook?.Original(IntPtr.Zero, "Hello from .Original", "Hook Test", MESSAGEBOX_STYLE.MB_OK);
if (ImGui.Button("Dispose"))
{
@ -62,7 +65,7 @@ internal class HookWidget : IDataWindowWidget
}
if (ImGui.Button("Test"))
_ = NativeFunctions.MessageBoxW(IntPtr.Zero, "Hi", "Hello", NativeFunctions.MessageBoxType.Ok);
_ = global::Windows.Win32.PInvoke.MessageBox(HWND.Null, "Hi", "Hello", MESSAGEBOX_STYLE.MB_OK);
if (this.messageBoxMinHook != null)
ImGui.Text("Enabled: " + this.messageBoxMinHook?.IsEnabled);
@ -72,12 +75,12 @@ internal class HookWidget : IDataWindowWidget
Log.Error(ex, "MinHook error caught");
}
}
private int MessageBoxWDetour(IntPtr hwnd, string text, string caption, NativeFunctions.MessageBoxType type)
private int MessageBoxWDetour(IntPtr hwnd, string text, string caption, MESSAGEBOX_STYLE type)
{
Log.Information("[DATAHOOK] {Hwnd} {Text} {Caption} {Type}", hwnd, text, caption, type);
var result = this.messageBoxMinHook!.Original(hwnd, "Cause Access Violation?", caption, NativeFunctions.MessageBoxType.YesNo);
var result = this.messageBoxMinHook!.Original(hwnd, "Cause Access Violation?", caption, MESSAGEBOX_STYLE.MB_YESNO);
if (result == (int)User32.MessageBoxResult.IDYES)
{

View file

@ -8,7 +8,7 @@ using Dalamud.Interface.Textures.TextureWraps;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Internal;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;

View file

@ -11,7 +11,7 @@ using Dalamud.Interface.Textures.TextureWraps;
using Dalamud.Interface.Windowing;
using Dalamud.Storage.Assets;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -457,7 +457,7 @@ internal class ImGuiWidget : IDataWindowWidget
public DisposeLoggingTextureWrap(IDalamudTextureWrap inner) => this.inner = inner;
public nint ImGuiHandle => this.inner.ImGuiHandle;
public ImTextureID ImGuiHandle => this.inner.ImGuiHandle;
public int Width => this.inner.Width;

View file

@ -13,7 +13,7 @@ using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Client.Game;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Lumina.Excel.Sheets;

View file

@ -1,7 +1,7 @@
using Dalamud.Game.ClientState.Keys;
using Dalamud.Interface.Colors;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -12,9 +12,9 @@ internal class KeyStateWidget : IDataWindowWidget
{
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "keystate" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "KeyState";
public string DisplayName { get; init; } = "KeyState";
/// <inheritdoc/>
public bool Ready { get; set; }

View file

@ -5,7 +5,9 @@ using Dalamud.Game.MarketBoard;
using Dalamud.Game.Network.Structures;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using ImGuiTable = Dalamud.Interface.Utility.ImGuiTable;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;

View file

@ -8,7 +8,9 @@ using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using Dalamud.Memory;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using ImGuiTable = Dalamud.Interface.Utility.ImGuiTable;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -42,9 +44,9 @@ internal class NetworkMonitorWidget : IDataWindowWidget
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "network", "netmon", "networkmonitor" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Network Monitor";
public string DisplayName { get; init; } = "Network Monitor";
/// <inheritdoc/>
public bool Ready { get; set; }
@ -59,7 +61,7 @@ internal class NetworkMonitorWidget : IDataWindowWidget
this.packets.Clear();
this.Ready = true;
}
/// <inheritdoc/>
public void Draw()
{
@ -203,7 +205,7 @@ internal class NetworkMonitorWidget : IDataWindowWidget
/// <remarks> The filter should find opCodes by number (decimal and hex) and name, if existing. </remarks>
private string OpCodeToString(ushort opCode)
=> $"{opCode}\0{opCode:X}";
#pragma warning disable SA1313
private readonly record struct NetworkPacketData(ushort OpCode, NetworkMessageDirection Direction, uint SourceActorId, uint TargetActorId)
#pragma warning restore SA1313

View file

@ -8,7 +8,7 @@ using Dalamud.Game.Text.Noun;
using Dalamud.Game.Text.Noun.Enums;
using Dalamud.Interface.Utility.Raii;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Lumina.Data;
using Lumina.Excel;
using Lumina.Excel.Sheets;

View file

@ -4,7 +4,7 @@ using Dalamud.Game.ClientState;
using Dalamud.Game.ClientState.Objects;
using Dalamud.Game.Gui;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -19,24 +19,24 @@ internal class ObjectTableWidget : IDataWindowWidget
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "ot", "objecttable" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Object Table";
public string DisplayName { get; init; } = "Object Table";
/// <inheritdoc/>
public bool Ready { get; set; }
/// <inheritdoc/>
public void Load()
{
this.Ready = true;
}
/// <inheritdoc/>
public void Draw()
{
ImGui.Checkbox("Resolve GameData", ref this.resolveGameData);
var chatGui = Service<ChatGui>.Get();
var clientState = Service<ClientState>.Get();
var gameGui = Service<GameGui>.Get();

View file

@ -1,6 +1,6 @@
using Dalamud.Game.ClientState.Party;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -13,9 +13,9 @@ internal class PartyListWidget : IDataWindowWidget
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "partylist", "party" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Party List";
public string DisplayName { get; init; } = "Party List";
/// <inheritdoc/>
public bool Ready { get; set; }

View file

@ -4,7 +4,7 @@ using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Plugin.Ipc;
using Dalamud.Plugin.Ipc.Internal;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Serilog;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -17,18 +17,18 @@ internal class PluginIpcWidget : IDataWindowWidget
// IPC
private ICallGateProvider<string, string>? ipcPub;
private ICallGateSubscriber<string, string>? ipcSub;
// IPC
private ICallGateProvider<ICharacter?, string>? ipcPubGo;
private ICallGateSubscriber<ICharacter?, string>? ipcSubGo;
private string callGateResponse = string.Empty;
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "ipc" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Plugin IPC";
public string DisplayName { get; init; } = "Plugin IPC";
/// <inheritdoc/>
public bool Ready { get; set; }
@ -108,17 +108,17 @@ internal class PluginIpcWidget : IDataWindowWidget
{
this.callGateResponse = this.ipcSub.InvokeFunc("button2");
}
if (ImGui.Button("Action GO"))
{
this.ipcSubGo.InvokeAction(Service<ClientState>.Get().LocalPlayer);
}
if (ImGui.Button("Func GO"))
{
this.callGateResponse = this.ipcSubGo.InvokeFunc(Service<ClientState>.Get().LocalPlayer);
}
if (!this.callGateResponse.IsNullOrEmpty())
ImGui.Text($"Response: {this.callGateResponse}");
}

View file

@ -1,7 +1,7 @@
using System.Linq;
using Dalamud.Game.Text;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -12,9 +12,9 @@ internal class SeFontTestWidget : IDataWindowWidget
{
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "sefont", "sefonttest" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "SeFont Test";
public string DisplayName { get; init; } = "SeFont Test";
/// <inheritdoc/>
public bool Ready { get; set; }

View file

@ -19,7 +19,7 @@ using FFXIVClientStructs.FFXIV.Client.UI;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using FFXIVClientStructs.FFXIV.Component.Text;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Lumina.Data;
using Lumina.Data.Files.Excel;
@ -225,7 +225,7 @@ internal class SeStringCreatorWidget : IDataWindowWidget
if (ImGui.IsItemHovered())
{
ImGui.SetMouseCursor(ImGuiMouseCursor.ResizeEW);
ImGui.SetMouseCursor(ImGuiMouseCursor.ResizeEw);
if (ImGui.IsMouseDoubleClicked(ImGuiMouseButton.Left))
{

View file

@ -13,7 +13,7 @@ using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Lumina.Excel.Sheets;
using Lumina.Text;
@ -193,7 +193,7 @@ internal unsafe class SeStringRendererTestWidget : IDataWindowWidget
var addon = Service<DataManager>.GetNullable()?.GetExcelSheet<Addon>() ??
throw new InvalidOperationException("Addon sheet not loaded.");
var clipper = new ImGuiListClipperPtr(ImGuiNative.ImGuiListClipper_ImGuiListClipper());
var clipper = new ImGuiListClipperPtr(ImGui.ImGuiListClipper());
clipper.Begin(addon.Count);
while (clipper.Step())
{
@ -266,14 +266,14 @@ internal unsafe class SeStringRendererTestWidget : IDataWindowWidget
fixed (byte* labelPtr = "Test Input"u8)
{
if (ImGuiNative.igInputTextMultiline(
if (ImGui.InputTextMultiline(
labelPtr,
this.testStringBuffer.Data,
(uint)this.testStringBuffer.Capacity,
new(ImGui.GetContentRegionAvail().X, ImGui.GetTextLineHeight() * 3),
0,
null,
null) != 0)
null))
{
var len = this.testStringBuffer.StorageSpan.IndexOf((byte)0);
if (len + 4 >= this.testStringBuffer.Capacity)

View file

@ -8,7 +8,7 @@ using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using Dalamud.IoC.Internal;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -26,9 +26,9 @@ internal class ServicesWidget : IDataWindowWidget
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "services" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Service Container";
public string DisplayName { get; init; } = "Service Container";
/// <inheritdoc/>
public bool Ready { get; set; }
@ -48,7 +48,7 @@ internal class ServicesWidget : IDataWindowWidget
{
if (ImGui.Button("Clear selection"))
this.selectedNodes.Clear();
ImGui.SameLine();
switch (this.includeUnloadDependencies)
{
@ -90,12 +90,12 @@ internal class ServicesWidget : IDataWindowWidget
var dl = ImGui.GetWindowDrawList();
var mouse = ImGui.GetMousePos();
var maxRowWidth = 0f;
// 1. Layout
for (var level = 0; level < this.dependencyNodes.Count; level++)
{
var levelNodes = this.dependencyNodes[level];
var rowWidth = 0f;
foreach (var node in levelNodes)
rowWidth += node.DisplayedNameSize.X + cellPad.X + margin.X;
@ -139,7 +139,7 @@ internal class ServicesWidget : IDataWindowWidget
{
var rect = this.nodeRects[node];
var point1 = new Vector2((rect.X + rect.Z) / 2, rect.Y);
foreach (var parent in node.InvalidParents)
{
rect = this.nodeRects[parent];
@ -149,7 +149,7 @@ internal class ServicesWidget : IDataWindowWidget
dl.AddLine(point1, point2, lineInvalidColor, 2f * ImGuiHelpers.GlobalScale);
}
foreach (var parent in node.Parents)
{
rect = this.nodeRects[parent];
@ -170,7 +170,7 @@ internal class ServicesWidget : IDataWindowWidget
}
}
}
// 3. Draw boxes
foreach (var levelNodes in this.dependencyNodes)
{
@ -231,7 +231,7 @@ internal class ServicesWidget : IDataWindowWidget
}
}
}
ImGui.SetCursorPos(default);
ImGui.Dummy(new(maxRowWidth, this.dependencyNodes.Count * rowHeight));
ImGui.EndChild();
@ -301,7 +301,7 @@ internal class ServicesWidget : IDataWindowWidget
public string DisplayedName { get; }
public string TypeSuffix { get; }
public uint TypeSuffixColor { get; }
public Vector2 DisplayedNameSize =>
@ -319,7 +319,7 @@ internal class ServicesWidget : IDataWindowWidget
public IEnumerable<ServiceDependencyNode> Relatives =>
this.parents.Concat(this.children).Concat(this.invalidParents);
public int Level { get; private set; }
public static List<ServiceDependencyNode> CreateTree(bool includeUnloadDependencies)

View file

@ -1,4 +1,4 @@
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Newtonsoft.Json;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -10,9 +10,9 @@ internal class StartInfoWidget : IDataWindowWidget
{
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "startinfo" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Start Info";
public string DisplayName { get; init; } = "Start Info";
/// <inheritdoc/>
public bool Ready { get; set; }

View file

@ -2,7 +2,7 @@
using Dalamud.Game.ClientState.Objects;
using Dalamud.Interface.Utility;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -12,12 +12,12 @@ namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
internal class TargetWidget : IDataWindowWidget
{
private bool resolveGameData;
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "target" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Target";
public string DisplayName { get; init; } = "Target";
/// <inheritdoc/>
public bool Ready { get; set; }
@ -32,7 +32,7 @@ internal class TargetWidget : IDataWindowWidget
public void Draw()
{
ImGui.Checkbox("Resolve GameData", ref this.resolveGameData);
var clientState = Service<ClientState>.Get();
var targetMgr = Service<TargetManager>.Get();
@ -67,10 +67,10 @@ internal class TargetWidget : IDataWindowWidget
if (targetMgr.SoftTarget != null)
Util.PrintGameObject(targetMgr.SoftTarget, "SoftTarget", this.resolveGameData);
if (targetMgr.GPoseTarget != null)
Util.PrintGameObject(targetMgr.GPoseTarget, "GPoseTarget", this.resolveGameData);
if (targetMgr.MouseOverNameplateTarget != null)
Util.PrintGameObject(targetMgr.MouseOverNameplateTarget, "MouseOverNameplateTarget", this.resolveGameData);

View file

@ -17,7 +17,7 @@ using Dalamud.Interface.Utility.Raii;
using Dalamud.Logging.Internal;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Serilog;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -28,18 +28,18 @@ namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
internal class TaskSchedulerWidget : IDataWindowWidget
{
private readonly FileDialogManager fileDialogManager = new();
private readonly byte[] urlBytes = new byte[2048];
private readonly byte[] localPathBytes = new byte[2048];
private string url = "https://geo.mirror.pkgbuild.com/iso/2024.01.01/archlinux-2024.01.01-x86_64.iso";
private string localPath = string.Empty;
private Task? downloadTask = null;
private (long Downloaded, long Total, float Percentage) downloadState;
private CancellationTokenSource taskSchedulerCancelSource = new();
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "tasksched", "taskscheduler" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Task Scheduler";
public string DisplayName { get; init; } = "Task Scheduler";
/// <inheritdoc/>
public bool Ready { get; set; }
@ -48,9 +48,6 @@ internal class TaskSchedulerWidget : IDataWindowWidget
public void Load()
{
this.Ready = true;
Encoding.UTF8.GetBytes(
"https://geo.mirror.pkgbuild.com/iso/2024.01.01/archlinux-2024.01.01-x86_64.iso",
this.urlBytes);
}
/// <inheritdoc/>
@ -247,13 +244,13 @@ internal class TaskSchedulerWidget : IDataWindowWidget
if (ImGui.CollapsingHeader("Download"))
{
ImGui.InputText("URL", this.urlBytes, (uint)this.urlBytes.Length);
ImGui.InputText("Local Path", this.localPathBytes, (uint)this.localPathBytes.Length);
ImGui.InputText("URL", ref this.url, (uint)this.url.Length);
ImGui.InputText("Local Path", ref this.localPath, (uint)this.localPath.Length);
ImGui.SameLine();
if (ImGuiComponents.IconButton("##localpathpicker", FontAwesomeIcon.File))
{
var defaultFileName = Encoding.UTF8.GetString(this.urlBytes).Split('\0', 2)[0].Split('/').Last();
var defaultFileName = this.url.Split('\0', 2)[0].Split('/').Last();
this.fileDialogManager.SaveFileDialog(
"Choose a local path",
"*",
@ -263,8 +260,7 @@ internal class TaskSchedulerWidget : IDataWindowWidget
{
if (accept)
{
this.localPathBytes.AsSpan().Clear();
Encoding.UTF8.GetBytes(newPath, this.localPathBytes.AsSpan());
this.localPath = newPath;
}
});
}
@ -272,7 +268,7 @@ internal class TaskSchedulerWidget : IDataWindowWidget
ImGui.TextUnformatted($"{this.downloadState.Downloaded:##,###}/{this.downloadState.Total:##,###} ({this.downloadState.Percentage:0.00}%)");
using var disabled =
ImRaii.Disabled(this.downloadTask?.IsCompleted is false || this.localPathBytes[0] == 0);
ImRaii.Disabled(this.downloadTask?.IsCompleted is false || this.localPath[0] == 0);
ImGui.AlignTextToFramePadding();
ImGui.TextUnformatted("Download");
ImGui.SameLine();
@ -281,8 +277,6 @@ internal class TaskSchedulerWidget : IDataWindowWidget
var downloadUsingFramework = ImGui.Button("using Framework.Update");
if (downloadUsingGlobalScheduler || downloadUsingFramework)
{
var url = Encoding.UTF8.GetString(this.urlBytes).Split('\0', 2)[0];
var localPath = Encoding.UTF8.GetString(this.localPathBytes).Split('\0', 2)[0];
var ct = this.taskSchedulerCancelSource.Token;
this.downloadState = default;
var factory = downloadUsingGlobalScheduler
@ -294,9 +288,9 @@ internal class TaskSchedulerWidget : IDataWindowWidget
{
try
{
await using var to = File.Create(localPath);
await using var to = File.Create(this.localPath);
using var client = new HttpClient();
using var conn = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead, ct);
using var conn = await client.GetAsync(this.url, HttpCompletionOption.ResponseHeadersRead, ct);
this.downloadState.Total = conn.Content.Headers.ContentLength ?? -1L;
await using var from = conn.Content.ReadAsStream(ct);
var buffer = new byte[8192];
@ -339,31 +333,31 @@ internal class TaskSchedulerWidget : IDataWindowWidget
{
var token = this.taskSchedulerCancelSource.Token;
Task.Run(
() =>
() =>
{
for (var i = 0; i < 100; i++)
{
token.ThrowIfCancellationRequested();
Task.Run(
() =>
() =>
{
for (var j = 0; j < 100; j++)
{
token.ThrowIfCancellationRequested();
Task.Run(
() =>
() =>
{
for (var k = 0; k < 100; k++)
{
token.ThrowIfCancellationRequested();
Task.Run(
() =>
() =>
{
for (var l = 0; l < 100; l++)
{
token.ThrowIfCancellationRequested();
Task.Run(
async () =>
async () =>
{
for (var m = 0; m < 100; m++)
{
@ -380,7 +374,7 @@ internal class TaskSchedulerWidget : IDataWindowWidget
}
});
}
ImGui.SameLine();
ImGuiHelpers.ScaledDummy(20);
@ -456,7 +450,7 @@ internal class TaskSchedulerWidget : IDataWindowWidget
this.fileDialogManager.Draw();
}
private async Task TestTaskInTaskDelay(CancellationToken token)
{
await Task.Delay(5000, token);

View file

@ -17,7 +17,7 @@ using Dalamud.Plugin.Services;
using Dalamud.Storage.Assets;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using TerraFX.Interop.DirectX;
@ -288,7 +288,7 @@ internal class TexWidget : IDataWindowWidget
{
if (t.GetTexture(this.textureManager) is { } source)
{
var psrv = (ID3D11ShaderResourceView*)source.ImGuiHandle;
var psrv = (ID3D11ShaderResourceView*)source.ImGuiHandle.Handle;
var rcsrv = psrv->AddRef() - 1;
psrv->Release();
@ -404,13 +404,13 @@ internal class TexWidget : IDataWindowWidget
ImGui.TableHeadersRow();
var sortSpecs = ImGui.TableGetSortSpecs();
if (sortSpecs.NativePtr is not null && (sortSpecs.SpecsDirty || shouldSortAgain))
if (sortSpecs.Handle is not null && (sortSpecs.SpecsDirty || shouldSortAgain))
{
allBlames.Sort(
static (a, b) =>
{
var sortSpecs = ImGui.TableGetSortSpecs();
var specs = new Span<ImGuiTableColumnSortSpecs>(sortSpecs.NativePtr->Specs, sortSpecs.SpecsCount);
var specs = new Span<ImGuiTableColumnSortSpecs>(sortSpecs.Handle->Specs, sortSpecs.SpecsCount);
Span<bool> sorted = stackalloc bool[(int)DrawBlameTableColumnUserId.ColumnCount];
foreach (ref var spec in specs)
{
@ -442,7 +442,7 @@ internal class TexWidget : IDataWindowWidget
sortSpecs.SpecsDirty = false;
}
var clipper = new ImGuiListClipperPtr(ImGuiNative.ImGuiListClipper_ImGuiListClipper());
var clipper = new ImGuiListClipperPtr(ImGui.ImGuiListClipper());
clipper.Begin(allBlames.Count);
while (clipper.Step())
@ -531,7 +531,7 @@ internal class TexWidget : IDataWindowWidget
(ImGui.GetStyle().ItemSpacing.X * 1 * numIcons));
ImGui.TableHeadersRow();
var clipper = new ImGuiListClipperPtr(ImGuiNative.ImGuiListClipper_ImGuiListClipper());
var clipper = new ImGuiListClipperPtr(ImGui.ImGuiListClipper());
clipper.Begin(textures.Count);
using (var enu = textures.GetEnumerator())

View file

@ -3,7 +3,7 @@
using Dalamud.Game.Gui.Toast;
using Dalamud.Interface.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
@ -19,12 +19,12 @@ internal class ToastWidget : IDataWindowWidget
private bool questToastSound;
private int questToastIconId;
private bool questToastCheckmark;
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "toast" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Toast";
public string DisplayName { get; init; } = "Toast";
/// <inheritdoc/>
public bool Ready { get; set; }

View file

@ -7,7 +7,7 @@ using Dalamud.Interface.ImGuiNotification;
using Dalamud.Interface.ImGuiNotification.Internal;
using Dalamud.Interface.ImGuiSeStringRenderer.Internal;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Lumina.Excel.Sheets;
@ -66,7 +66,7 @@ internal class UiColorWidget : IDataWindowWidget
ImGui.TableSetupColumn("Clear Blue", ImGuiTableColumnFlags.WidthFixed, colorw);
ImGui.TableHeadersRow();
var clipper = new ImGuiListClipperPtr(ImGuiNative.ImGuiListClipper_ImGuiListClipper());
var clipper = new ImGuiListClipperPtr(ImGui.ImGuiListClipper());
clipper.Begin(colors.Count, ImGui.GetFrameHeightWithSpacing());
while (clipper.Step())
{

View file

@ -13,7 +13,7 @@ using Dalamud.Interface.Textures.Internal;
using Dalamud.Interface.Utility;
using Dalamud.Memory;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Lumina.Data.Files;
using Lumina.Data.Parsing.Uld;

View file

@ -3,7 +3,7 @@ using System.IO;
using Dalamud.Configuration.Internal;
using Dalamud.Storage;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Serilog;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;

View file

@ -3,7 +3,7 @@ using System.Numerics;
using CheapLoc;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Windowing;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows;

View file

@ -1,7 +1,7 @@
using Dalamud.Configuration.Internal;
using Dalamud.Interface.Windowing;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows;
@ -22,7 +22,7 @@ public class HitchSettingsWindow : Window
this.ShowCloseButton = true;
this.RespectCloseHotkey = true;
}
/// <inheritdoc/>
public override void Draw()
{
@ -41,14 +41,14 @@ public class HitchSettingsWindow : Window
config.FrameworkUpdateHitch = frameworkUpdateHitch;
config.QueueSave();
}
var gameNetworkUpHitch = (float)config.GameNetworkUpHitch;
if (ImGui.SliderFloat("GameNetworkUpHitch", ref gameNetworkUpHitch, MinHitch, MaxHitch))
{
config.GameNetworkUpHitch = gameNetworkUpHitch;
config.QueueSave();
}
var gameNetworkDownHitch = (float)config.GameNetworkDownHitch;
if (ImGui.SliderFloat("GameNetworkDownHitch", ref gameNetworkDownHitch, MinHitch, MaxHitch))
{

View file

@ -34,7 +34,7 @@ using Dalamud.Plugin.Internal.Types.Manifest;
using Dalamud.Support;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.PluginInstaller;

View file

@ -14,7 +14,7 @@ using Dalamud.Interface.Utility.Raii;
using Dalamud.Plugin.Internal;
using Dalamud.Plugin.Internal.Profiles;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Serilog;
namespace Dalamud.Interface.Internal.Windows.PluginInstaller;
@ -56,11 +56,11 @@ internal class ProfileManagerWidget
this.DrawChoice();
return;
}
var tutorialTitle = Locs.TutorialTitle + "###collectionsTutorWindow";
var tutorialId = ImGui.GetID(tutorialTitle);
this.DrawTutorial(tutorialTitle);
switch (this.mode)
{
case Mode.Overview:
@ -120,22 +120,22 @@ internal class ProfileManagerWidget
ImGuiHelpers.SafeTextWrapped(Locs.TutorialParagraphFour);
ImGuiHelpers.ScaledDummy(5);
ImGuiHelpers.SafeTextWrapped(Locs.TutorialCommands);
ImGui.Bullet();
ImGui.SameLine();
ImGuiHelpers.SafeTextWrapped(Locs.TutorialCommandsEnable);
ImGui.Bullet();
ImGui.SameLine();
ImGuiHelpers.SafeTextWrapped(Locs.TutorialCommandsDisable);
ImGui.Bullet();
ImGui.SameLine();
ImGuiHelpers.SafeTextWrapped(Locs.TutorialCommandsToggle);
ImGuiHelpers.SafeTextWrapped(Locs.TutorialCommandsEnd);
ImGuiHelpers.ScaledDummy(5);
var buttonWidth = 120f;
ImGui.SetCursorPosX((ImGui.GetWindowWidth() - buttonWidth) / 2);
if (ImGui.Button("OK", new Vector2(buttonWidth, 40)))
@ -174,7 +174,7 @@ internal class ProfileManagerWidget
{
try
{
profman.ImportProfile(ImGui.GetClipboardText());
profman.ImportProfile(ImGui.GetClipboardTextS());
Service<NotificationManager>.Get().AddNotification(Locs.NotificationImportSuccess, type: NotificationType.Success);
}
catch (Exception ex)
@ -186,14 +186,14 @@ internal class ProfileManagerWidget
if (ImGui.IsItemHovered())
ImGui.SetTooltip(Locs.ImportProfileHint);
ImGui.SameLine();
ImGuiHelpers.ScaledDummy(5);
ImGui.SameLine();
if (ImGuiComponents.IconButton(FontAwesomeIcon.Question))
ImGui.OpenPopup(tutorialId);
if (ImGui.IsItemHovered())
ImGui.SetTooltip(Locs.TutorialHint);
@ -425,7 +425,7 @@ internal class ProfileManagerWidget
ImGui.Image(pic.DevPluginIcon.ImGuiHandle, new Vector2(pluginLineHeight));
ImGui.PopStyleVar();
}
ImGui.SameLine();
var text = $"{pmPlugin.Name}{(pmPlugin.IsDev ? " (dev plugin" : string.Empty)}";
@ -448,12 +448,12 @@ internal class ProfileManagerWidget
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + (pluginLineHeight / 2) - (textHeight.Y / 2));
ImGui.TextUnformatted(text);
var firstAvailableInstalled = pm.InstalledPlugins.FirstOrDefault(x => x.InternalName == profileEntry.InternalName);
var installable =
pm.AvailablePlugins.FirstOrDefault(
x => x.InternalName == profileEntry.InternalName && !x.SourceRepo.IsThirdParty);
if (firstAvailableInstalled != null)
{
ImGui.Text($"Match to plugin '{firstAvailableInstalled.Name}'?");
@ -488,7 +488,7 @@ internal class ProfileManagerWidget
if (ImGui.IsItemHovered())
ImGui.SetTooltip(Locs.InstallPlugin);
}
ImGui.SetCursorPos(before);
}
@ -608,13 +608,13 @@ internal class ProfileManagerWidget
public static string TutorialTitle =>
Loc.Localize("ProfileManagerTutorial", "About Collections");
public static string TutorialParagraphOne =>
Loc.Localize("ProfileManagerTutorialParagraphOne", "Collections are shareable lists of plugins that can be enabled or disabled in the plugin installer or via chat commands.\nWhen a plugin is part of a collection, it will be enabled if the collection is enabled. If a plugin is part of multiple collections, it will be enabled if one or more collections it is a part of are enabled.");
public static string TutorialParagraphTwo =>
Loc.Localize("ProfileManagerTutorialParagraphTwo", "You can add plugins to collections by clicking the plus button when editing a collection on this screen, or by using the button with the toolbox icon on the \"Installed Plugins\" screen.");
public static string TutorialParagraphThree =>
Loc.Localize("ProfileManagerTutorialParagraphThree", "If a collection's \"Start on boot\" checkbox is ticked, the collection and the plugins within will be enabled every time the game starts up, even if it has been manually disabled in a prior session.");
@ -623,25 +623,25 @@ internal class ProfileManagerWidget
public static string TutorialCommands =>
Loc.Localize("ProfileManagerTutorialCommands", "You can use the following commands in chat or in macros to manage active collections:");
public static string TutorialCommandsEnable =>
Loc.Localize("ProfileManagerTutorialCommandsEnable", "{0} \"Collection Name\" - Enable a collection").Format(PluginManagementCommandHandler.CommandEnableProfile);
public static string TutorialCommandsDisable =>
Loc.Localize("ProfileManagerTutorialCommandsDisable", "{0} \"Collection Name\" - Disable a collection").Format(PluginManagementCommandHandler.CommandDisableProfile);
public static string TutorialCommandsToggle =>
Loc.Localize("ProfileManagerTutorialCommandsToggle", "{0} \"Collection Name\" - Toggle a collection's state").Format(PluginManagementCommandHandler.CommandToggleProfile);
public static string TutorialCommandsEnd =>
Loc.Localize("ProfileManagerTutorialCommandsEnd", "If you run multiple of these commands, they will be executed in order.");
public static string Choice1 =>
Loc.Localize("ProfileManagerChoice1", "Plugin collections are a new feature that allow you to group plugins into collections which can be toggled and shared.");
public static string Choice2 =>
Loc.Localize("ProfileManagerChoice2", "They are experimental and may still contain bugs. Do you want to enable them now?");
public static string ChoiceConfirmation =>
Loc.Localize("ProfileManagerChoiceConfirmation", "Yes, enable Plugin Collections");

View file

@ -12,7 +12,7 @@ using Dalamud.Interface.Windowing;
using Dalamud.Plugin.Internal;
using Dalamud.Plugin.Internal.Types;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Serilog;
namespace Dalamud.Interface.Internal.Windows;

View file

@ -8,7 +8,7 @@ using Dalamud.Interface.Utility;
using Dalamud.Interface.Windowing;
using Dalamud.Utility.Numerics;
using Dalamud.Utility.Timing;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows;
@ -192,7 +192,7 @@ public class ProfilerWindow : Window
var eventsXPos = new List<float>();
const float eventsXPosFudge = 5f;
foreach (var timingEvent in Timings.Events)
{
var startX = (timingEvent.StartTime - this.min) / (this.max - this.min) * width;
@ -217,7 +217,7 @@ public class ProfilerWindow : Window
{
textPos.X = pos.X + (uint)startX - textSize.X - padding;
}
var numClashes = eventsXPos.Count(x => Math.Abs(x - textPos.X) < textSize.X + eventsXPosFudge);
if (numClashes > 0)
{
@ -228,7 +228,7 @@ public class ProfilerWindow : Window
textPos,
ImGui.GetColorU32(ImGuiColors.DalamudWhite),
timingEvent.Name);
eventsXPos.Add(textPos.X);
}
}

View file

@ -9,7 +9,7 @@ using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using Dalamud.Interface.Windowing;
using Dalamud.Logging.Internal;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Lumina.Excel.Sheets;
namespace Dalamud.Interface.Internal.Windows.SelfTest;

View file

@ -1,6 +1,6 @@
using Dalamud.Game.ClientState.Objects;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;

View file

@ -3,7 +3,7 @@
using Dalamud.Game.Addon.Lifecycle;
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;

View file

@ -1,6 +1,6 @@
using Dalamud.Game.ClientState.Aetherytes;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;

View file

@ -2,7 +2,7 @@ using Dalamud.Game.Gui;
using Dalamud.Game.Text;
using Dalamud.Game.Text.SeStringHandling;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;

View file

@ -1,6 +1,6 @@
using Dalamud.Game.ClientState.Conditions;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Serilog;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;

View file

@ -7,7 +7,7 @@ using Dalamud.Game.ClientState.Objects.SubKinds;
using Dalamud.Game.Gui.ContextMenu;
using Dalamud.Game.Text;
using Dalamud.Game.Text.SeStringHandling;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using Lumina.Excel;
using Lumina.Excel.Sheets;
using Serilog;

View file

@ -1,6 +1,6 @@
using Dalamud.Game.DutyState;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;

View file

@ -1,6 +1,6 @@
using Dalamud.Game.ClientState;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;

View file

@ -1,6 +1,6 @@
using Dalamud.Game.ClientState.Fates;
using Dalamud.Utility;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;

View file

@ -1,6 +1,6 @@
using Dalamud.Game.Config;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;

View file

@ -1,6 +1,6 @@
using Dalamud.Game.Gui;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;

View file

@ -2,7 +2,7 @@
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Game.Text.SeStringHandling.Payloads;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;

View file

@ -1,6 +1,6 @@
using Dalamud.Game.ClientState.Keys;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;

View file

@ -1,6 +1,6 @@
using Dalamud.Game.ClientState;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;

View file

@ -1,6 +1,6 @@
using Dalamud.Game.ClientState;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;

View file

@ -3,7 +3,7 @@ using System.Linq;
using Dalamud.Game.MarketBoard;
using Dalamud.Game.Network.Structures;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;

View file

@ -4,7 +4,7 @@ using Dalamud.Game.Gui.NamePlate;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Game.Text.SeStringHandling.Payloads;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;

View file

@ -2,7 +2,7 @@ using Dalamud.Game;
using Dalamud.Game.Text.Noun;
using Dalamud.Game.Text.Noun.Enums;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
using LSheets = Lumina.Excel.Sheets;
@ -212,7 +212,7 @@ internal class NounProcessorSelfTestStep : ISelfTestStep
for (var i = 0; i < this.tests.Length; i++)
{
var e = this.tests[i];
var nounParams = new NounParams()
{
SheetName = e.SheetName,

View file

@ -1,7 +1,7 @@
using Dalamud.Game.Gui.PartyFinder;
using Dalamud.Game.Gui.PartyFinder.Types;
using ImGuiNET;
using Dalamud.Bindings.ImGui;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;

Some files were not shown because too many files have changed in this diff Show more