Merge branch 'api13' into DtrClickAddiction

This commit is contained in:
MidoriKami 2025-07-26 12:53:06 -07:00 committed by GitHub
commit f30bcb7d4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 44 additions and 253 deletions

View file

@ -152,23 +152,11 @@ internal sealed class DalamudConfiguration : IInternalDisposableService
/// </summary> /// </summary>
public float GlobalUiScale { get; set; } = 1.0f; public float GlobalUiScale { get; set; } = 1.0f;
/// <summary>
/// Gets or sets a value indicating whether to use AXIS fonts from the game.
/// </summary>
[Obsolete($"See {nameof(DefaultFontSpec)}")]
public bool UseAxisFontsFromGame { get; set; } = true;
/// <summary> /// <summary>
/// Gets or sets the default font spec. /// Gets or sets the default font spec.
/// </summary> /// </summary>
public IFontSpec? DefaultFontSpec { get; set; } public IFontSpec? DefaultFontSpec { get; set; }
/// <summary>
/// Gets or sets the gamma value to apply for Dalamud fonts. Do not use.
/// </summary>
[Obsolete("It happens that nobody touched this setting", true)]
public float FontGammaLevel { get; set; } = 1.4f;
/// <summary>Gets or sets the opacity of the IME state indicator.</summary> /// <summary>Gets or sets the opacity of the IME state indicator.</summary>
/// <value>0 will hide the state indicator. 1 will make the state indicator fully visible. Values outside the /// <value>0 will hide the state indicator. 1 will make the state indicator fully visible. Values outside the
/// range will be clamped to [0, 1].</value> /// range will be clamped to [0, 1].</value>

View file

@ -1,4 +1,4 @@
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using Dalamud.Utility; using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Component.GUI;
@ -33,17 +33,10 @@ internal unsafe class AddonEventEntry
/// </summary> /// </summary>
public required nint Node { get; init; } public required nint Node { get; init; }
/// <summary>
/// Gets the handler that gets called when this event is triggered.
/// </summary>
[Obsolete("Use AddonEventDelegate Delegate instead")]
public IAddonEventManager.AddonEventHandler Handler { get; init; }
/// <summary> /// <summary>
/// Gets the delegate that gets called when this event is triggered. /// Gets the delegate that gets called when this event is triggered.
/// </summary> /// </summary>
[Api13ToDo("Make this field required")] public required IAddonEventManager.AddonEventDelegate Delegate { get; init; }
public IAddonEventManager.AddonEventDelegate Delegate { get; init; }
/// <summary> /// <summary>
/// Gets the unique id for this event. /// Gets the unique id for this event.

View file

@ -73,29 +73,6 @@ internal unsafe class AddonEventManager : IInternalDisposableService
this.addonLifecycle.UnregisterListener(this.finalizeEventListener); this.addonLifecycle.UnregisterListener(this.finalizeEventListener);
} }
/// <summary>
/// Registers an event handler for the specified addon, node, and type.
/// </summary>
/// <param name="pluginId">Unique ID for this plugin.</param>
/// <param name="atkUnitBase">The parent addon for this event.</param>
/// <param name="atkResNode">The node that will trigger this event.</param>
/// <param name="eventType">The event type for this event.</param>
/// <param name="eventHandler">The handler to call when event is triggered.</param>
/// <returns>IAddonEventHandle used to remove the event.</returns>
internal IAddonEventHandle? AddEvent(Guid pluginId, IntPtr atkUnitBase, IntPtr atkResNode, AddonEventType eventType, IAddonEventManager.AddonEventHandler eventHandler)
{
if (this.pluginEventControllers.TryGetValue(pluginId, out var controller))
{
return controller.AddEvent(atkUnitBase, atkResNode, eventType, eventHandler);
}
else
{
Log.Verbose($"Unable to locate controller for {pluginId}. No event was added.");
}
return null;
}
/// <summary> /// <summary>
/// Registers an event handler for the specified addon, node, and type. /// Registers an event handler for the specified addon, node, and type.
/// </summary> /// </summary>
@ -260,10 +237,6 @@ internal class AddonEventManagerPluginScoped : IInternalDisposableService, IAddo
}).Wait(); }).Wait();
} }
/// <inheritdoc/>
public IAddonEventHandle? AddEvent(IntPtr atkUnitBase, IntPtr atkResNode, AddonEventType eventType, IAddonEventManager.AddonEventHandler eventHandler)
=> this.eventManagerService.AddEvent(this.plugin.EffectiveWorkingPluginId, atkUnitBase, atkResNode, eventType, eventHandler);
/// <inheritdoc/> /// <inheritdoc/>
public IAddonEventHandle? AddEvent(nint atkUnitBase, nint atkResNode, AddonEventType eventType, IAddonEventManager.AddonEventDelegate eventDelegate) public IAddonEventHandle? AddEvent(nint atkUnitBase, nint atkResNode, AddonEventType eventType, IAddonEventManager.AddonEventDelegate eventDelegate)
=> this.eventManagerService.AddEvent(this.plugin.EffectiveWorkingPluginId, atkUnitBase, atkResNode, eventType, eventDelegate); => this.eventManagerService.AddEvent(this.plugin.EffectiveWorkingPluginId, atkUnitBase, atkResNode, eventType, eventDelegate);

View file

@ -121,12 +121,6 @@ public enum AddonEventType : byte
/// </summary> /// </summary>
ListItemClick = 35, ListItemClick = 35,
/// <summary>
/// AtkComponentList Toggle.
/// </summary>
[Obsolete("Use ListItemClick")]
ListItemToggle = 35,
/// <summary> /// <summary>
/// AtkComponentList Double Click. /// AtkComponentList Double Click.
/// </summary> /// </summary>

View file

@ -30,49 +30,6 @@ internal unsafe class PluginEventController : IDisposable
private List<AddonEventEntry> Events { get; } = new(); private List<AddonEventEntry> Events { get; } = new();
/// <summary>
/// Adds a tracked event.
/// </summary>
/// <param name="atkUnitBase">The Parent addon for the event.</param>
/// <param name="atkResNode">The Node for the event.</param>
/// <param name="atkEventType">The Event Type.</param>
/// <param name="handler">The delegate to call when invoking this event.</param>
/// <returns>IAddonEventHandle used to remove the event.</returns>
[Obsolete("Use AddEvent that uses AddonEventDelegate instead of AddonEventHandler")]
public IAddonEventHandle AddEvent(nint atkUnitBase, nint atkResNode, AddonEventType atkEventType, IAddonEventManager.AddonEventHandler handler)
{
var node = (AtkResNode*)atkResNode;
var addon = (AtkUnitBase*)atkUnitBase;
var eventType = (AtkEventType)atkEventType;
var eventId = this.GetNextParamKey();
var eventGuid = Guid.NewGuid();
var eventHandle = new AddonEventHandle
{
AddonName = addon->NameString,
ParamKey = eventId,
EventType = atkEventType,
EventGuid = eventGuid,
};
var eventEntry = new AddonEventEntry
{
Addon = atkUnitBase,
Handler = handler,
Delegate = null,
Node = atkResNode,
EventType = atkEventType,
ParamKey = eventId,
Handle = eventHandle,
};
Log.Verbose($"Adding Event. {eventEntry.LogString}");
this.EventListener.RegisterEvent(addon, node, eventType, eventId);
this.Events.Add(eventEntry);
return eventHandle;
}
/// <summary> /// <summary>
/// Adds a tracked event. /// Adds a tracked event.
/// </summary> /// </summary>
@ -101,7 +58,6 @@ internal unsafe class PluginEventController : IDisposable
{ {
Addon = atkUnitBase, Addon = atkUnitBase,
Delegate = eventDelegate, Delegate = eventDelegate,
Handler = null,
Node = atkResNode, Node = atkResNode,
EventType = atkEventType, EventType = atkEventType,
ParamKey = eventId, ParamKey = eventId,
@ -231,7 +187,6 @@ internal unsafe class PluginEventController : IDisposable
this.EventListener.UnregisterEvent(atkResNode, eventType, eventEntry.ParamKey); this.EventListener.UnregisterEvent(atkResNode, eventType, eventEntry.ParamKey);
} }
[Api13ToDo("Remove invoke from eventInfo.Handler, and remove nullability from eventInfo.Delegate?.Invoke")]
private void PluginEventListHandler(AtkEventListener* self, AtkEventType eventType, uint eventParam, AtkEvent* eventPtr, AtkEventData* eventDataPtr) private void PluginEventListHandler(AtkEventListener* self, AtkEventType eventType, uint eventParam, AtkEvent* eventPtr, AtkEventData* eventDataPtr)
{ {
try try
@ -239,10 +194,7 @@ internal unsafe class PluginEventController : IDisposable
if (eventPtr is null) return; if (eventPtr is null) return;
if (this.Events.FirstOrDefault(handler => handler.ParamKey == eventParam) is not { } eventInfo) return; if (this.Events.FirstOrDefault(handler => handler.ParamKey == eventParam) is not { } eventInfo) return;
// We stored the AtkUnitBase* in EventData->Node, and EventData->Target contains the node that triggered the event. eventInfo.Delegate.Invoke((AddonEventType)eventType, new AddonEventData
eventInfo.Handler?.Invoke((AddonEventType)eventType, (nint)eventPtr->Node, (nint)eventPtr->Target);
eventInfo.Delegate?.Invoke((AddonEventType)eventType, new AddonEventData
{ {
AddonPointer = (nint)eventPtr->Node, AddonPointer = (nint)eventPtr->Node,
NodeTargetPointer = (nint)eventPtr->Target, NodeTargetPointer = (nint)eventPtr->Target,

View file

@ -188,12 +188,6 @@ public enum ConditionFlag
/// </summary> /// </summary>
ExecutingCraftingAction = 40, ExecutingCraftingAction = 40,
/// <summary>
/// Unable to execute command while crafting.
/// </summary>
[Obsolete("Renamed to ExecutingCraftingAction.")]
Crafting40 = 40,
/// <summary> /// <summary>
/// Unable to execute command while preparing to craft. /// Unable to execute command while preparing to craft.
/// </summary> /// </summary>
@ -205,12 +199,6 @@ public enum ConditionFlag
/// <remarks> Includes fishing. </remarks> /// <remarks> Includes fishing. </remarks>
ExecutingGatheringAction = 42, ExecutingGatheringAction = 42,
/// <summary>
/// Unable to execute command while gathering.
/// </summary>
[Obsolete("Renamed to ExecutingGatheringAction.")]
Gathering42 = 42,
/// <summary> /// <summary>
/// Unable to execute command while fishing. /// Unable to execute command while fishing.
/// </summary> /// </summary>
@ -235,12 +223,6 @@ public enum ConditionFlag
/// </summary> /// </summary>
Jumping = 48, Jumping = 48,
/// <summary>
/// Unable to execute command while auto-run is active.
/// </summary>
[Obsolete("To avoid confusion, renamed to UsingChocoboTaxi.")]
AutorunActive = 49,
/// <summary> /// <summary>
/// Unable to execute command while auto-run is active. /// Unable to execute command while auto-run is active.
/// </summary> /// </summary>
@ -282,12 +264,6 @@ public enum ConditionFlag
/// </summary> /// </summary>
BoundByDuty56 = 56, BoundByDuty56 = 56,
/// <summary>
/// Unable to execute command at this time.
/// </summary>
[Obsolete("Renamed to MountOrOrnamentTransition.")]
Unknown57 = 57,
/// <summary> /// <summary>
/// Unable to execute command at this time. /// Unable to execute command at this time.
/// </summary> /// </summary>
@ -461,12 +437,6 @@ public enum ConditionFlag
/// </summary> /// </summary>
RolePlaying = 90, RolePlaying = 90,
/// <summary>
/// Unable to execute command while bound by duty.
/// </summary>
[Obsolete("Use InDutyQueue")]
BoundToDuty97 = 91,
/// <summary> /// <summary>
/// Unable to execute command while bound by duty. /// Unable to execute command while bound by duty.
/// Specifically triggered when you are in a queue for a duty but not inside a duty. /// Specifically triggered when you are in a queue for a duty but not inside a duty.
@ -483,12 +453,6 @@ public enum ConditionFlag
/// </summary> /// </summary>
WaitingToVisitOtherWorld = 93, WaitingToVisitOtherWorld = 93,
/// <summary>
/// Unable to execute command while using a parasol.
/// </summary>
[Obsolete("Renamed to UsingFashionAccessory.")]
UsingParasol = 94,
/// <summary> /// <summary>
/// Unable to execute command while using a fashion accessory. /// Unable to execute command while using a fashion accessory.
/// </summary> /// </summary>

View file

@ -3,7 +3,6 @@ using System.Numerics;
using Dalamud.Data; using Dalamud.Data;
using Dalamud.Game.Text.SeStringHandling; using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Memory; using Dalamud.Memory;
using Dalamud.Utility;
using Lumina.Excel; using Lumina.Excel;
@ -69,12 +68,6 @@ public interface IFate : IEquatable<IFate>
/// </summary> /// </summary>
byte Progress { get; } byte Progress { get; }
/// <summary>
/// Gets a value indicating whether this <see cref="Fate"/> has a EXP bonus.
/// </summary>
[Obsolete($"Use {nameof(HasBonus)} instead")]
bool HasExpBonus { get; }
/// <summary> /// <summary>
/// Gets a value indicating whether this <see cref="Fate"/> has a bonus. /// Gets a value indicating whether this <see cref="Fate"/> has a bonus.
/// </summary> /// </summary>
@ -222,10 +215,6 @@ internal unsafe partial class Fate : IFate
/// <inheritdoc/> /// <inheritdoc/>
public byte Progress => this.Struct->Progress; public byte Progress => this.Struct->Progress;
/// <inheritdoc/>
[Api13ToDo("Remove")]
public bool HasExpBonus => this.HasBonus;
/// <inheritdoc/> /// <inheritdoc/>
public bool HasBonus => this.Struct->IsBonus; public bool HasBonus => this.Struct->IsBonus;

View file

@ -3,7 +3,6 @@ using Dalamud.Utility;
using Lumina.Extensions; using Lumina.Extensions;
using ItemKind = Dalamud.Game.Text.SeStringHandling.Payloads.ItemPayload.ItemKind;
using LSheets = Lumina.Excel.Sheets; using LSheets = Lumina.Excel.Sheets;
namespace Dalamud.Game.Text.Evaluator.Internal; namespace Dalamud.Game.Text.Evaluator.Internal;

View file

@ -72,33 +72,6 @@ public class ItemPayload : Payload
{ {
} }
/// <summary>
/// Kinds of items that can be fetched from this payload.
/// </summary>
[Api13ToDo("Move this out of ItemPayload. It's used in other classes too.")]
public enum ItemKind : uint
{
/// <summary>
/// Normal items.
/// </summary>
Normal,
/// <summary>
/// Collectible Items.
/// </summary>
Collectible = 500_000,
/// <summary>
/// High-Quality items.
/// </summary>
Hq = 1_000_000,
/// <summary>
/// Event/Key items.
/// </summary>
EventItem = 2_000_000,
}
/// <inheritdoc/> /// <inheritdoc/>
public override PayloadType Type => PayloadType.Item; public override PayloadType Type => PayloadType.Item;

View file

@ -181,7 +181,7 @@ public class SeString
/// <param name="displayNameOverride">An optional name override to display, instead of the actual item name.</param> /// <param name="displayNameOverride">An optional name override to display, instead of the actual item name.</param>
/// <returns>An SeString containing all the payloads necessary to display an item link in the chat log.</returns> /// <returns>An SeString containing all the payloads necessary to display an item link in the chat log.</returns>
public static SeString CreateItemLink(uint itemId, bool isHq, string? displayNameOverride = null) => public static SeString CreateItemLink(uint itemId, bool isHq, string? displayNameOverride = null) =>
CreateItemLink(itemId, isHq ? ItemPayload.ItemKind.Hq : ItemPayload.ItemKind.Normal, displayNameOverride); CreateItemLink(itemId, isHq ? ItemKind.Hq : ItemKind.Normal, displayNameOverride);
/// <summary> /// <summary>
/// Creates an SeString representing an entire Payload chain that can be used to link an item in the chat log. /// Creates an SeString representing an entire Payload chain that can be used to link an item in the chat log.
@ -190,7 +190,7 @@ public class SeString
/// <param name="kind">The kind of item to link.</param> /// <param name="kind">The kind of item to link.</param>
/// <param name="displayNameOverride">An optional name override to display, instead of the actual item name.</param> /// <param name="displayNameOverride">An optional name override to display, instead of the actual item name.</param>
/// <returns>An SeString containing all the payloads necessary to display an item link in the chat log.</returns> /// <returns>An SeString containing all the payloads necessary to display an item link in the chat log.</returns>
public static SeString CreateItemLink(uint itemId, ItemPayload.ItemKind kind = ItemPayload.ItemKind.Normal, string? displayNameOverride = null) public static SeString CreateItemLink(uint itemId, ItemKind kind = ItemKind.Normal, string? displayNameOverride = null)
{ {
var clientState = Service<ClientState.ClientState>.Get(); var clientState = Service<ClientState.ClientState>.Get();
var seStringEvaluator = Service<SeStringEvaluator>.Get(); var seStringEvaluator = Service<SeStringEvaluator>.Get();

View file

@ -1,6 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using Dalamud.Game.Text.SeStringHandling.Payloads; using Dalamud.Game.Text.SeStringHandling.Payloads;
using Dalamud.Utility;
namespace Dalamud.Game.Text.SeStringHandling; namespace Dalamud.Game.Text.SeStringHandling;
@ -126,7 +127,7 @@ public class SeStringBuilder
/// <param name="kind">Kind of item to encode.</param> /// <param name="kind">Kind of item to encode.</param>
/// <param name="itemNameOverride">Override for the item's name.</param> /// <param name="itemNameOverride">Override for the item's name.</param>
/// <returns>The current builder.</returns> /// <returns>The current builder.</returns>
public SeStringBuilder AddItemLink(uint itemId, ItemPayload.ItemKind kind = ItemPayload.ItemKind.Normal, string? itemNameOverride = null) => public SeStringBuilder AddItemLink(uint itemId, ItemKind kind = ItemKind.Normal, string? itemNameOverride = null) =>
this.Append(SeString.CreateItemLink(itemId, kind, itemNameOverride)); this.Append(SeString.CreateItemLink(itemId, kind, itemNameOverride));
/// <summary> /// <summary>

View file

@ -1,6 +1,6 @@
using Dalamud.Game.Gui; using Dalamud.Game.Gui;
using Dalamud.Game.Text.SeStringHandling; using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Game.Text.SeStringHandling.Payloads; using Dalamud.Utility;
using ImGuiNET; using ImGuiNET;
@ -59,7 +59,7 @@ internal class ItemPayloadSelfTestStep : ISelfTestStep
this.currentSubStep++; this.currentSubStep++;
break; break;
case SubStep.PrintHqItem: case SubStep.PrintHqItem:
toPrint = SeString.CreateItemLink(hqItemId, ItemPayload.ItemKind.Hq); toPrint = SeString.CreateItemLink(hqItemId, ItemKind.Hq);
this.currentSubStep++; this.currentSubStep++;
break; break;
case SubStep.HoverHqItem: case SubStep.HoverHqItem:
@ -69,7 +69,7 @@ internal class ItemPayloadSelfTestStep : ISelfTestStep
this.currentSubStep++; this.currentSubStep++;
break; break;
case SubStep.PrintCollectable: case SubStep.PrintCollectable:
toPrint = SeString.CreateItemLink(collectableItemId, ItemPayload.ItemKind.Collectible); toPrint = SeString.CreateItemLink(collectableItemId, ItemKind.Collectible);
this.currentSubStep++; this.currentSubStep++;
break; break;
case SubStep.HoverCollectable: case SubStep.HoverCollectable:
@ -79,7 +79,7 @@ internal class ItemPayloadSelfTestStep : ISelfTestStep
this.currentSubStep++; this.currentSubStep++;
break; break;
case SubStep.PrintEventItem: case SubStep.PrintEventItem:
toPrint = SeString.CreateItemLink(eventItemId, ItemPayload.ItemKind.EventItem); toPrint = SeString.CreateItemLink(eventItemId, ItemKind.EventItem);
this.currentSubStep++; this.currentSubStep++;
break; break;
case SubStep.HoverEventItem: case SubStep.HoverEventItem:

View file

@ -1,4 +1,4 @@
using System.Buffers; using System.Buffers;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Immutable; using System.Collections.Immutable;
using System.Linq; using System.Linq;
@ -120,19 +120,11 @@ internal sealed partial class FontAtlasFactory
public IFontSpec DefaultFontSpec => public IFontSpec DefaultFontSpec =>
this.DefaultFontSpecOverride this.DefaultFontSpecOverride
?? Service<DalamudConfiguration>.Get().DefaultFontSpec ?? Service<DalamudConfiguration>.Get().DefaultFontSpec
#pragma warning disable CS0618 // Type or member is obsolete ?? new SingleFontSpec()
?? (Service<DalamudConfiguration>.Get().UseAxisFontsFromGame {
#pragma warning restore CS0618 // Type or member is obsolete FontId = new GameFontAndFamilyId(GameFontFamily.Axis),
? new() SizePx = InterfaceManager.DefaultFontSizePx,
{ };
FontId = new GameFontAndFamilyId(GameFontFamily.Axis),
SizePx = InterfaceManager.DefaultFontSizePx,
}
: new SingleFontSpec
{
FontId = new DalamudAssetFontAndFamilyId(DalamudAsset.NotoSansJpMedium),
SizePx = InterfaceManager.DefaultFontSizePx + 1,
});
/// <summary> /// <summary>
/// Gets the service instance of <see cref="Framework"/>. /// Gets the service instance of <see cref="Framework"/>.

View file

@ -8,15 +8,6 @@ namespace Dalamud.Plugin.Services;
/// </summary> /// </summary>
public interface IAddonEventManager public interface IAddonEventManager
{ {
/// <summary>
/// Delegate to be called when an event is received.
/// </summary>
/// <param name="atkEventType">Event type for this event handler.</param>
/// <param name="atkUnitBase">The parent addon for this event handler.</param>
/// <param name="atkResNode">The specific node that will trigger this event handler.</param>
[Obsolete("Use AddonEventDelegate instead")]
public delegate void AddonEventHandler(AddonEventType atkEventType, nint atkUnitBase, nint atkResNode);
/// <summary> /// <summary>
/// Delegate to be called when an event is received. /// Delegate to be called when an event is received.
/// </summary> /// </summary>
@ -24,17 +15,6 @@ public interface IAddonEventManager
/// <param name="data">The event data object for use in handling this event.</param> /// <param name="data">The event data object for use in handling this event.</param>
public delegate void AddonEventDelegate(AddonEventType atkEventType, AddonEventData data); public delegate void AddonEventDelegate(AddonEventType atkEventType, AddonEventData data);
/// <summary>
/// Registers an event handler for the specified addon, node, and type.
/// </summary>
/// <param name="atkUnitBase">The parent addon for this event.</param>
/// <param name="atkResNode">The node that will trigger this event.</param>
/// <param name="eventType">The event type for this event.</param>
/// <param name="eventHandler">The handler to call when event is triggered.</param>
/// <returns>IAddonEventHandle used to remove the event. Null if no event was added.</returns>
[Obsolete("Use AddEvent with AddonEventDelegate instead of AddonEventHandler")]
IAddonEventHandle? AddEvent(nint atkUnitBase, nint atkResNode, AddonEventType eventType, AddonEventHandler eventHandler);
/// <summary> /// <summary>
/// Registers an event handler for the specified addon, node, and type. /// Registers an event handler for the specified addon, node, and type.
/// </summary> /// </summary>

View file

@ -7,10 +7,34 @@ using Lumina.Excel.Sheets;
using Lumina.Text; using Lumina.Text;
using Lumina.Text.ReadOnly; using Lumina.Text.ReadOnly;
using static Dalamud.Game.Text.SeStringHandling.Payloads.ItemPayload;
namespace Dalamud.Utility; namespace Dalamud.Utility;
/// <summary>
/// Kinds of items that can be fetched from this payload.
/// </summary>
public enum ItemKind : uint
{
/// <summary>
/// Normal items.
/// </summary>
Normal,
/// <summary>
/// Collectible Items.
/// </summary>
Collectible = 500_000,
/// <summary>
/// High-Quality items.
/// </summary>
Hq = 1_000_000,
/// <summary>
/// Event/Key items.
/// </summary>
EventItem = 2_000_000,
}
/// <summary> /// <summary>
/// Utilities related to Items. /// Utilities related to Items.
/// </summary> /// </summary>

View file

@ -605,37 +605,6 @@ public static class Util
NativeFunctions.FlashWindowEx(ref flashInfo); NativeFunctions.FlashWindowEx(ref flashInfo);
} }
/// <summary>
/// Overwrite text in a file by first writing it to a temporary file, and then
/// moving that file to the path specified.
/// </summary>
/// <param name="path">The path of the file to write to.</param>
/// <param name="text">The text to write.</param>
[Api13ToDo("Remove.")]
[Obsolete("Replaced with FilesystemUtil.WriteAllTextSafe()")]
public static void WriteAllTextSafe(string path, string text) => FilesystemUtil.WriteAllTextSafe(path, text);
/// <summary>
/// Overwrite text in a file by first writing it to a temporary file, and then
/// moving that file to the path specified.
/// </summary>
/// <param name="path">The path of the file to write to.</param>
/// <param name="text">The text to write.</param>
/// <param name="encoding">Encoding to use.</param>
[Api13ToDo("Remove.")]
[Obsolete("Replaced with FilesystemUtil.WriteAllTextSafe()")]
public static void WriteAllTextSafe(string path, string text, Encoding encoding) => FilesystemUtil.WriteAllTextSafe(path, text, encoding);
/// <summary>
/// Overwrite data in a file by first writing it to a temporary file, and then
/// moving that file to the path specified.
/// </summary>
/// <param name="path">The path of the file to write to.</param>
/// <param name="bytes">The data to write.</param>
[Api13ToDo("Remove.")]
[Obsolete("Replaced with FilesystemUtil.WriteAllBytesSafe()")]
public static void WriteAllBytesSafe(string path, byte[] bytes) => FilesystemUtil.WriteAllBytesSafe(path, bytes);
/// <summary>Gets a temporary file name, for use as the sourceFileName in /// <summary>Gets a temporary file name, for use as the sourceFileName in
/// <see cref="File.Replace(string,string,string?)"/>.</summary> /// <see cref="File.Replace(string,string,string?)"/>.</summary>
/// <param name="targetFile">The target file.</param> /// <param name="targetFile">The target file.</param>