mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
wip bindings upgrade
This commit is contained in:
parent
bd7e56850a
commit
0690cce995
272 changed files with 139041 additions and 1541 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -327,4 +327,7 @@ ASALocalRun/
|
|||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
.mfractor/
|
||||
|
||||
# HexaGen generated files
|
||||
imgui/**/Generated/**/*
|
||||
|
|
@ -38,9 +38,6 @@
|
|||
<ProjectReference Include="..\Dalamud\Dalamud.csproj">
|
||||
<Private>false</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\lib\ImGui.NET\src\ImGui.NET-472\ImGui.NET-472.csproj">
|
||||
<Private>false</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ using System;
|
|||
using System.Numerics;
|
||||
|
||||
using Dalamud.Interface.Windowing;
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.CorePlugin
|
||||
{
|
||||
|
|
|
|||
|
|
@ -440,7 +440,7 @@ namespace Dalamud.Injector
|
|||
|
||||
#region Methods
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
||||
[DllImport("advapi32.dll", CharSet = CharSet.Auto)]
|
||||
public static extern void BuildExplicitAccessWithName(
|
||||
ref EXPLICIT_ACCESS pExplicitAccess,
|
||||
string pTrusteeName,
|
||||
|
|
@ -448,26 +448,26 @@ namespace Dalamud.Injector
|
|||
uint accessMode,
|
||||
uint inheritance);
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
||||
[DllImport("advapi32.dll", CharSet = CharSet.Auto)]
|
||||
public static extern int SetEntriesInAcl(
|
||||
int cCountOfExplicitEntries,
|
||||
ref EXPLICIT_ACCESS pListOfExplicitEntries,
|
||||
IntPtr oldAcl,
|
||||
out IntPtr newAcl);
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true)]
|
||||
[DllImport("advapi32.dll")]
|
||||
public static extern bool InitializeSecurityDescriptor(
|
||||
out SECURITY_DESCRIPTOR pSecurityDescriptor,
|
||||
uint dwRevision);
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true)]
|
||||
[DllImport("advapi32.dll")]
|
||||
public static extern bool SetSecurityDescriptorDacl(
|
||||
ref SECURITY_DESCRIPTOR pSecurityDescriptor,
|
||||
bool bDaclPresent,
|
||||
IntPtr pDacl,
|
||||
bool bDaclDefaulted);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
||||
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
|
||||
public static extern bool CreateProcess(
|
||||
string lpApplicationName,
|
||||
string lpCommandLine,
|
||||
|
|
@ -480,39 +480,39 @@ namespace Dalamud.Injector
|
|||
[In] ref STARTUPINFO lpStartupInfo,
|
||||
out PROCESS_INFORMATION lpProcessInformation);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
[DllImport("kernel32.dll")]
|
||||
public static extern bool CloseHandle(IntPtr hObject);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
[DllImport("kernel32.dll")]
|
||||
public static extern uint ResumeThread(IntPtr hThread);
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true)]
|
||||
[DllImport("advapi32.dll")]
|
||||
public static extern bool ImpersonateSelf(
|
||||
SECURITY_IMPERSONATION_LEVEL impersonationLevel);
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true)]
|
||||
[DllImport("advapi32.dll")]
|
||||
public static extern bool OpenProcessToken(
|
||||
IntPtr processHandle,
|
||||
UInt32 desiredAccess,
|
||||
out IntPtr tokenHandle);
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true)]
|
||||
[DllImport("advapi32.dll")]
|
||||
public static extern bool OpenThreadToken(
|
||||
IntPtr threadHandle,
|
||||
uint desiredAccess,
|
||||
bool openAsSelf,
|
||||
out IntPtr tokenHandle);
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true)]
|
||||
[DllImport("advapi32.dll")]
|
||||
public static extern bool LookupPrivilegeValue(string lpSystemName, string lpName, ref LUID lpLuid);
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true)]
|
||||
[DllImport("advapi32.dll")]
|
||||
public static extern bool PrivilegeCheck(
|
||||
IntPtr clientToken,
|
||||
ref PRIVILEGE_SET requiredPrivileges,
|
||||
out bool pfResult);
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true)]
|
||||
[DllImport("advapi32.dll")]
|
||||
public static extern bool AdjustTokenPrivileges(
|
||||
IntPtr tokenHandle,
|
||||
bool disableAllPrivileges,
|
||||
|
|
@ -521,7 +521,7 @@ namespace Dalamud.Injector
|
|||
IntPtr previousState,
|
||||
IntPtr cbOutPreviousState);
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true)]
|
||||
[DllImport("advapi32.dll")]
|
||||
public static extern uint GetSecurityInfo(
|
||||
IntPtr handle,
|
||||
SE_OBJECT_TYPE objectType,
|
||||
|
|
@ -532,7 +532,7 @@ namespace Dalamud.Injector
|
|||
IntPtr pSacl,
|
||||
IntPtr pSecurityDescriptor);
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true)]
|
||||
[DllImport("advapi32.dll")]
|
||||
public static extern uint SetSecurityInfo(
|
||||
IntPtr handle,
|
||||
SE_OBJECT_TYPE objectType,
|
||||
|
|
@ -542,16 +542,16 @@ namespace Dalamud.Injector
|
|||
IntPtr pDacl,
|
||||
IntPtr pSacl);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
[DllImport("kernel32.dll")]
|
||||
public static extern IntPtr GetCurrentProcess();
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
[DllImport("kernel32.dll")]
|
||||
public static extern IntPtr GetCurrentThread();
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
[DllImport("user32.dll")]
|
||||
public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr hWndChildAfter, string className, IntPtr windowTitle);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
[DllImport("user32.dll")]
|
||||
public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
|
|
|
|||
28
Dalamud.sln
28
Dalamud.sln
|
|
@ -62,7 +62,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cimplot", "external\cimplot
|
|||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cimguizmo", "external\cimguizmo\cimguizmo.vcxproj", "{F258347D-31BE-4605-98CE-40E43BDF6F9D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImGui.NET-472", "lib\ImGui.NET\src\ImGui.NET-472\ImGui.NET-472.csproj", "{A0A3C0AC-18D9-4C74-8CFC-14E53512846D}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dalamud.ImGui", "imgui\Dalamud.ImGui\Dalamud.ImGui.csproj", "{B0AA8737-33A3-4766-8CBE-A48F2EF283BA}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dalamud.ImGuizmo", "imgui\Dalamud.ImGuizmo\Dalamud.ImGuizmo.csproj", "{5E6EDD75-AE95-43A6-9D67-95B840EB4B71}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dalamud.ImPlot", "imgui\Dalamud.ImPlot\Dalamud.ImPlot.csproj", "{9C70BD06-D52C-425E-9C14-5D66BC6046EF}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Bindings", "Bindings", "{A217B3DF-607A-4EFB-B107-3C4809348043}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
|
@ -138,10 +144,18 @@ Global
|
|||
{F258347D-31BE-4605-98CE-40E43BDF6F9D}.Debug|Any CPU.Build.0 = Debug|x64
|
||||
{F258347D-31BE-4605-98CE-40E43BDF6F9D}.Release|Any CPU.ActiveCfg = Release|x64
|
||||
{F258347D-31BE-4605-98CE-40E43BDF6F9D}.Release|Any CPU.Build.0 = Release|x64
|
||||
{A0A3C0AC-18D9-4C74-8CFC-14E53512846D}.Debug|Any CPU.ActiveCfg = Debug|x64
|
||||
{A0A3C0AC-18D9-4C74-8CFC-14E53512846D}.Debug|Any CPU.Build.0 = Debug|x64
|
||||
{A0A3C0AC-18D9-4C74-8CFC-14E53512846D}.Release|Any CPU.ActiveCfg = Release|x64
|
||||
{A0A3C0AC-18D9-4C74-8CFC-14E53512846D}.Release|Any CPU.Build.0 = Release|x64
|
||||
{B0AA8737-33A3-4766-8CBE-A48F2EF283BA}.Debug|Any CPU.ActiveCfg = Debug|x64
|
||||
{B0AA8737-33A3-4766-8CBE-A48F2EF283BA}.Debug|Any CPU.Build.0 = Debug|x64
|
||||
{B0AA8737-33A3-4766-8CBE-A48F2EF283BA}.Release|Any CPU.ActiveCfg = Release|x64
|
||||
{B0AA8737-33A3-4766-8CBE-A48F2EF283BA}.Release|Any CPU.Build.0 = Release|x64
|
||||
{5E6EDD75-AE95-43A6-9D67-95B840EB4B71}.Debug|Any CPU.ActiveCfg = Debug|x64
|
||||
{5E6EDD75-AE95-43A6-9D67-95B840EB4B71}.Debug|Any CPU.Build.0 = Debug|x64
|
||||
{5E6EDD75-AE95-43A6-9D67-95B840EB4B71}.Release|Any CPU.ActiveCfg = Release|x64
|
||||
{5E6EDD75-AE95-43A6-9D67-95B840EB4B71}.Release|Any CPU.Build.0 = Release|x64
|
||||
{9C70BD06-D52C-425E-9C14-5D66BC6046EF}.Debug|Any CPU.ActiveCfg = Debug|x64
|
||||
{9C70BD06-D52C-425E-9C14-5D66BC6046EF}.Debug|Any CPU.Build.0 = Debug|x64
|
||||
{9C70BD06-D52C-425E-9C14-5D66BC6046EF}.Release|Any CPU.ActiveCfg = Release|x64
|
||||
{9C70BD06-D52C-425E-9C14-5D66BC6046EF}.Release|Any CPU.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
@ -160,7 +174,9 @@ Global
|
|||
{8BBACF2D-7AB8-4610-A115-0E363D35C291} = {E15BDA6D-E881-4482-94BA-BE5527E917FF}
|
||||
{76CAA246-C405-4A8C-B0AE-F4A0EF3D4E16} = {DBE5345E-6594-4A59-B183-1C3D5592269D}
|
||||
{F258347D-31BE-4605-98CE-40E43BDF6F9D} = {DBE5345E-6594-4A59-B183-1C3D5592269D}
|
||||
{A0A3C0AC-18D9-4C74-8CFC-14E53512846D} = {DBE5345E-6594-4A59-B183-1C3D5592269D}
|
||||
{B0AA8737-33A3-4766-8CBE-A48F2EF283BA} = {A217B3DF-607A-4EFB-B107-3C4809348043}
|
||||
{5E6EDD75-AE95-43A6-9D67-95B840EB4B71} = {A217B3DF-607A-4EFB-B107-3C4809348043}
|
||||
{9C70BD06-D52C-425E-9C14-5D66BC6046EF} = {A217B3DF-607A-4EFB-B107-3C4809348043}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {79B65AC9-C940-410E-AB61-7EA7E12C7599}
|
||||
|
|
|
|||
3
Dalamud/AssemblyInfo.cs
Normal file
3
Dalamud/AssemblyInfo.cs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
|
||||
//[assembly: DisableRuntimeMarshalling]
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
<PackageReference Include="Lumina" Version="$(LuminaVersion)" />
|
||||
<PackageReference Include="Lumina.Excel" Version="$(LuminaExcelVersion)" />
|
||||
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="9.0.0-preview.1.24081.5" />
|
||||
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.46-beta">
|
||||
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.183">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MinSharp" Version="1.0.4" />
|
||||
|
|
@ -103,8 +103,10 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Dalamud.Common\Dalamud.Common.csproj" />
|
||||
<ProjectReference Include="..\imgui\Dalamud.ImGuizmo\Dalamud.ImGuizmo.csproj" />
|
||||
<ProjectReference Include="..\imgui\Dalamud.ImGui\Dalamud.ImGui.csproj" />
|
||||
<ProjectReference Include="..\imgui\Dalamud.ImPlot\Dalamud.ImPlot.csproj" />
|
||||
<ProjectReference Include="..\lib\FFXIVClientStructs\FFXIVClientStructs\FFXIVClientStructs.csproj" />
|
||||
<ProjectReference Include="..\lib\ImGui.NET\src\ImGui.NET-472\ImGui.NET-472.csproj" />
|
||||
<ProjectReference Include="..\lib\FFXIVClientStructs\InteropGenerator.Runtime\InteropGenerator.Runtime.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Windows.Win32.Foundation;
|
||||
using Windows.Win32.UI.WindowsAndMessaging;
|
||||
|
||||
using Dalamud.Common;
|
||||
using Dalamud.Configuration.Internal;
|
||||
using Dalamud.Interface.Internal.Windows;
|
||||
|
|
@ -58,7 +62,7 @@ public sealed class EntryPoint
|
|||
var info = JsonConvert.DeserializeObject<DalamudStartInfo>(infoStr)!;
|
||||
|
||||
if ((info.BootWaitMessageBox & 4) != 0)
|
||||
MessageBoxW(IntPtr.Zero, "Press OK to continue (BeforeDalamudConstruct)", "Dalamud Boot", MessageBoxType.Ok);
|
||||
Windows.Win32.PInvoke.MessageBox(HWND.Null, "Press OK to continue (BeforeDalamudConstruct)", "Dalamud Boot", MESSAGEBOX_STYLE.MB_OK);
|
||||
|
||||
new Thread(() => RunThread(info, mainThreadContinueEvent)).Start();
|
||||
}
|
||||
|
|
@ -135,6 +139,8 @@ public sealed class EntryPoint
|
|||
/// <param name="mainThreadContinueEvent">Event used to signal the main thread to continue.</param>
|
||||
private static void RunThread(DalamudStartInfo info, IntPtr mainThreadContinueEvent)
|
||||
{
|
||||
NativeLibrary.Load(Path.Combine(info.WorkingDirectory!, "cimgui.dll"));
|
||||
|
||||
// Setup logger
|
||||
InitLogging(info.LogPath!, info.BootShowConsole, true, info.LogName);
|
||||
SerilogEventSink.Instance.LogLine += SerilogOnLogLine;
|
||||
|
|
@ -304,14 +310,14 @@ public sealed class EntryPoint
|
|||
// ignored
|
||||
}
|
||||
|
||||
const MessageBoxType flags = NativeFunctions.MessageBoxType.YesNo | NativeFunctions.MessageBoxType.IconError | NativeFunctions.MessageBoxType.SystemModal;
|
||||
var result = MessageBoxW(
|
||||
Process.GetCurrentProcess().MainWindowHandle,
|
||||
const MESSAGEBOX_STYLE flags = MESSAGEBOX_STYLE.MB_YESNO | MESSAGEBOX_STYLE.MB_ICONERROR | MESSAGEBOX_STYLE.MB_SYSTEMMODAL;
|
||||
var result = Windows.Win32.PInvoke.MessageBox(
|
||||
new HWND(Process.GetCurrentProcess().MainWindowHandle),
|
||||
$"An internal error in a Dalamud plugin occurred.\nThe game must close.\n\n{ex.GetType().Name}\n{info}\n\n{pluginInfo}More information has been recorded separately{supportText}.\n\nDo you want to disable all plugins the next time you start the game?",
|
||||
"Dalamud",
|
||||
flags);
|
||||
|
||||
if (result == (int)User32.MessageBoxResult.IDYES)
|
||||
if (result == MESSAGEBOX_RESULT.IDYES)
|
||||
{
|
||||
Log.Information("User chose to disable plugins on next launch...");
|
||||
var config = Service<DalamudConfiguration>.Get();
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ using Dalamud.Plugin.Services;
|
|||
|
||||
using FFXIVClientStructs.FFXIV.Client.System.Input;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Serilog;
|
||||
|
||||
namespace Dalamud.Game.ClientState.GamePad;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
|||
using FFXIVClientStructs.FFXIV.Common.Component.BGCollision;
|
||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
using Vector2 = System.Numerics.Vector2;
|
||||
using Vector3 = System.Numerics.Vector3;
|
||||
|
|
@ -75,7 +75,7 @@ internal sealed unsafe class GameGui : IInternalDisposableService, IGameGui
|
|||
}
|
||||
|
||||
// Hooked delegates
|
||||
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
|
||||
private delegate char HandleImmDelegate(IntPtr framework, char a2, byte a3);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,23 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Windows.Win32.System.Memory;
|
||||
|
||||
using Dalamud.Memory;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
using PInvoke;
|
||||
|
||||
using Win32Exception = System.ComponentModel.Win32Exception;
|
||||
|
||||
namespace Dalamud.Hooking.Internal;
|
||||
|
||||
/// <summary>
|
||||
/// Manages a hook with MinHook.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Delegate type to represents a function prototype. This must be the same prototype as original function do.</typeparam>
|
||||
internal class FunctionPointerVariableHook<T> : Hook<T>
|
||||
internal unsafe class FunctionPointerVariableHook<T> : Hook<T>
|
||||
where T : Delegate
|
||||
{
|
||||
private readonly nint pfnDetour;
|
||||
|
|
@ -55,11 +60,11 @@ internal class FunctionPointerVariableHook<T> : Hook<T>
|
|||
// Note: WINE seemingly tries to clean up all heap allocations on process exit.
|
||||
// We want our allocation to be kept there forever, until no running thread remains.
|
||||
// Therefore we're using VirtualAlloc instead of HeapCreate/HeapAlloc.
|
||||
var pfnThunkBytes = (byte*)NativeFunctions.VirtualAlloc(
|
||||
0,
|
||||
var pfnThunkBytes = (byte*)Windows.Win32.PInvoke.VirtualAlloc(
|
||||
null,
|
||||
12,
|
||||
NativeFunctions.AllocationType.Reserve | NativeFunctions.AllocationType.Commit,
|
||||
MemoryProtection.ExecuteReadWrite);
|
||||
VIRTUAL_ALLOCATION_TYPE.MEM_RESERVE | VIRTUAL_ALLOCATION_TYPE.MEM_COMMIT,
|
||||
PAGE_PROTECTION_FLAGS.PAGE_EXECUTE_READWRITE);
|
||||
if (pfnThunkBytes == null)
|
||||
{
|
||||
throw new OutOfMemoryException("Failed to allocate memory for import hooks.");
|
||||
|
|
@ -78,10 +83,10 @@ internal class FunctionPointerVariableHook<T> : Hook<T>
|
|||
|
||||
this.ppfnThunkJumpTarget = this.pfnThunk + 2;
|
||||
|
||||
if (!NativeFunctions.VirtualProtect(
|
||||
this.Address,
|
||||
if (!Windows.Win32.PInvoke.VirtualProtect(
|
||||
this.Address.ToPointer(),
|
||||
(UIntPtr)Marshal.SizeOf<IntPtr>(),
|
||||
MemoryProtection.ExecuteReadWrite,
|
||||
PAGE_PROTECTION_FLAGS.PAGE_EXECUTE_READWRITE,
|
||||
out var oldProtect))
|
||||
{
|
||||
throw new Win32Exception(Marshal.GetLastWin32Error());
|
||||
|
|
@ -93,7 +98,7 @@ internal class FunctionPointerVariableHook<T> : Hook<T>
|
|||
Marshal.WriteIntPtr(this.Address, this.pfnThunk);
|
||||
|
||||
// This really should not fail, but then even if it does, whatever.
|
||||
NativeFunctions.VirtualProtect(this.Address, (UIntPtr)Marshal.SizeOf<IntPtr>(), oldProtect, out _);
|
||||
Windows.Win32.PInvoke.VirtualProtect(this.Address.ToPointer(), (UIntPtr)Marshal.SizeOf<IntPtr>(), oldProtect, out _);
|
||||
|
||||
// Add afterwards, so the hookIdent starts at 0.
|
||||
indexList.Add(this);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ using System.Numerics;
|
|||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.Components;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ using System.Numerics;
|
|||
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.Components;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ using Dalamud.Interface.Utility.Raii;
|
|||
|
||||
using FFXIVClientStructs.FFXIV.Common.Math;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.Components;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ using System.Numerics;
|
|||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.Components;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using System.Numerics;
|
|||
|
||||
using Dalamud.Interface.Utility;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.Components;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.Components;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using Dalamud.Interface.Utility.Raii;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.Components;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using System.Numerics;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.Components;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using Dalamud.Interface.Internal;
|
|||
using Dalamud.IoC;
|
||||
using Dalamud.IoC.Internal;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Serilog;
|
||||
|
||||
namespace Dalamud.Interface.DragDrop;
|
||||
|
|
@ -103,7 +103,7 @@ internal partial class DragDropManager : IInternalDisposableService, IDragDropMa
|
|||
}
|
||||
|
||||
/// <inheritdoc cref="IDragDropManager.CreateImGuiSource(string, Func{IDragDropManager, bool}, Func{IDragDropManager, bool})"/>
|
||||
public void CreateImGuiSource(string label, Func<IDragDropManager, bool> validityCheck, Func<IDragDropManager, bool> tooltipBuilder)
|
||||
public unsafe void CreateImGuiSource(string label, Func<IDragDropManager, bool> validityCheck, Func<IDragDropManager, bool> tooltipBuilder)
|
||||
{
|
||||
if (!this.IsDragging && !this.IsDropping())
|
||||
{
|
||||
|
|
@ -115,7 +115,7 @@ internal partial class DragDropManager : IInternalDisposableService, IDragDropMa
|
|||
return;
|
||||
}
|
||||
|
||||
ImGui.SetDragDropPayload(label, nint.Zero, 0);
|
||||
ImGui.SetDragDropPayload(label, null, 0);
|
||||
if (this.CheckTooltipFrame(out var frame) && tooltipBuilder(this))
|
||||
{
|
||||
this.lastTooltipFrame = frame;
|
||||
|
|
@ -136,7 +136,7 @@ internal partial class DragDropManager : IInternalDisposableService, IDragDropMa
|
|||
|
||||
unsafe
|
||||
{
|
||||
if (ImGui.AcceptDragDropPayload(label, ImGuiDragDropFlags.AcceptBeforeDelivery).NativePtr != null && this.IsDropping())
|
||||
if (ImGui.AcceptDragDropPayload(label, ImGuiDragDropFlags.AcceptBeforeDelivery).Handle != null && this.IsDropping())
|
||||
{
|
||||
this.lastDropFrame = -2;
|
||||
files = this.Files;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using System.Runtime.InteropServices.ComTypes;
|
|||
using System.Text;
|
||||
|
||||
using Dalamud.Utility;
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Serilog;
|
||||
|
||||
namespace Dalamud.Interface.DragDrop;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||
using Dalamud.Interface.ManagedFontAtlas;
|
||||
using Dalamud.Storage.Assets;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||
|
||||
using Dalamud.Interface.ManagedFontAtlas;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||
using Dalamud.Interface.GameFonts;
|
||||
using Dalamud.Interface.ManagedFontAtlas;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using Dalamud.Interface.ManagedFontAtlas;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.FontIdentifier;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using Dalamud.Interface.ManagedFontAtlas;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.FontIdentifier;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ using System.Text;
|
|||
using Dalamud.Interface.ManagedFontAtlas;
|
||||
using Dalamud.Interface.Utility;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using System.Linq;
|
|||
using Dalamud.Interface.ManagedFontAtlas;
|
||||
using Dalamud.Utility;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ public sealed class SystemFontId : IFontId
|
|||
this.EnglishName = name;
|
||||
else if (this.LocaleNames.TryGetValue("en", out name))
|
||||
this.EnglishName = name;
|
||||
else
|
||||
else
|
||||
this.EnglishName = this.LocaleNames.Values.First();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.GameFonts;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,19 @@
|
|||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Bindings.ImGuizmo;
|
||||
using Dalamud.Bindings.ImPlot;
|
||||
using Dalamud.Interface.ImGuiBackend.Helpers;
|
||||
using Dalamud.Interface.ImGuiBackend.InputHandler;
|
||||
using Dalamud.Interface.ImGuiBackend.Renderers;
|
||||
using Dalamud.Utility;
|
||||
|
||||
using ImGuiNET;
|
||||
|
||||
using ImGuizmoNET;
|
||||
|
||||
using ImPlotNET;
|
||||
using Serilog;
|
||||
|
||||
using TerraFX.Interop.DirectX;
|
||||
using TerraFX.Interop.Windows;
|
||||
|
|
@ -67,6 +71,58 @@ internal sealed unsafe class Dx11Win32Backend : IWin32Backend
|
|||
this.WindowHandle = desc.OutputWindow;
|
||||
|
||||
var ctx = ImGui.CreateContext();
|
||||
|
||||
Debug.Assert(!ctx.IsNull);
|
||||
var windowOff = Marshal.OffsetOf<ImGuiContext>("CurrentWindow");
|
||||
//Debug.Assert(windowOff == 16368);
|
||||
|
||||
/*
|
||||
void ShowOffset<T>(string name)
|
||||
{
|
||||
// var off = Marshal.OffsetOf<T>(name);
|
||||
var fieldInfo = typeof(T).GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
|
||||
var off = fieldInfo?.GetFieldOffset();
|
||||
|
||||
Log.Information($"{name} {typeof(T).Name} {off}");
|
||||
}
|
||||
|
||||
//Util.Fatal($"{Marshal.SizeOf<Test>()} - {sizeof(Test)}", "", false);
|
||||
|
||||
ShowOffset<ImGuiIO>("ClipboardUserData");
|
||||
ShowOffset<ImGuiIO>("MouseDrawCursor");
|
||||
|
||||
ShowOffset<ImGuiIO>("MouseDelta");
|
||||
ShowOffset<ImGuiIO>("KeysDown_0");
|
||||
ShowOffset<ImGuiIO>("MousePos");
|
||||
|
||||
ShowOffset<ImGuiIO>("KeyMods");
|
||||
*/
|
||||
|
||||
void ShowAllFields<T>()
|
||||
{
|
||||
var fields = typeof(T).GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
|
||||
foreach (var field in fields)
|
||||
{
|
||||
var off = field.GetFieldOffset();
|
||||
Log.Information($"{field.Name} {typeof(T).Name} {off}");
|
||||
}
|
||||
}
|
||||
|
||||
ShowAllFields<ImGuiIO>();
|
||||
|
||||
var contextSize = Unsafe.SizeOf<ImGuiContext>();
|
||||
var ioSize = Unsafe.SizeOf<ImGuiIO>();
|
||||
var platformIoSize = Unsafe.SizeOf<ImGuiPlatformIO>();
|
||||
|
||||
//Debug.Assert(contextSize == 22688);
|
||||
//Debug.Assert(ioSize == 14352);
|
||||
//Debug.Assert(platformIoSize == 216);
|
||||
|
||||
//var platformIoOff = Unsafe.OffsetOf<ImGuiContext>("PlatformIO");
|
||||
//Debug.Assert(platformIoOff == 14360);
|
||||
|
||||
Util.Fatal("bleh", "bleh", false);
|
||||
|
||||
ImGuizmo.SetImGuiContext(ctx);
|
||||
ImPlot.SetImGuiContext(ctx);
|
||||
ImPlot.CreateContext();
|
||||
|
|
@ -234,8 +290,8 @@ internal sealed unsafe class Dx11Win32Backend : IWin32Backend
|
|||
if (this.device.IsEmpty())
|
||||
return;
|
||||
|
||||
this.imguiRenderer.Dispose();
|
||||
this.imguiInput.Dispose();
|
||||
this.imguiRenderer?.Dispose();
|
||||
this.imguiInput?.Dispose();
|
||||
|
||||
ImGui.DestroyContext();
|
||||
|
||||
|
|
@ -245,3 +301,4 @@ internal sealed unsafe class Dx11Win32Backend : IWin32Backend
|
|||
this.swapChainPossiblyWrapped.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ using System.Linq;
|
|||
using System.Numerics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
using TerraFX.Interop.Windows;
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ internal static class ImGuiViewportHelpers
|
|||
/// <param name="viewport">An instance of <see cref="ImGuiViewportPtr"/>.</param>
|
||||
/// <returns>Same value with <paramref name="returnStorage"/>.</returns>
|
||||
public unsafe delegate Vector2* GetWindowPosDelegate(Vector2* returnStorage, ImGuiViewportPtr viewport);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Delegate to be called when the window should be moved.
|
||||
/// </summary>
|
||||
|
|
@ -83,7 +83,7 @@ internal static class ImGuiViewportHelpers
|
|||
/// <param name="viewport">An instance of <see cref="ImGuiViewportPtr"/>.</param>
|
||||
/// <returns>Same value with <paramref name="returnStorage"/>.</returns>
|
||||
public unsafe delegate Vector2* GetWindowSizeDelegate(Vector2* returnStorage, ImGuiViewportPtr viewport);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Delegate to be called when the window should be given focus.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
using TerraFX.Interop.Windows;
|
||||
|
||||
|
|
@ -75,16 +75,16 @@ internal sealed partial class Win32InputHandler
|
|||
VK.VK_RMENU => ImGuiKey.RightAlt,
|
||||
VK.VK_RWIN => ImGuiKey.RightSuper,
|
||||
VK.VK_APPS => ImGuiKey.Menu,
|
||||
'0' => ImGuiKey._0,
|
||||
'1' => ImGuiKey._1,
|
||||
'2' => ImGuiKey._2,
|
||||
'3' => ImGuiKey._3,
|
||||
'4' => ImGuiKey._4,
|
||||
'5' => ImGuiKey._5,
|
||||
'6' => ImGuiKey._6,
|
||||
'7' => ImGuiKey._7,
|
||||
'8' => ImGuiKey._8,
|
||||
'9' => ImGuiKey._9,
|
||||
'0' => ImGuiKey.Key0,
|
||||
'1' => ImGuiKey.Key1,
|
||||
'2' => ImGuiKey.Key2,
|
||||
'3' => ImGuiKey.Key3,
|
||||
'4' => ImGuiKey.Key4,
|
||||
'5' => ImGuiKey.Key5,
|
||||
'6' => ImGuiKey.Key6,
|
||||
'7' => ImGuiKey.Key7,
|
||||
'8' => ImGuiKey.Key8,
|
||||
'9' => ImGuiKey.Key9,
|
||||
'A' => ImGuiKey.A,
|
||||
'B' => ImGuiKey.B,
|
||||
'C' => ImGuiKey.C,
|
||||
|
|
@ -190,16 +190,16 @@ internal sealed partial class Win32InputHandler
|
|||
ImGuiKey.RightAlt => VK.VK_RMENU,
|
||||
ImGuiKey.RightSuper => VK.VK_RWIN,
|
||||
ImGuiKey.Menu => VK.VK_APPS,
|
||||
ImGuiKey._0 => '0',
|
||||
ImGuiKey._1 => '1',
|
||||
ImGuiKey._2 => '2',
|
||||
ImGuiKey._3 => '3',
|
||||
ImGuiKey._4 => '4',
|
||||
ImGuiKey._5 => '5',
|
||||
ImGuiKey._6 => '6',
|
||||
ImGuiKey._7 => '7',
|
||||
ImGuiKey._8 => '8',
|
||||
ImGuiKey._9 => '9',
|
||||
ImGuiKey.Key0 => '0',
|
||||
ImGuiKey.Key1 => '1',
|
||||
ImGuiKey.Key2 => '2',
|
||||
ImGuiKey.Key3 => '3',
|
||||
ImGuiKey.Key4 => '4',
|
||||
ImGuiKey.Key5 => '5',
|
||||
ImGuiKey.Key6 => '6',
|
||||
ImGuiKey.Key7 => '7',
|
||||
ImGuiKey.Key8 => '8',
|
||||
ImGuiKey.Key9 => '9',
|
||||
ImGuiKey.A => 'A',
|
||||
ImGuiKey.B => 'B',
|
||||
ImGuiKey.C => 'C',
|
||||
|
|
@ -274,14 +274,14 @@ internal sealed partial class Win32InputHandler
|
|||
private static void UpAllKeys()
|
||||
{
|
||||
var io = ImGui.GetIO();
|
||||
for (var i = (int)ImGuiKey.NamedKey_BEGIN; i < (int)ImGuiKey.NamedKey_END; i++)
|
||||
for (var i = (int)ImGuiKey.NamedKeyBegin; i < (int)ImGuiKey.NamedKeyEnd; i++)
|
||||
io.AddKeyEvent((ImGuiKey)i, false);
|
||||
}
|
||||
|
||||
private static void UpAllMouseButton()
|
||||
{
|
||||
var io = ImGui.GetIO();
|
||||
for (var i = 0; i < io.MouseDown.Count; i++)
|
||||
for (var i = 0; i < io.MouseDown.Length; i++)
|
||||
io.MouseDown[i] = false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@ using System.Numerics;
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
using Serilog;
|
||||
|
||||
using TerraFX.Interop.Windows;
|
||||
|
||||
|
|
@ -51,7 +53,7 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
public Win32InputHandler(HWND hWnd)
|
||||
{
|
||||
var io = ImGui.GetIO();
|
||||
if (ImGui.GetIO().NativePtr->BackendPlatformName is not null)
|
||||
if (ImGui.GetIO().Handle->BackendPlatformName is not null)
|
||||
throw new InvalidOperationException("ImGui backend platform seems to be have been already attached.");
|
||||
|
||||
this.hWnd = hWnd;
|
||||
|
|
@ -66,7 +68,7 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
ImGuiBackendFlags.PlatformHasViewports;
|
||||
|
||||
this.platformNamePtr = Marshal.StringToHGlobalAnsi("imgui_impl_win32_c#");
|
||||
io.NativePtr->BackendPlatformName = (byte*)this.platformNamePtr;
|
||||
io.Handle->BackendPlatformName = (byte*)this.platformNamePtr;
|
||||
|
||||
var mainViewport = ImGui.GetMainViewport();
|
||||
mainViewport.PlatformHandle = mainViewport.PlatformHandleRaw = hWnd;
|
||||
|
|
@ -79,10 +81,10 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
this.cursors[(int)ImGuiMouseCursor.Arrow] = LoadCursorW(default, IDC.IDC_ARROW);
|
||||
this.cursors[(int)ImGuiMouseCursor.TextInput] = LoadCursorW(default, IDC.IDC_IBEAM);
|
||||
this.cursors[(int)ImGuiMouseCursor.ResizeAll] = LoadCursorW(default, IDC.IDC_SIZEALL);
|
||||
this.cursors[(int)ImGuiMouseCursor.ResizeEW] = LoadCursorW(default, IDC.IDC_SIZEWE);
|
||||
this.cursors[(int)ImGuiMouseCursor.ResizeNS] = LoadCursorW(default, IDC.IDC_SIZENS);
|
||||
this.cursors[(int)ImGuiMouseCursor.ResizeNESW] = LoadCursorW(default, IDC.IDC_SIZENESW);
|
||||
this.cursors[(int)ImGuiMouseCursor.ResizeNWSE] = LoadCursorW(default, IDC.IDC_SIZENWSE);
|
||||
this.cursors[(int)ImGuiMouseCursor.ResizeEw] = LoadCursorW(default, IDC.IDC_SIZEWE);
|
||||
this.cursors[(int)ImGuiMouseCursor.ResizeNs] = LoadCursorW(default, IDC.IDC_SIZENS);
|
||||
this.cursors[(int)ImGuiMouseCursor.ResizeNesw] = LoadCursorW(default, IDC.IDC_SIZENESW);
|
||||
this.cursors[(int)ImGuiMouseCursor.ResizeNwse] = LoadCursorW(default, IDC.IDC_SIZENWSE);
|
||||
this.cursors[(int)ImGuiMouseCursor.Hand] = LoadCursorW(default, IDC.IDC_HAND);
|
||||
this.cursors[(int)ImGuiMouseCursor.NotAllowed] = LoadCursorW(default, IDC.IDC_NO);
|
||||
}
|
||||
|
|
@ -136,7 +138,7 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
this.iniPathPtr = newAlloc;
|
||||
}
|
||||
|
||||
ImGui.GetIO().NativePtr->IniFilename = (byte*)this.iniPathPtr;
|
||||
ImGui.GetIO().Handle->IniFilename = (byte*)this.iniPathPtr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -199,7 +201,7 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
// would become unresponsive
|
||||
if (!io.WantCaptureMouse)
|
||||
{
|
||||
for (var i = 0; i < io.MouseDown.Count; i++)
|
||||
for (var i = 0; i < io.MouseDown.Length; i++)
|
||||
{
|
||||
io.MouseDown[i] = false;
|
||||
}
|
||||
|
|
@ -216,7 +218,7 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
/// <returns>Return value, if not doing further processing.</returns>
|
||||
public LRESULT? ProcessWndProcW(HWND hWndCurrent, uint msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (ImGui.GetCurrentContext() == nint.Zero)
|
||||
if (ImGui.GetCurrentContext().IsNull)
|
||||
return null;
|
||||
|
||||
var io = ImGui.GetIO();
|
||||
|
|
@ -469,7 +471,7 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
// See: https://github.com/goatcorp/ImGuiScene/pull/13
|
||||
// > GetForegroundWindow from winuser.h is a surprisingly expensive function.
|
||||
var isForeground = GetForegroundWindow() == this.hWnd;
|
||||
for (var i = (int)ImGuiKey.NamedKey_BEGIN; i < (int)ImGuiKey.NamedKey_END; i++)
|
||||
for (var i = (int)ImGuiKey.NamedKeyBegin; i < (int)ImGuiKey.NamedKeyEnd; i++)
|
||||
{
|
||||
// Skip raising modifier keys if the game is focused.
|
||||
// This allows us to raise the keys when one is held and the window becomes unfocused,
|
||||
|
|
@ -495,11 +497,11 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
// The message wasn't handled, but it's a platform window
|
||||
// So we have to handle some messages ourselves
|
||||
// BUT we might have disposed the context, so check that
|
||||
if (ImGui.GetCurrentContext() == nint.Zero)
|
||||
if (ImGui.GetCurrentContext().IsNull)
|
||||
return DefWindowProcW(hWndCurrent, msg, wParam, lParam);
|
||||
|
||||
var viewport = ImGui.FindViewportByPlatformHandle(hWndCurrent);
|
||||
if (viewport.NativePtr == null)
|
||||
if (viewport.Handle == null)
|
||||
return DefWindowProcW(hWndCurrent, msg, wParam, lParam);
|
||||
|
||||
switch (msg)
|
||||
|
|
@ -556,14 +558,14 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
|
||||
this.cursors.AsSpan().Clear();
|
||||
|
||||
if (ImGui.GetIO().NativePtr->BackendPlatformName == (void*)this.platformNamePtr)
|
||||
ImGui.GetIO().NativePtr->BackendPlatformName = null;
|
||||
if (ImGui.GetIO().Handle->BackendPlatformName == (void*)this.platformNamePtr)
|
||||
ImGui.GetIO().Handle->BackendPlatformName = null;
|
||||
if (this.platformNamePtr != nint.Zero)
|
||||
Marshal.FreeHGlobal(this.platformNamePtr);
|
||||
|
||||
if (this.iniPathPtr != nint.Zero)
|
||||
{
|
||||
ImGui.GetIO().NativePtr->IniFilename = null;
|
||||
ImGui.GetIO().Handle->IniFilename = null;
|
||||
Marshal.FreeHGlobal(this.iniPathPtr);
|
||||
this.iniPathPtr = nint.Zero;
|
||||
}
|
||||
|
|
@ -587,20 +589,20 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
this.classNamePtr = Marshal.StringToHGlobalUni("ImGui Platform");
|
||||
|
||||
var pio = ImGui.GetPlatformIO();
|
||||
pio.Platform_CreateWindow = this.RegisterFunctionPointer<CreateWindowDelegate>(this.OnCreateWindow);
|
||||
pio.Platform_DestroyWindow = this.RegisterFunctionPointer<DestroyWindowDelegate>(this.OnDestroyWindow);
|
||||
pio.Platform_ShowWindow = this.RegisterFunctionPointer<ShowWindowDelegate>(this.OnShowWindow);
|
||||
pio.Platform_SetWindowPos = this.RegisterFunctionPointer<SetWindowPosDelegate>(this.OnSetWindowPos);
|
||||
pio.Platform_GetWindowPos = this.RegisterFunctionPointer<GetWindowPosDelegate>(this.OnGetWindowPos);
|
||||
pio.Platform_SetWindowSize = this.RegisterFunctionPointer<SetWindowSizeDelegate>(this.OnSetWindowSize);
|
||||
pio.Platform_GetWindowSize = this.RegisterFunctionPointer<GetWindowSizeDelegate>(this.OnGetWindowSize);
|
||||
pio.Platform_SetWindowFocus = this.RegisterFunctionPointer<SetWindowFocusDelegate>(this.OnSetWindowFocus);
|
||||
pio.Platform_GetWindowFocus = this.RegisterFunctionPointer<GetWindowFocusDelegate>(this.OnGetWindowFocus);
|
||||
pio.Platform_GetWindowMinimized =
|
||||
pio.PlatformCreateWindow = this.RegisterFunctionPointer<CreateWindowDelegate>(this.OnCreateWindow);
|
||||
pio.PlatformDestroyWindow = this.RegisterFunctionPointer<DestroyWindowDelegate>(this.OnDestroyWindow);
|
||||
pio.PlatformShowWindow = this.RegisterFunctionPointer<ShowWindowDelegate>(this.OnShowWindow);
|
||||
pio.PlatformSetWindowPos = this.RegisterFunctionPointer<SetWindowPosDelegate>(this.OnSetWindowPos);
|
||||
pio.PlatformGetWindowPos = this.RegisterFunctionPointer<GetWindowPosDelegate>(this.OnGetWindowPos);
|
||||
pio.PlatformSetWindowSize = this.RegisterFunctionPointer<SetWindowSizeDelegate>(this.OnSetWindowSize);
|
||||
pio.PlatformGetWindowSize = this.RegisterFunctionPointer<GetWindowSizeDelegate>(this.OnGetWindowSize);
|
||||
pio.PlatformSetWindowFocus = this.RegisterFunctionPointer<SetWindowFocusDelegate>(this.OnSetWindowFocus);
|
||||
pio.PlatformGetWindowFocus = this.RegisterFunctionPointer<GetWindowFocusDelegate>(this.OnGetWindowFocus);
|
||||
pio.PlatformGetWindowMinimized =
|
||||
this.RegisterFunctionPointer<GetWindowMinimizedDelegate>(this.OnGetWindowMinimized);
|
||||
pio.Platform_SetWindowTitle = this.RegisterFunctionPointer<SetWindowTitleDelegate>(this.OnSetWindowTitle);
|
||||
pio.Platform_SetWindowAlpha = this.RegisterFunctionPointer<SetWindowAlphaDelegate>(this.OnSetWindowAlpha);
|
||||
pio.Platform_UpdateWindow = this.RegisterFunctionPointer<UpdateWindowDelegate>(this.OnUpdateWindow);
|
||||
pio.PlatformSetWindowTitle = this.RegisterFunctionPointer<SetWindowTitleDelegate>(this.OnSetWindowTitle);
|
||||
pio.PlatformSetWindowAlpha = this.RegisterFunctionPointer<SetWindowAlphaDelegate>(this.OnSetWindowAlpha);
|
||||
pio.PlatformUpdateWindow = this.RegisterFunctionPointer<UpdateWindowDelegate>(this.OnUpdateWindow);
|
||||
// pio.Platform_SetImeInputPos = this.RegisterFunctionPointer<SetImeInputPosDelegate>(this.OnSetImeInputPos);
|
||||
// pio.Platform_GetWindowDpiScale = this.RegisterFunctionPointer<GetWindowDpiScaleDelegate>(this.OnGetWindowDpiScale);
|
||||
// pio.Platform_ChangedViewport = this.RegisterFunctionPointer<ChangedViewportDelegate>(this.OnChangedViewport);
|
||||
|
|
@ -624,7 +626,7 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
var mainViewport = ImGui.GetMainViewport();
|
||||
|
||||
var data = (ImGuiViewportDataWin32*)Marshal.AllocHGlobal(Marshal.SizeOf<ImGuiViewportDataWin32>());
|
||||
mainViewport.PlatformUserData = (nint)data;
|
||||
mainViewport.PlatformUserData = data;
|
||||
data->Hwnd = this.input.hWnd;
|
||||
data->HwndOwned = false;
|
||||
mainViewport.PlatformHandle = this.input.hWnd;
|
||||
|
|
@ -637,12 +639,12 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
|
||||
var pio = ImGui.GetPlatformIO();
|
||||
|
||||
if (ImGui.GetPlatformIO().NativePtr->Monitors.Data != 0)
|
||||
if (ImGui.GetPlatformIO().Handle->Monitors.Data != null)
|
||||
{
|
||||
// We allocated the platform monitor data in OnUpdateMonitors ourselves,
|
||||
// so we have to free it ourselves to ImGui doesn't try to, or else it will crash
|
||||
Marshal.FreeHGlobal(ImGui.GetPlatformIO().NativePtr->Monitors.Data);
|
||||
ImGui.GetPlatformIO().NativePtr->Monitors = default;
|
||||
Marshal.FreeHGlobal(new IntPtr(ImGui.GetPlatformIO().Handle->Monitors.Data));
|
||||
ImGui.GetPlatformIO().Handle->Monitors = default;
|
||||
}
|
||||
|
||||
if (this.classNamePtr != 0)
|
||||
|
|
@ -652,19 +654,19 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
this.classNamePtr = 0;
|
||||
}
|
||||
|
||||
pio.Platform_CreateWindow = nint.Zero;
|
||||
pio.Platform_DestroyWindow = nint.Zero;
|
||||
pio.Platform_ShowWindow = nint.Zero;
|
||||
pio.Platform_SetWindowPos = nint.Zero;
|
||||
pio.Platform_GetWindowPos = nint.Zero;
|
||||
pio.Platform_SetWindowSize = nint.Zero;
|
||||
pio.Platform_GetWindowSize = nint.Zero;
|
||||
pio.Platform_SetWindowFocus = nint.Zero;
|
||||
pio.Platform_GetWindowFocus = nint.Zero;
|
||||
pio.Platform_GetWindowMinimized = nint.Zero;
|
||||
pio.Platform_SetWindowTitle = nint.Zero;
|
||||
pio.Platform_SetWindowAlpha = nint.Zero;
|
||||
pio.Platform_UpdateWindow = nint.Zero;
|
||||
pio.PlatformCreateWindow = null;
|
||||
pio.PlatformDestroyWindow = null;
|
||||
pio.PlatformShowWindow = null;
|
||||
pio.PlatformSetWindowPos = null;
|
||||
pio.PlatformGetWindowPos = null;
|
||||
pio.PlatformSetWindowSize = null;
|
||||
pio.PlatformGetWindowSize = null;
|
||||
pio.PlatformSetWindowFocus = null;
|
||||
pio.PlatformGetWindowFocus = null;
|
||||
pio.PlatformGetWindowMinimized = null;
|
||||
pio.PlatformSetWindowTitle = null;
|
||||
pio.PlatformSetWindowAlpha = null;
|
||||
pio.PlatformUpdateWindow = null;
|
||||
// pio.Platform_SetImeInputPos = nint.Zero;
|
||||
// pio.Platform_GetWindowDpiScale = nint.Zero;
|
||||
// pio.Platform_ChangedViewport = nint.Zero;
|
||||
|
|
@ -685,15 +687,15 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
var pio = ImGui.GetPlatformIO();
|
||||
var numMonitors = GetSystemMetrics(SM.SM_CMONITORS);
|
||||
var data = Marshal.AllocHGlobal(Marshal.SizeOf<ImGuiPlatformMonitor>() * numMonitors);
|
||||
if (pio.NativePtr->Monitors.Data != 0)
|
||||
Marshal.FreeHGlobal(pio.NativePtr->Monitors.Data);
|
||||
pio.NativePtr->Monitors = new(numMonitors, numMonitors, data);
|
||||
if (pio.Handle->Monitors.Data != null)
|
||||
Marshal.FreeHGlobal(new IntPtr(pio.Handle->Monitors.Data));
|
||||
pio.Handle->Monitors = new(numMonitors, numMonitors, (ImGuiPlatformMonitor*)data.ToPointer());
|
||||
|
||||
// ImGuiPlatformIOPtr platformIO = ImGui.GetPlatformIO();
|
||||
// Marshal.FreeHGlobal(platformIO.NativePtr->Monitors.Data);
|
||||
// Marshal.FreeHGlobal(platformIO.Handle->Monitors.Data);
|
||||
// int numMonitors = GetSystemMetrics(SystemMetric.SM_CMONITORS);
|
||||
// nint data = Marshal.AllocHGlobal(Marshal.SizeOf<ImGuiPlatformMonitor>() * numMonitors);
|
||||
// platformIO.NativePtr->Monitors = new ImVector(numMonitors, numMonitors, data);
|
||||
// platformIO.Handle->Monitors = new ImVector(numMonitors, numMonitors, data);
|
||||
|
||||
var monitorIndex = -1;
|
||||
var enumfn = new MonitorEnumProcDelegate(
|
||||
|
|
@ -710,7 +712,7 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
var workRb = new Vector2(info.rcWork.right, info.rcWork.bottom);
|
||||
// Give ImGui the info for this display
|
||||
|
||||
var imMonitor = ImGui.GetPlatformIO().Monitors[monitorIndex];
|
||||
ref var imMonitor = ref ImGui.GetPlatformIO().Monitors.Ref(monitorIndex);
|
||||
imMonitor.MainPos = monitorLt;
|
||||
imMonitor.MainSize = monitorRb - monitorLt;
|
||||
imMonitor.WorkPos = workLt;
|
||||
|
|
@ -723,18 +725,31 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
null,
|
||||
(delegate* unmanaged<HMONITOR, HDC, RECT*, LPARAM, BOOL>)Marshal.GetFunctionPointerForDelegate(enumfn),
|
||||
default);
|
||||
|
||||
Log.Information("Monitors set up!");
|
||||
for (var i = 0; i < numMonitors; i++)
|
||||
{
|
||||
var monitor = pio.Handle->Monitors[i];
|
||||
Log.Information(
|
||||
"Monitor {Index}: {MainPos} {MainSize} {WorkPos} {WorkSize}",
|
||||
i,
|
||||
monitor.MainPos,
|
||||
monitor.MainSize,
|
||||
monitor.WorkPos,
|
||||
monitor.WorkSize);
|
||||
}
|
||||
}
|
||||
|
||||
private nint RegisterFunctionPointer<T>(T obj)
|
||||
private void* RegisterFunctionPointer<T>(T obj)
|
||||
{
|
||||
this.delegateReferences.Add(obj);
|
||||
return Marshal.GetFunctionPointerForDelegate(obj);
|
||||
return Marshal.GetFunctionPointerForDelegate(obj).ToPointer();
|
||||
}
|
||||
|
||||
private void OnCreateWindow(ImGuiViewportPtr viewport)
|
||||
{
|
||||
var data = (ImGuiViewportDataWin32*)Marshal.AllocHGlobal(Marshal.SizeOf<ImGuiViewportDataWin32>());
|
||||
viewport.PlatformUserData = (nint)data;
|
||||
viewport.PlatformUserData = data;
|
||||
viewport.Flags =
|
||||
ImGuiViewportFlags.NoTaskBarIcon |
|
||||
ImGuiViewportFlags.NoFocusOnClick |
|
||||
|
|
@ -784,7 +799,7 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
private void OnDestroyWindow(ImGuiViewportPtr viewport)
|
||||
{
|
||||
// This is also called on the main viewport for some reason, and we never set that viewport's PlatformUserData
|
||||
if (viewport.PlatformUserData == nint.Zero) return;
|
||||
if (viewport.PlatformUserData == null) return;
|
||||
|
||||
var data = (ImGuiViewportDataWin32*)viewport.PlatformUserData;
|
||||
|
||||
|
|
@ -807,8 +822,8 @@ internal sealed unsafe partial class Win32InputHandler : IImGuiInputHandler
|
|||
}
|
||||
|
||||
data->Hwnd = default;
|
||||
Marshal.FreeHGlobal(viewport.PlatformUserData);
|
||||
viewport.PlatformUserData = viewport.PlatformHandle = nint.Zero;
|
||||
Marshal.FreeHGlobal(new IntPtr(viewport.PlatformUserData));
|
||||
viewport.PlatformUserData = viewport.PlatformHandle = null;
|
||||
}
|
||||
|
||||
private void OnShowWindow(ImGuiViewportPtr viewport)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
|
|||
using Dalamud.Interface.ImGuiBackend.Helpers;
|
||||
using Dalamud.Utility;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
using TerraFX.Interop.DirectX;
|
||||
using TerraFX.Interop.Windows;
|
||||
|
|
@ -36,11 +36,11 @@ internal unsafe partial class Dx11Renderer
|
|||
this.renderer = renderer;
|
||||
|
||||
var pio = ImGui.GetPlatformIO();
|
||||
pio.Renderer_CreateWindow = Marshal.GetFunctionPointerForDelegate(this.cwd = this.OnCreateWindow);
|
||||
pio.Renderer_DestroyWindow = (nint)(delegate* unmanaged<ImGuiViewportPtr, void>)&OnDestroyWindow;
|
||||
pio.Renderer_SetWindowSize = (nint)(delegate* unmanaged<ImGuiViewportPtr, Vector2, void>)&OnSetWindowSize;
|
||||
pio.Renderer_RenderWindow = (nint)(delegate* unmanaged<ImGuiViewportPtr, nint, void>)&OnRenderWindow;
|
||||
pio.Renderer_SwapBuffers = (nint)(delegate* unmanaged<ImGuiViewportPtr, nint, void>)&OnSwapBuffers;
|
||||
pio.RendererCreateWindow = Marshal.GetFunctionPointerForDelegate(this.cwd = this.OnCreateWindow).ToPointer();
|
||||
pio.RendererDestroyWindow = (delegate* unmanaged<ImGuiViewportPtr, void>)&OnDestroyWindow;
|
||||
pio.RendererSetWindowSize = (delegate* unmanaged<ImGuiViewportPtr, Vector2, void>)&OnSetWindowSize;
|
||||
pio.RendererRenderWindow = (delegate* unmanaged<ImGuiViewportPtr, nint, void>)&OnRenderWindow;
|
||||
pio.RendererSwapBuffers = (delegate* unmanaged<ImGuiViewportPtr, nint, void>)&OnSwapBuffers;
|
||||
}
|
||||
|
||||
~ViewportHandler() => ReleaseUnmanagedResources();
|
||||
|
|
@ -54,20 +54,20 @@ internal unsafe partial class Dx11Renderer
|
|||
private static void ReleaseUnmanagedResources()
|
||||
{
|
||||
var pio = ImGui.GetPlatformIO();
|
||||
pio.Renderer_CreateWindow = nint.Zero;
|
||||
pio.Renderer_DestroyWindow = nint.Zero;
|
||||
pio.Renderer_SetWindowSize = nint.Zero;
|
||||
pio.Renderer_RenderWindow = nint.Zero;
|
||||
pio.Renderer_SwapBuffers = nint.Zero;
|
||||
pio.RendererCreateWindow = null;
|
||||
pio.RendererDestroyWindow = null;
|
||||
pio.RendererSetWindowSize = null;
|
||||
pio.RendererRenderWindow = null;
|
||||
pio.RendererSwapBuffers = null;
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly]
|
||||
private static void OnDestroyWindow(ImGuiViewportPtr viewport)
|
||||
{
|
||||
if (viewport.RendererUserData == nint.Zero)
|
||||
if (viewport.RendererUserData == null)
|
||||
return;
|
||||
ViewportData.Attach(viewport.RendererUserData).Dispose();
|
||||
viewport.RendererUserData = nint.Zero;
|
||||
viewport.RendererUserData = null;
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly]
|
||||
|
|
@ -87,7 +87,7 @@ internal unsafe partial class Dx11Renderer
|
|||
// PlatformHandleRaw should always be a HWND, whereas PlatformHandle might be a higher-level handle (e.g. GLFWWindow*, SDL_Window*).
|
||||
// Some backend will leave PlatformHandleRaw NULL, in which case we assume PlatformHandle will contain the HWND.
|
||||
var hWnd = viewport.PlatformHandleRaw;
|
||||
if (hWnd == 0)
|
||||
if (hWnd == null)
|
||||
hWnd = viewport.PlatformHandle;
|
||||
try
|
||||
{
|
||||
|
|
@ -135,12 +135,12 @@ internal unsafe partial class Dx11Renderer
|
|||
|
||||
public IDXGISwapChain* SwapChain => this.swapChain;
|
||||
|
||||
public nint Handle => GCHandle.ToIntPtr(this.selfGcHandle);
|
||||
public void* Handle => GCHandle.ToIntPtr(this.selfGcHandle).ToPointer();
|
||||
|
||||
private DXGI_FORMAT RtvFormat => this.parent.rtvFormat;
|
||||
|
||||
public static ViewportData Attach(nint handle) =>
|
||||
(ViewportData)GCHandle.FromIntPtr(handle).Target ?? throw new InvalidOperationException();
|
||||
public static ViewportData Attach(void* handle) =>
|
||||
(ViewportData)GCHandle.FromIntPtr(new IntPtr(handle)).Target ?? throw new InvalidOperationException();
|
||||
|
||||
public static ViewportData Create(
|
||||
Dx11Renderer renderer,
|
||||
|
|
@ -220,7 +220,7 @@ internal unsafe partial class Dx11Renderer
|
|||
dcVisual.Get()->SetContent((IUnknown*)swapChain1.Get()).ThrowOnError();
|
||||
dcTarget.Get()->SetRoot(dcVisual).ThrowOnError();
|
||||
renderer.dcompDevice.Get()->Commit().ThrowOnError();
|
||||
|
||||
|
||||
using var swapChain = default(ComPtr<IDXGISwapChain>);
|
||||
swapChain1.As(&swapChain).ThrowOnError();
|
||||
return Create(renderer, swapChain, dcVisual, dcTarget);
|
||||
|
|
@ -272,7 +272,7 @@ internal unsafe partial class Dx11Renderer
|
|||
|
||||
return Create(renderer, swapChain, null, null);
|
||||
}
|
||||
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (!this.selfGcHandle.IsAllocated)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ using Dalamud.Interface.Textures.TextureWraps.Internal;
|
|||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Utility;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
using TerraFX.Interop.DirectX;
|
||||
using TerraFX.Interop.Windows;
|
||||
|
|
@ -67,7 +67,7 @@ internal unsafe partial class Dx11Renderer : IImGuiRenderer
|
|||
public Dx11Renderer(IDXGISwapChain* swapChain, ID3D11Device* device, ID3D11DeviceContext* context)
|
||||
{
|
||||
var io = ImGui.GetIO();
|
||||
if (ImGui.GetIO().NativePtr->BackendRendererName is not null)
|
||||
if (ImGui.GetIO().Handle->BackendRendererName is not null)
|
||||
throw new InvalidOperationException("ImGui backend renderer seems to be have been already attached.");
|
||||
try
|
||||
{
|
||||
|
|
@ -81,7 +81,7 @@ internal unsafe partial class Dx11Renderer : IImGuiRenderer
|
|||
io.BackendFlags |= ImGuiBackendFlags.RendererHasVtxOffset | ImGuiBackendFlags.RendererHasViewports;
|
||||
|
||||
this.renderNamePtr = Marshal.StringToHGlobalAnsi("imgui_impl_dx11_c#");
|
||||
io.NativePtr->BackendRendererName = (byte*)this.renderNamePtr;
|
||||
io.Handle->BackendRendererName = (byte*)this.renderNamePtr;
|
||||
|
||||
if (io.ConfigFlags.HasFlag(ImGuiConfigFlags.ViewportsEnable))
|
||||
{
|
||||
|
|
@ -102,7 +102,8 @@ internal unsafe partial class Dx11Renderer : IImGuiRenderer
|
|||
}
|
||||
|
||||
this.mainViewport = ViewportData.Create(this, swapChain, null, null);
|
||||
ImGui.GetPlatformIO().Viewports[0].RendererUserData = this.mainViewport.Handle;
|
||||
var vp = ImGui.GetPlatformIO().Viewports[0];
|
||||
vp.RendererUserData = this.mainViewport.Handle;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
@ -205,7 +206,7 @@ internal unsafe partial class Dx11Renderer : IImGuiRenderer
|
|||
this.device.Get()->CreateTexture2D(&texDesc, &subrdata, texture.GetAddressOf()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
texture.Get()->SetDebugName($"Texture:{debugName}:SRV");
|
||||
|
||||
using var srvTemp = default(ComPtr<ID3D11ShaderResourceView>);
|
||||
|
|
@ -243,7 +244,7 @@ internal unsafe partial class Dx11Renderer : IImGuiRenderer
|
|||
if (!drawData.Valid || drawData.CmdListsCount == 0)
|
||||
return;
|
||||
|
||||
var cmdLists = new Span<ImDrawListPtr>(drawData.NativePtr->CmdLists, drawData.NativePtr->CmdListsCount);
|
||||
var cmdLists = new Span<ImDrawListPtr>(drawData.Handle->CmdLists, drawData.Handle->CmdListsCount);
|
||||
|
||||
// Create and grow vertex/index buffers if needed
|
||||
if (this.vertexBufferSize < drawData.TotalVtxCount)
|
||||
|
|
@ -298,8 +299,8 @@ internal unsafe partial class Dx11Renderer : IImGuiRenderer
|
|||
var targetIndices = new Span<ushort>(indexData.pData, this.indexBufferSize);
|
||||
foreach (ref var cmdList in cmdLists)
|
||||
{
|
||||
var vertices = new ImVectorWrapper<ImDrawVert>(&cmdList.NativePtr->VtxBuffer);
|
||||
var indices = new ImVectorWrapper<ushort>(&cmdList.NativePtr->IdxBuffer);
|
||||
var vertices = new ImVectorWrapper<ImDrawVert>(cmdList.Handle->VtxBuffer.ToUntyped());
|
||||
var indices = new ImVectorWrapper<ushort>(cmdList.Handle->IdxBuffer.ToUntyped());
|
||||
|
||||
vertices.DataSpan.CopyTo(targetVertices);
|
||||
indices.DataSpan.CopyTo(targetIndices);
|
||||
|
|
@ -346,7 +347,7 @@ internal unsafe partial class Dx11Renderer : IImGuiRenderer
|
|||
var clipOff = new Vector4(drawData.DisplayPos, drawData.DisplayPos.X, drawData.DisplayPos.Y);
|
||||
foreach (ref var cmdList in cmdLists)
|
||||
{
|
||||
var cmds = new ImVectorWrapper<ImDrawCmd>(&cmdList.NativePtr->CmdBuffer);
|
||||
var cmds = new ImVectorWrapper<ImDrawCmd>(cmdList.Handle->CmdBuffer.ToUntyped());
|
||||
foreach (ref var cmd in cmds.DataSpan)
|
||||
{
|
||||
var clipV4 = cmd.ClipRect - clipOff;
|
||||
|
|
@ -358,10 +359,10 @@ internal unsafe partial class Dx11Renderer : IImGuiRenderer
|
|||
|
||||
this.context.Get()->RSSetScissorRects(1, &clipRect);
|
||||
|
||||
if (cmd.UserCallback == nint.Zero)
|
||||
if (cmd.UserCallback != null)
|
||||
{
|
||||
// Bind texture and draw
|
||||
var srv = (ID3D11ShaderResourceView*)cmd.TextureId;
|
||||
var srv = (ID3D11ShaderResourceView*)cmd.TextureId.Handle;
|
||||
this.context.Get()->PSSetShader(this.pixelShader, null, 0);
|
||||
this.context.Get()->PSSetSamplers(0, 1, this.sampler.GetAddressOf());
|
||||
this.context.Get()->PSSetShaderResources(0, 1, &srv);
|
||||
|
|
@ -397,13 +398,16 @@ internal unsafe partial class Dx11Renderer : IImGuiRenderer
|
|||
textureIndex < textureCount;
|
||||
textureIndex++)
|
||||
{
|
||||
int width = 0, height = 0, bytespp = 0;
|
||||
byte* fontPixels = null;
|
||||
|
||||
// Build texture atlas
|
||||
io.Fonts.GetTexDataAsRGBA32(
|
||||
textureIndex,
|
||||
out byte* fontPixels,
|
||||
out var width,
|
||||
out var height,
|
||||
out var bytespp);
|
||||
&fontPixels,
|
||||
ref width,
|
||||
ref height,
|
||||
ref bytespp);
|
||||
|
||||
var tex = this.CreateTexture2D(
|
||||
new(fontPixels, width * height * bytespp),
|
||||
|
|
@ -539,7 +543,7 @@ internal unsafe partial class Dx11Renderer : IImGuiRenderer
|
|||
fixed (ID3D11SamplerState** ppSampler = &this.sampler.GetPinnableReference())
|
||||
this.device.Get()->CreateSamplerState(&samplerDesc, ppSampler).ThrowOnError();
|
||||
}
|
||||
|
||||
|
||||
// Create the constant buffer
|
||||
if (this.vertexConstantBuffer.IsEmpty())
|
||||
{
|
||||
|
|
@ -630,14 +634,15 @@ internal unsafe partial class Dx11Renderer : IImGuiRenderer
|
|||
this.releaseUnmanagedResourceCalled = true;
|
||||
|
||||
this.mainViewport.Dispose();
|
||||
ImGui.GetPlatformIO().Viewports[0].RendererUserData = nint.Zero;
|
||||
var vp = ImGui.GetPlatformIO().Viewports[0];
|
||||
vp.RendererUserData = null;
|
||||
ImGui.DestroyPlatformWindows();
|
||||
|
||||
this.viewportHandler.Dispose();
|
||||
|
||||
var io = ImGui.GetIO();
|
||||
if (io.NativePtr->BackendRendererName == (void*)this.renderNamePtr)
|
||||
io.NativePtr->BackendRendererName = null;
|
||||
if (io.Handle->BackendRendererName == (void*)this.renderNamePtr)
|
||||
io.Handle->BackendRendererName = null;
|
||||
if (this.renderNamePtr != 0)
|
||||
Marshal.FreeHGlobal(this.renderNamePtr);
|
||||
|
||||
|
|
@ -645,7 +650,7 @@ internal unsafe partial class Dx11Renderer : IImGuiRenderer
|
|||
fontResourceView.Dispose();
|
||||
|
||||
foreach (var i in Enumerable.Range(0, io.Fonts.Textures.Size))
|
||||
io.Fonts.SetTexID(i, nint.Zero);
|
||||
io.Fonts.SetTexID(i, ImTextureID.Null);
|
||||
|
||||
this.device.Reset();
|
||||
this.context.Reset();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
using Dalamud.Interface.Textures;
|
||||
using Dalamud.Interface.Textures.TextureWraps;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.ImGuiBackend.Renderers;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using System.Numerics;
|
|||
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Utility;
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.ImGuiFileDialog;
|
||||
|
||||
|
|
@ -397,7 +397,7 @@ public partial class FileDialog
|
|||
ImGuiListClipperPtr clipper;
|
||||
unsafe
|
||||
{
|
||||
clipper = new ImGuiListClipperPtr(ImGuiNative.ImGuiListClipper_ImGuiListClipper());
|
||||
clipper = new ImGuiListClipperPtr(ImGui.ImGuiListClipper());
|
||||
}
|
||||
|
||||
lock (this.filesLock)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.ImGuiFileDialog;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.ImGuiFileDialog;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using System.Text;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Configuration.Internal;
|
||||
using Dalamud.Interface.Colors;
|
||||
using Dalamud.Interface.FontIdentifier;
|
||||
|
|
@ -12,9 +13,6 @@ using Dalamud.Interface.ManagedFontAtlas;
|
|||
using Dalamud.Interface.ManagedFontAtlas.Internals;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Utility;
|
||||
|
||||
using ImGuiNET;
|
||||
|
||||
using TerraFX.Interop.DirectX;
|
||||
using TerraFX.Interop.Windows;
|
||||
|
||||
|
|
@ -89,7 +87,7 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
private bool popupSizeChanged;
|
||||
private Vector2 popupPosition = new(float.NaN);
|
||||
private Vector2 popupSize = new(float.NaN);
|
||||
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="SingleFontChooserDialog"/> class.</summary>
|
||||
/// <param name="uiBuilder">The relevant instance of UiBuilder.</param>
|
||||
/// <param name="isGlobalScaled">Whether the fonts in the atlas is global scaled.</param>
|
||||
|
|
@ -274,7 +272,7 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
return new Vector2(40, 30) * ImGui.GetTextLineHeight();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <inheritdoc/>
|
||||
public void Dispose()
|
||||
{
|
||||
this.fontHandle?.Dispose();
|
||||
|
|
@ -432,7 +430,7 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
this.firstDrawAfterRefresh = false;
|
||||
}
|
||||
|
||||
private static float GetDistanceFromMonitor(Vector2 point, ImGuiPlatformMonitorPtr monitor)
|
||||
private static float GetDistanceFromMonitor(Vector2 point, ImGuiPlatformMonitor monitor)
|
||||
{
|
||||
var lt = monitor.MainPos;
|
||||
var rb = monitor.MainPos + monitor.MainSize;
|
||||
|
|
@ -565,7 +563,7 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
fixed (byte* buf = this.fontPreviewText)
|
||||
fixed (byte* label = "##fontPreviewText"u8)
|
||||
{
|
||||
ImGuiNative.igInputTextMultiline(
|
||||
ImGui.InputTextMultiline(
|
||||
label,
|
||||
buf,
|
||||
(uint)this.fontPreviewText.Length,
|
||||
|
|
@ -691,7 +689,7 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
|
||||
if (ImGui.BeginChild("##familyList", ImGui.GetContentRegionAvail()))
|
||||
{
|
||||
var clipper = new ImGuiListClipperPtr(ImGuiNative.ImGuiListClipper_ImGuiListClipper());
|
||||
var clipper = new ImGuiListClipperPtr(ImGui.ImGuiListClipper());
|
||||
var lineHeight = ImGui.GetTextLineHeightWithSpacing();
|
||||
|
||||
if ((changed || this.firstDrawAfterRefresh) && this.selectedFamilyIndex != -1)
|
||||
|
|
@ -858,7 +856,7 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
|
||||
if (ImGui.BeginChild("##fontList"))
|
||||
{
|
||||
var clipper = new ImGuiListClipperPtr(ImGuiNative.ImGuiListClipper_ImGuiListClipper());
|
||||
var clipper = new ImGuiListClipperPtr(ImGui.ImGuiListClipper());
|
||||
var lineHeight = ImGui.GetTextLineHeightWithSpacing();
|
||||
|
||||
if ((changed || this.firstDrawAfterRefresh) && this.selectedFontIndex != -1)
|
||||
|
|
@ -962,7 +960,7 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
|
||||
if (ImGui.BeginChild("##fontSizeList"))
|
||||
{
|
||||
var clipper = new ImGuiListClipperPtr(ImGuiNative.ImGuiListClipper_ImGuiListClipper());
|
||||
var clipper = new ImGuiListClipperPtr(ImGui.ImGuiListClipper());
|
||||
var lineHeight = ImGui.GetTextLineHeightWithSpacing();
|
||||
|
||||
if (changed && this.selectedFontIndex != -1)
|
||||
|
|
@ -1149,7 +1147,7 @@ public sealed class SingleFontChooserDialog : IDisposable
|
|||
|
||||
return 0;
|
||||
});
|
||||
|
||||
|
||||
if (stylePushed)
|
||||
ImGui.PopStyleColor();
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using Dalamud.Interface.Internal;
|
|||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Utility;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.ImGuiNotification.Internal;
|
||||
|
||||
|
|
@ -88,7 +88,11 @@ internal sealed partial class ActiveNotification
|
|||
|
||||
if (!isTakingKeyboardInput && !isHovered && isFocused)
|
||||
{
|
||||
ImGui.SetWindowFocus(null);
|
||||
unsafe
|
||||
{
|
||||
ImGui.SetWindowFocus((byte*)null);
|
||||
}
|
||||
|
||||
isFocused = false;
|
||||
}
|
||||
|
||||
|
|
@ -529,9 +533,9 @@ internal sealed partial class ActiveNotification
|
|||
verts[vertPtr++] = lastOff;
|
||||
unsafe
|
||||
{
|
||||
var dlist = ImGui.GetWindowDrawList().NativePtr;
|
||||
var dlist = ImGui.GetWindowDrawList().Handle;
|
||||
fixed (Vector2* pvert = verts)
|
||||
ImGuiNative.ImDrawList_AddConvexPolyFilled(dlist, pvert, vertPtr, color);
|
||||
dlist->AddConvexPolyFilled(pvert, vertPtr, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ using Dalamud.IoC.Internal;
|
|||
using Dalamud.Plugin.Internal.Types;
|
||||
using Dalamud.Plugin.Services;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.ImGuiNotification.Internal;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ using Dalamud.Interface.Utility;
|
|||
using Dalamud.Plugin.Internal.Types;
|
||||
using Dalamud.Storage.Assets;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.ImGuiNotification;
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ public static class NotificationUtilities
|
|||
using (fontHandle.Push())
|
||||
{
|
||||
var font = ImGui.GetFont();
|
||||
var glyphPtr = (ImGuiHelpers.ImFontGlyphReal*)font.FindGlyphNoFallback(c).NativePtr;
|
||||
var glyphPtr = (ImGuiHelpers.ImFontGlyphReal*)font.FindGlyphNoFallback(c);
|
||||
if (glyphPtr is null)
|
||||
return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ using Dalamud.Utility;
|
|||
using FFXIVClientStructs.FFXIV.Client.System.String;
|
||||
using FFXIVClientStructs.FFXIV.Client.UI;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
using Lumina.Excel.Sheets;
|
||||
using Lumina.Text;
|
||||
|
|
@ -58,7 +58,7 @@ internal unsafe class SeStringRenderer : IInternalDisposableService
|
|||
private readonly SeStringColorStackSet colorStackSet;
|
||||
|
||||
/// <summary>Splits a draw list so that different layers of a single glyph can be drawn out of order.</summary>
|
||||
private ImDrawListSplitter* splitter = ImGuiNative.ImDrawListSplitter_ImDrawListSplitter();
|
||||
private ImDrawListSplitter* splitter = ImGui.ImDrawListSplitter();
|
||||
|
||||
[ServiceManager.ServiceConstructor]
|
||||
private SeStringRenderer(DataManager dm, TargetSigScanner sigScanner)
|
||||
|
|
@ -146,15 +146,25 @@ internal unsafe class SeStringRenderer : IInternalDisposableService
|
|||
size = Vector2.Max(size, fragment.Offset + new Vector2(fragment.VisibleWidth, state.LineHeight));
|
||||
|
||||
// If we're not drawing at all, stop further processing.
|
||||
if (state.DrawList.NativePtr is null)
|
||||
if (state.DrawList.Handle is null)
|
||||
return new() { Size = size };
|
||||
|
||||
state.SplitDrawList();
|
||||
|
||||
// Handle cases where ImGui.AlignTextToFramePadding has been called.
|
||||
var pCurrentWindow = *(nint*)(ImGui.GetCurrentContext() + ImGuiContextCurrentWindowOffset);
|
||||
var pWindowDc = pCurrentWindow + ImGuiWindowDcOffset;
|
||||
var currLineTextBaseOffset = *(float*)(pWindowDc + ImGuiWindowTempDataCurrLineTextBaseOffset);
|
||||
var context = ImGui.GetCurrentContext();
|
||||
var currLineTextBaseOffset = 0f;
|
||||
/*
|
||||
if (!context.IsNull)
|
||||
{
|
||||
var currentWindow = context.CurrentWindow;
|
||||
if (!currentWindow.IsNull)
|
||||
{
|
||||
currLineTextBaseOffset = currentWindow.DC.CurrLineTextBaseOffset;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
var itemSize = size;
|
||||
if (currLineTextBaseOffset != 0f)
|
||||
{
|
||||
|
|
@ -280,7 +290,7 @@ internal unsafe class SeStringRenderer : IInternalDisposableService
|
|||
{
|
||||
if (this.splitter is not null)
|
||||
{
|
||||
ImGuiNative.ImDrawListSplitter_destroy(this.splitter);
|
||||
this.splitter->Destroy();
|
||||
this.splitter = null;
|
||||
}
|
||||
}
|
||||
|
|
@ -295,7 +305,7 @@ internal unsafe class SeStringRenderer : IInternalDisposableService
|
|||
var link = -1;
|
||||
foreach (var (breakAt, mandatory) in new LineBreakEnumerator(state.Span, UtfEnumeratorFlags.Utf8SeString))
|
||||
{
|
||||
// Might have happened if custom entity was longer than the previous break unit.
|
||||
// Might have happened if custom entity was longer than the previous break unit.
|
||||
if (prev > breakAt)
|
||||
continue;
|
||||
|
||||
|
|
@ -487,7 +497,7 @@ internal unsafe class SeStringRenderer : IInternalDisposableService
|
|||
if (gfdTextureSrv != 0)
|
||||
{
|
||||
state.Draw(
|
||||
gfdTextureSrv,
|
||||
new ImTextureID(gfdTextureSrv),
|
||||
offset + new Vector2(x, MathF.Round((state.LineHeight - size.Y) / 2)),
|
||||
size,
|
||||
useHq ? gfdEntry.HqUv0 : gfdEntry.Uv0,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using System.Numerics;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
using Lumina.Text.Payloads;
|
||||
|
||||
|
|
@ -105,8 +105,8 @@ public record struct SeStringDrawParams
|
|||
|
||||
/// <summary>Gets the effective font.</summary>
|
||||
internal readonly unsafe ImFont* EffectiveFont =>
|
||||
(this.Font ?? ImGui.GetFont()) is var f && f.NativePtr is not null
|
||||
? f.NativePtr
|
||||
(this.Font ?? ImGui.GetFont()) is var f && f.Handle is not null
|
||||
? f.Handle
|
||||
: throw new ArgumentException("Specified font is empty.");
|
||||
|
||||
/// <summary>Gets the effective line height in pixels.</summary>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ using Dalamud.Interface.Utility;
|
|||
|
||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
using Lumina.Text.Payloads;
|
||||
using Lumina.Text.ReadOnly;
|
||||
|
|
@ -150,7 +150,7 @@ public unsafe ref struct SeStringDrawState
|
|||
/// <param name="channelIndex">Channel to switch to.</param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly void SetCurrentChannel(SeStringDrawChannel channelIndex) =>
|
||||
ImGuiNative.ImDrawListSplitter_SetCurrentChannel(this.splitter, this.drawList, (int)channelIndex);
|
||||
this.splitter->SetCurrentChannel(this.drawList, (int)channelIndex);
|
||||
|
||||
/// <summary>Draws a single texture.</summary>
|
||||
/// <param name="igTextureId">ImGui texture ID to draw from.</param>
|
||||
|
|
@ -160,7 +160,7 @@ public unsafe ref struct SeStringDrawState
|
|||
/// <param name="uv1">Right bottom corner of the glyph w.r.t. its glyph origin in the source texture.</param>
|
||||
/// <param name="color">Color of the glyph in RGBA.</param>
|
||||
public readonly void Draw(
|
||||
nint igTextureId,
|
||||
ImTextureID igTextureId,
|
||||
Vector2 offset,
|
||||
Vector2 size,
|
||||
Vector2 uv0,
|
||||
|
|
@ -193,7 +193,7 @@ public unsafe ref struct SeStringDrawState
|
|||
/// top and bottom pixels to apply faux italicization by <see cref="Vector2.X"/> and <see cref="Vector2.Y"/>
|
||||
/// respectively.</param>
|
||||
public readonly void Draw(
|
||||
nint igTextureId,
|
||||
ImTextureID igTextureId,
|
||||
Vector2 offset,
|
||||
Vector2 xy0,
|
||||
Vector2 xy1,
|
||||
|
|
@ -305,7 +305,7 @@ public unsafe ref struct SeStringDrawState
|
|||
internal readonly ref ImGuiHelpers.ImFontGlyphReal FindGlyph(Rune rune)
|
||||
{
|
||||
var p = rune.Value is >= ushort.MinValue and < ushort.MaxValue
|
||||
? ImGuiNative.ImFont_FindGlyph(this.Font, (ushort)rune.Value)
|
||||
? this.Font->FindGlyph((ushort)rune.Value)
|
||||
: this.Font->FallbackGlyph;
|
||||
return ref *(ImGuiHelpers.ImFontGlyphReal*)p;
|
||||
}
|
||||
|
|
@ -340,8 +340,7 @@ public unsafe ref struct SeStringDrawState
|
|||
return 0;
|
||||
|
||||
return MathF.Round(
|
||||
ImGuiNative.ImFont_GetDistanceAdjustmentForPair(
|
||||
this.Font,
|
||||
this.Font->GetDistanceAdjustmentForPair(
|
||||
(ushort)left.Value,
|
||||
(ushort)right.Value) * this.FontSizeScale);
|
||||
}
|
||||
|
|
@ -398,9 +397,9 @@ public unsafe ref struct SeStringDrawState
|
|||
/// <summary>Splits the draw list.</summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal readonly void SplitDrawList() =>
|
||||
ImGuiNative.ImDrawListSplitter_Split(this.splitter, this.drawList, ChannelCount);
|
||||
this.splitter->Split(this.drawList, ChannelCount);
|
||||
|
||||
/// <summary>Merges the draw list.</summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal readonly void MergeDrawList() => ImGuiNative.ImDrawListSplitter_Merge(this.splitter, this.drawList);
|
||||
internal readonly void MergeDrawList() => this.splitter->Merge(this.drawList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.Internal.UiDebug2.Browsing;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using Dalamud.Interface.Utility;
|
||||
|
||||
using ImGuiNET;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.Data;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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}");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue