mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-03 14:23:40 +01:00
Merge remote-tracking branch 'upstream/apiX' into feature/itextureprovider-updates
This commit is contained in:
commit
0d7c0a0375
335 changed files with 1640 additions and 1020 deletions
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace Dalamud.Utility;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics;
|
||||
|
||||
using Serilog;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ using Dalamud.Game.ClientState.Objects.Types;
|
|||
|
||||
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
||||
|
||||
using Lumina;
|
||||
using Lumina.Excel.GeneratedSheets;
|
||||
|
||||
namespace Dalamud.Utility;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading;
|
||||
|
||||
namespace Dalamud.Utility;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
using System;
|
||||
|
||||
using JetBrains.Annotations;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Dalamud.Utility.Signatures;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.Utility.Signatures;
|
||||
namespace Dalamud.Utility.Signatures;
|
||||
|
||||
/// <summary>
|
||||
/// An exception for signatures.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
|
@ -7,7 +6,6 @@ using System.Runtime.InteropServices;
|
|||
using Dalamud.Game;
|
||||
using Dalamud.Hooking;
|
||||
using Dalamud.Logging;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Utility.Signatures.Wrappers;
|
||||
using Serilog;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
using System;
|
||||
|
||||
using Dalamud.Hooking;
|
||||
using Dalamud.Hooking;
|
||||
|
||||
namespace Dalamud.Utility.Signatures;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Dalamud.Utility.Signatures.Wrappers;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.Utility.Signatures.Wrappers;
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Dalamud.Utility.Signatures.Wrappers;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Dalamud.Utility;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Dalamud.Utility
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
|
|
|||
|
|
@ -19,12 +19,11 @@ using Dalamud.Game.ClientState.Objects.SubKinds;
|
|||
using Dalamud.Game.ClientState.Objects.Types;
|
||||
using Dalamud.Interface.Colors;
|
||||
using Dalamud.Interface.Utility;
|
||||
|
||||
using ImGuiNET;
|
||||
using Lumina.Excel.GeneratedSheets;
|
||||
using Serilog;
|
||||
|
||||
using TerraFX.Interop.Windows;
|
||||
|
||||
using Windows.Win32.Storage.FileSystem;
|
||||
|
||||
namespace Dalamud.Utility;
|
||||
|
|
@ -477,12 +476,12 @@ public static class Util
|
|||
case "MacOS": return OSPlatform.OSX;
|
||||
case "Linux": return OSPlatform.Linux;
|
||||
}
|
||||
|
||||
|
||||
// n.b. we had some fancy code here to check if the Wine host version returned "Darwin" but apparently
|
||||
// *all* our Wines report Darwin if exports aren't hidden. As such, it is effectively impossible (without some
|
||||
// (very cursed and inaccurate heuristics) to determine if we're on macOS or Linux unless we're explicitly told
|
||||
// by our launcher. See commit a7aacb15e4603a367e2f980578271a9a639d8852 for the old check.
|
||||
|
||||
|
||||
return IsWine() ? OSPlatform.Linux : OSPlatform.Windows;
|
||||
}
|
||||
|
||||
|
|
@ -545,7 +544,7 @@ public static class Util
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
foreach (var enumerator in enumerators)
|
||||
|
|
@ -586,7 +585,7 @@ public static class Util
|
|||
{
|
||||
WriteAllTextSafe(path, text, Encoding.UTF8);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Overwrite text in a file by first writing it to a temporary file, and then
|
||||
/// moving that file to the path specified.
|
||||
|
|
@ -598,7 +597,7 @@ public static class Util
|
|||
{
|
||||
WriteAllBytesSafe(path, encoding.GetBytes(text));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Overwrite data in a file by first writing it to a temporary file, and then
|
||||
/// moving that file to the path specified.
|
||||
|
|
@ -608,13 +607,13 @@ public static class Util
|
|||
public static unsafe void WriteAllBytesSafe(string path, byte[] bytes)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrEmpty(path);
|
||||
|
||||
|
||||
// Open the temp file
|
||||
var tempPath = path + ".tmp";
|
||||
|
||||
using var tempFile = Windows.Win32.PInvoke.CreateFile(
|
||||
tempPath,
|
||||
(uint)(FILE_ACCESS_RIGHTS.FILE_GENERIC_READ | FILE_ACCESS_RIGHTS.FILE_GENERIC_WRITE),
|
||||
tempPath,
|
||||
(uint)(FILE_ACCESS_RIGHTS.FILE_GENERIC_READ | FILE_ACCESS_RIGHTS.FILE_GENERIC_WRITE),
|
||||
FILE_SHARE_MODE.FILE_SHARE_NONE,
|
||||
null,
|
||||
FILE_CREATION_DISPOSITION.CREATE_ALWAYS,
|
||||
|
|
@ -623,7 +622,7 @@ public static class Util
|
|||
|
||||
if (tempFile.IsInvalid)
|
||||
throw new Win32Exception();
|
||||
|
||||
|
||||
// Write the data
|
||||
uint bytesWritten = 0;
|
||||
if (!Windows.Win32.PInvoke.WriteFile(tempFile, new ReadOnlySpan<byte>(bytes), &bytesWritten, null))
|
||||
|
|
@ -634,7 +633,7 @@ public static class Util
|
|||
|
||||
if (!Windows.Win32.PInvoke.FlushFileBuffers(tempFile))
|
||||
throw new Win32Exception();
|
||||
|
||||
|
||||
tempFile.Close();
|
||||
|
||||
if (!Windows.Win32.PInvoke.MoveFileEx(tempPath, path, MOVE_FILE_FLAGS.MOVEFILE_REPLACE_EXISTING | MOVE_FILE_FLAGS.MOVEFILE_WRITE_THROUGH))
|
||||
|
|
@ -721,7 +720,7 @@ public static class Util
|
|||
internal static void PrintGameObject(GameObject actor, string tag, bool resolveGameData)
|
||||
{
|
||||
var actorString =
|
||||
$"{actor.Address.ToInt64():X}:{actor.ObjectId:X}[{tag}] - {actor.ObjectKind} - {actor.Name} - X{actor.Position.X} Y{actor.Position.Y} Z{actor.Position.Z} D{actor.YalmDistanceX} R{actor.Rotation} - Target: {actor.TargetObjectId:X}\n";
|
||||
$"{actor.Address.ToInt64():X}:{actor.GameObjectId:X}[{tag}] - {actor.ObjectKind} - {actor.Name} - X{actor.Position.X} Y{actor.Position.Y} Z{actor.Position.Z} D{actor.YalmDistanceX} R{actor.Rotation} - Target: {actor.TargetObjectId:X}\n";
|
||||
|
||||
if (actor is Npc npc)
|
||||
actorString += $" DataId: {npc.DataId} NameId:{npc.NameId}\n";
|
||||
|
|
@ -760,7 +759,7 @@ public static class Util
|
|||
"-",
|
||||
MethodAttributes.Public | MethodAttributes.Static,
|
||||
CallingConventions.Standard,
|
||||
null,
|
||||
null,
|
||||
new[] { typeof(object), typeof(IList<string>), typeof(ulong) },
|
||||
obj.GetType(),
|
||||
true);
|
||||
|
|
@ -917,7 +916,7 @@ public static class Util
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Show a structure in an ImGui context.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue