diff --git a/Dalamud/Configuration/Internal/DalamudConfiguration.cs b/Dalamud/Configuration/Internal/DalamudConfiguration.cs index 8dafd897e..1943f4ba3 100644 --- a/Dalamud/Configuration/Internal/DalamudConfiguration.cs +++ b/Dalamud/Configuration/Internal/DalamudConfiguration.cs @@ -152,23 +152,11 @@ internal sealed class DalamudConfiguration : IInternalDisposableService /// public float GlobalUiScale { get; set; } = 1.0f; - /// - /// Gets or sets a value indicating whether to use AXIS fonts from the game. - /// - [Obsolete($"See {nameof(DefaultFontSpec)}")] - public bool UseAxisFontsFromGame { get; set; } = true; - /// /// Gets or sets the default font spec. /// public IFontSpec? DefaultFontSpec { get; set; } - /// - /// Gets or sets the gamma value to apply for Dalamud fonts. Do not use. - /// - [Obsolete("It happens that nobody touched this setting", true)] - public float FontGammaLevel { get; set; } = 1.4f; - /// Gets or sets the opacity of the IME state indicator. /// 0 will hide the state indicator. 1 will make the state indicator fully visible. Values outside the /// range will be clamped to [0, 1]. diff --git a/Dalamud/Game/Addon/Events/AddonEventEntry.cs b/Dalamud/Game/Addon/Events/AddonEventEntry.cs index 50b9c7ec4..30d0465dc 100644 --- a/Dalamud/Game/Addon/Events/AddonEventEntry.cs +++ b/Dalamud/Game/Addon/Events/AddonEventEntry.cs @@ -1,4 +1,4 @@ -using Dalamud.Plugin.Services; +using Dalamud.Plugin.Services; using Dalamud.Utility; using FFXIVClientStructs.FFXIV.Component.GUI; @@ -33,17 +33,10 @@ internal unsafe class AddonEventEntry /// public required nint Node { get; init; } - /// - /// Gets the handler that gets called when this event is triggered. - /// - [Obsolete("Use AddonEventDelegate Delegate instead")] - public IAddonEventManager.AddonEventHandler Handler { get; init; } - /// /// Gets the delegate that gets called when this event is triggered. /// - [Api13ToDo("Make this field required")] - public IAddonEventManager.AddonEventDelegate Delegate { get; init; } + public required IAddonEventManager.AddonEventDelegate Delegate { get; init; } /// /// Gets the unique id for this event. diff --git a/Dalamud/Game/Addon/Events/AddonEventManager.cs b/Dalamud/Game/Addon/Events/AddonEventManager.cs index 0990c1f5f..945197e2b 100644 --- a/Dalamud/Game/Addon/Events/AddonEventManager.cs +++ b/Dalamud/Game/Addon/Events/AddonEventManager.cs @@ -73,29 +73,6 @@ internal unsafe class AddonEventManager : IInternalDisposableService this.addonLifecycle.UnregisterListener(this.finalizeEventListener); } - /// - /// Registers an event handler for the specified addon, node, and type. - /// - /// Unique ID for this plugin. - /// The parent addon for this event. - /// The node that will trigger this event. - /// The event type for this event. - /// The handler to call when event is triggered. - /// IAddonEventHandle used to remove the event. - 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; - } - /// /// Registers an event handler for the specified addon, node, and type. /// @@ -260,10 +237,6 @@ internal class AddonEventManagerPluginScoped : IInternalDisposableService, IAddo }).Wait(); } - /// - public IAddonEventHandle? AddEvent(IntPtr atkUnitBase, IntPtr atkResNode, AddonEventType eventType, IAddonEventManager.AddonEventHandler eventHandler) - => this.eventManagerService.AddEvent(this.plugin.EffectiveWorkingPluginId, atkUnitBase, atkResNode, eventType, eventHandler); - /// public IAddonEventHandle? AddEvent(nint atkUnitBase, nint atkResNode, AddonEventType eventType, IAddonEventManager.AddonEventDelegate eventDelegate) => this.eventManagerService.AddEvent(this.plugin.EffectiveWorkingPluginId, atkUnitBase, atkResNode, eventType, eventDelegate); diff --git a/Dalamud/Game/Addon/Events/AddonEventType.cs b/Dalamud/Game/Addon/Events/AddonEventType.cs index cd04152ca..2c88c797b 100644 --- a/Dalamud/Game/Addon/Events/AddonEventType.cs +++ b/Dalamud/Game/Addon/Events/AddonEventType.cs @@ -121,12 +121,6 @@ public enum AddonEventType : byte /// ListItemClick = 35, - /// - /// AtkComponentList Toggle. - /// - [Obsolete("Use ListItemClick")] - ListItemToggle = 35, - /// /// AtkComponentList Double Click. /// diff --git a/Dalamud/Game/Addon/Events/PluginEventController.cs b/Dalamud/Game/Addon/Events/PluginEventController.cs index 62f218933..181169de0 100644 --- a/Dalamud/Game/Addon/Events/PluginEventController.cs +++ b/Dalamud/Game/Addon/Events/PluginEventController.cs @@ -30,49 +30,6 @@ internal unsafe class PluginEventController : IDisposable private List Events { get; } = new(); - /// - /// Adds a tracked event. - /// - /// The Parent addon for the event. - /// The Node for the event. - /// The Event Type. - /// The delegate to call when invoking this event. - /// IAddonEventHandle used to remove the event. - [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; - } - /// /// Adds a tracked event. /// @@ -101,7 +58,6 @@ internal unsafe class PluginEventController : IDisposable { Addon = atkUnitBase, Delegate = eventDelegate, - Handler = null, Node = atkResNode, EventType = atkEventType, ParamKey = eventId, @@ -231,7 +187,6 @@ internal unsafe class PluginEventController : IDisposable 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) { try @@ -239,10 +194,7 @@ internal unsafe class PluginEventController : IDisposable if (eventPtr is null) 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.Handler?.Invoke((AddonEventType)eventType, (nint)eventPtr->Node, (nint)eventPtr->Target); - - eventInfo.Delegate?.Invoke((AddonEventType)eventType, new AddonEventData + eventInfo.Delegate.Invoke((AddonEventType)eventType, new AddonEventData { AddonPointer = (nint)eventPtr->Node, NodeTargetPointer = (nint)eventPtr->Target, diff --git a/Dalamud/Game/ClientState/Conditions/ConditionFlag.cs b/Dalamud/Game/ClientState/Conditions/ConditionFlag.cs index ef6649d7d..df4620f93 100644 --- a/Dalamud/Game/ClientState/Conditions/ConditionFlag.cs +++ b/Dalamud/Game/ClientState/Conditions/ConditionFlag.cs @@ -188,12 +188,6 @@ public enum ConditionFlag /// ExecutingCraftingAction = 40, - /// - /// Unable to execute command while crafting. - /// - [Obsolete("Renamed to ExecutingCraftingAction.")] - Crafting40 = 40, - /// /// Unable to execute command while preparing to craft. /// @@ -205,12 +199,6 @@ public enum ConditionFlag /// Includes fishing. ExecutingGatheringAction = 42, - /// - /// Unable to execute command while gathering. - /// - [Obsolete("Renamed to ExecutingGatheringAction.")] - Gathering42 = 42, - /// /// Unable to execute command while fishing. /// @@ -235,12 +223,6 @@ public enum ConditionFlag /// Jumping = 48, - /// - /// Unable to execute command while auto-run is active. - /// - [Obsolete("To avoid confusion, renamed to UsingChocoboTaxi.")] - AutorunActive = 49, - /// /// Unable to execute command while auto-run is active. /// @@ -282,12 +264,6 @@ public enum ConditionFlag /// BoundByDuty56 = 56, - /// - /// Unable to execute command at this time. - /// - [Obsolete("Renamed to MountOrOrnamentTransition.")] - Unknown57 = 57, - /// /// Unable to execute command at this time. /// @@ -461,12 +437,6 @@ public enum ConditionFlag /// RolePlaying = 90, - /// - /// Unable to execute command while bound by duty. - /// - [Obsolete("Use InDutyQueue")] - BoundToDuty97 = 91, - /// /// Unable to execute command while bound by duty. /// Specifically triggered when you are in a queue for a duty but not inside a duty. @@ -483,12 +453,6 @@ public enum ConditionFlag /// WaitingToVisitOtherWorld = 93, - /// - /// Unable to execute command while using a parasol. - /// - [Obsolete("Renamed to UsingFashionAccessory.")] - UsingParasol = 94, - /// /// Unable to execute command while using a fashion accessory. /// diff --git a/Dalamud/Game/ClientState/Fates/Fate.cs b/Dalamud/Game/ClientState/Fates/Fate.cs index 2da2dde9d..504b690c3 100644 --- a/Dalamud/Game/ClientState/Fates/Fate.cs +++ b/Dalamud/Game/ClientState/Fates/Fate.cs @@ -3,7 +3,6 @@ using System.Numerics; using Dalamud.Data; using Dalamud.Game.Text.SeStringHandling; using Dalamud.Memory; -using Dalamud.Utility; using Lumina.Excel; @@ -69,12 +68,6 @@ public interface IFate : IEquatable /// byte Progress { get; } - /// - /// Gets a value indicating whether this has a EXP bonus. - /// - [Obsolete($"Use {nameof(HasBonus)} instead")] - bool HasExpBonus { get; } - /// /// Gets a value indicating whether this has a bonus. /// @@ -222,10 +215,6 @@ internal unsafe partial class Fate : IFate /// public byte Progress => this.Struct->Progress; - /// - [Api13ToDo("Remove")] - public bool HasExpBonus => this.HasBonus; - /// public bool HasBonus => this.Struct->IsBonus; diff --git a/Dalamud/Game/Text/Evaluator/Internal/SheetRedirectResolver.cs b/Dalamud/Game/Text/Evaluator/Internal/SheetRedirectResolver.cs index f851e7686..262e7ad21 100644 --- a/Dalamud/Game/Text/Evaluator/Internal/SheetRedirectResolver.cs +++ b/Dalamud/Game/Text/Evaluator/Internal/SheetRedirectResolver.cs @@ -3,7 +3,6 @@ using Dalamud.Utility; using Lumina.Extensions; -using ItemKind = Dalamud.Game.Text.SeStringHandling.Payloads.ItemPayload.ItemKind; using LSheets = Lumina.Excel.Sheets; namespace Dalamud.Game.Text.Evaluator.Internal; diff --git a/Dalamud/Game/Text/SeStringHandling/Payloads/ItemPayload.cs b/Dalamud/Game/Text/SeStringHandling/Payloads/ItemPayload.cs index 25cdf7f9f..0c1f75a1d 100644 --- a/Dalamud/Game/Text/SeStringHandling/Payloads/ItemPayload.cs +++ b/Dalamud/Game/Text/SeStringHandling/Payloads/ItemPayload.cs @@ -72,33 +72,6 @@ public class ItemPayload : Payload { } - /// - /// Kinds of items that can be fetched from this payload. - /// - [Api13ToDo("Move this out of ItemPayload. It's used in other classes too.")] - public enum ItemKind : uint - { - /// - /// Normal items. - /// - Normal, - - /// - /// Collectible Items. - /// - Collectible = 500_000, - - /// - /// High-Quality items. - /// - Hq = 1_000_000, - - /// - /// Event/Key items. - /// - EventItem = 2_000_000, - } - /// public override PayloadType Type => PayloadType.Item; diff --git a/Dalamud/Game/Text/SeStringHandling/SeString.cs b/Dalamud/Game/Text/SeStringHandling/SeString.cs index b7618305a..a30ad9bbe 100644 --- a/Dalamud/Game/Text/SeStringHandling/SeString.cs +++ b/Dalamud/Game/Text/SeStringHandling/SeString.cs @@ -181,7 +181,7 @@ public class SeString /// An optional name override to display, instead of the actual item name. /// An SeString containing all the payloads necessary to display an item link in the chat log. 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); /// /// 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 /// The kind of item to link. /// An optional name override to display, instead of the actual item name. /// An SeString containing all the payloads necessary to display an item link in the chat log. - 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.Get(); var seStringEvaluator = Service.Get(); diff --git a/Dalamud/Game/Text/SeStringHandling/SeStringBuilder.cs b/Dalamud/Game/Text/SeStringHandling/SeStringBuilder.cs index d5080e6e8..ae673e516 100644 --- a/Dalamud/Game/Text/SeStringHandling/SeStringBuilder.cs +++ b/Dalamud/Game/Text/SeStringHandling/SeStringBuilder.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using Dalamud.Game.Text.SeStringHandling.Payloads; +using Dalamud.Utility; namespace Dalamud.Game.Text.SeStringHandling; @@ -126,7 +127,7 @@ public class SeStringBuilder /// Kind of item to encode. /// Override for the item's name. /// The current builder. - 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)); /// diff --git a/Dalamud/Interface/Internal/Windows/SelfTest/Steps/ItemPayloadSelfTestStep.cs b/Dalamud/Interface/Internal/Windows/SelfTest/Steps/ItemPayloadSelfTestStep.cs index 0988413b0..02bb7f8f0 100644 --- a/Dalamud/Interface/Internal/Windows/SelfTest/Steps/ItemPayloadSelfTestStep.cs +++ b/Dalamud/Interface/Internal/Windows/SelfTest/Steps/ItemPayloadSelfTestStep.cs @@ -1,6 +1,6 @@ -using Dalamud.Game.Gui; +using Dalamud.Game.Gui; using Dalamud.Game.Text.SeStringHandling; -using Dalamud.Game.Text.SeStringHandling.Payloads; +using Dalamud.Utility; using ImGuiNET; @@ -59,7 +59,7 @@ internal class ItemPayloadSelfTestStep : ISelfTestStep this.currentSubStep++; break; case SubStep.PrintHqItem: - toPrint = SeString.CreateItemLink(hqItemId, ItemPayload.ItemKind.Hq); + toPrint = SeString.CreateItemLink(hqItemId, ItemKind.Hq); this.currentSubStep++; break; case SubStep.HoverHqItem: @@ -69,7 +69,7 @@ internal class ItemPayloadSelfTestStep : ISelfTestStep this.currentSubStep++; break; case SubStep.PrintCollectable: - toPrint = SeString.CreateItemLink(collectableItemId, ItemPayload.ItemKind.Collectible); + toPrint = SeString.CreateItemLink(collectableItemId, ItemKind.Collectible); this.currentSubStep++; break; case SubStep.HoverCollectable: @@ -79,7 +79,7 @@ internal class ItemPayloadSelfTestStep : ISelfTestStep this.currentSubStep++; break; case SubStep.PrintEventItem: - toPrint = SeString.CreateItemLink(eventItemId, ItemPayload.ItemKind.EventItem); + toPrint = SeString.CreateItemLink(eventItemId, ItemKind.EventItem); this.currentSubStep++; break; case SubStep.HoverEventItem: diff --git a/Dalamud/Interface/ManagedFontAtlas/Internals/FontAtlasFactory.cs b/Dalamud/Interface/ManagedFontAtlas/Internals/FontAtlasFactory.cs index c084d88e2..9d7dc006a 100644 --- a/Dalamud/Interface/ManagedFontAtlas/Internals/FontAtlasFactory.cs +++ b/Dalamud/Interface/ManagedFontAtlas/Internals/FontAtlasFactory.cs @@ -1,4 +1,4 @@ -using System.Buffers; +using System.Buffers; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; @@ -120,19 +120,11 @@ internal sealed partial class FontAtlasFactory public IFontSpec DefaultFontSpec => this.DefaultFontSpecOverride ?? Service.Get().DefaultFontSpec -#pragma warning disable CS0618 // Type or member is obsolete - ?? (Service.Get().UseAxisFontsFromGame -#pragma warning restore CS0618 // Type or member is obsolete - ? new() - { - FontId = new GameFontAndFamilyId(GameFontFamily.Axis), - SizePx = InterfaceManager.DefaultFontSizePx, - } - : new SingleFontSpec - { - FontId = new DalamudAssetFontAndFamilyId(DalamudAsset.NotoSansJpMedium), - SizePx = InterfaceManager.DefaultFontSizePx + 1, - }); + ?? new SingleFontSpec() + { + FontId = new GameFontAndFamilyId(GameFontFamily.Axis), + SizePx = InterfaceManager.DefaultFontSizePx, + }; /// /// Gets the service instance of . diff --git a/Dalamud/Plugin/Services/IAddonEventManager.cs b/Dalamud/Plugin/Services/IAddonEventManager.cs index ba8ec59e5..c6499e4e2 100644 --- a/Dalamud/Plugin/Services/IAddonEventManager.cs +++ b/Dalamud/Plugin/Services/IAddonEventManager.cs @@ -8,15 +8,6 @@ namespace Dalamud.Plugin.Services; /// public interface IAddonEventManager { - /// - /// Delegate to be called when an event is received. - /// - /// Event type for this event handler. - /// The parent addon for this event handler. - /// The specific node that will trigger this event handler. - [Obsolete("Use AddonEventDelegate instead")] - public delegate void AddonEventHandler(AddonEventType atkEventType, nint atkUnitBase, nint atkResNode); - /// /// Delegate to be called when an event is received. /// @@ -24,17 +15,6 @@ public interface IAddonEventManager /// The event data object for use in handling this event. public delegate void AddonEventDelegate(AddonEventType atkEventType, AddonEventData data); - /// - /// Registers an event handler for the specified addon, node, and type. - /// - /// The parent addon for this event. - /// The node that will trigger this event. - /// The event type for this event. - /// The handler to call when event is triggered. - /// IAddonEventHandle used to remove the event. Null if no event was added. - [Obsolete("Use AddEvent with AddonEventDelegate instead of AddonEventHandler")] - IAddonEventHandle? AddEvent(nint atkUnitBase, nint atkResNode, AddonEventType eventType, AddonEventHandler eventHandler); - /// /// Registers an event handler for the specified addon, node, and type. /// diff --git a/Dalamud/Utility/ItemUtil.cs b/Dalamud/Utility/ItemUtil.cs index 0b37a6abb..5f718bcee 100644 --- a/Dalamud/Utility/ItemUtil.cs +++ b/Dalamud/Utility/ItemUtil.cs @@ -7,10 +7,34 @@ using Lumina.Excel.Sheets; using Lumina.Text; using Lumina.Text.ReadOnly; -using static Dalamud.Game.Text.SeStringHandling.Payloads.ItemPayload; - namespace Dalamud.Utility; +/// +/// Kinds of items that can be fetched from this payload. +/// +public enum ItemKind : uint +{ + /// + /// Normal items. + /// + Normal, + + /// + /// Collectible Items. + /// + Collectible = 500_000, + + /// + /// High-Quality items. + /// + Hq = 1_000_000, + + /// + /// Event/Key items. + /// + EventItem = 2_000_000, +} + /// /// Utilities related to Items. /// diff --git a/Dalamud/Utility/Util.cs b/Dalamud/Utility/Util.cs index 1d96523be..2e6ed7684 100644 --- a/Dalamud/Utility/Util.cs +++ b/Dalamud/Utility/Util.cs @@ -605,37 +605,6 @@ public static class Util NativeFunctions.FlashWindowEx(ref flashInfo); } - /// - /// Overwrite text in a file by first writing it to a temporary file, and then - /// moving that file to the path specified. - /// - /// The path of the file to write to. - /// The text to write. - [Api13ToDo("Remove.")] - [Obsolete("Replaced with FilesystemUtil.WriteAllTextSafe()")] - public static void WriteAllTextSafe(string path, string text) => FilesystemUtil.WriteAllTextSafe(path, text); - - /// - /// Overwrite text in a file by first writing it to a temporary file, and then - /// moving that file to the path specified. - /// - /// The path of the file to write to. - /// The text to write. - /// Encoding to use. - [Api13ToDo("Remove.")] - [Obsolete("Replaced with FilesystemUtil.WriteAllTextSafe()")] - public static void WriteAllTextSafe(string path, string text, Encoding encoding) => FilesystemUtil.WriteAllTextSafe(path, text, encoding); - - /// - /// Overwrite data in a file by first writing it to a temporary file, and then - /// moving that file to the path specified. - /// - /// The path of the file to write to. - /// The data to write. - [Api13ToDo("Remove.")] - [Obsolete("Replaced with FilesystemUtil.WriteAllBytesSafe()")] - public static void WriteAllBytesSafe(string path, byte[] bytes) => FilesystemUtil.WriteAllBytesSafe(path, bytes); - /// Gets a temporary file name, for use as the sourceFileName in /// . /// The target file.