From a57af7413a2800a288a210f5f456cda7d188016f Mon Sep 17 00:00:00 2001 From: Anna Clemens Date: Fri, 30 Apr 2021 15:12:20 -0400 Subject: [PATCH] docs(context): add missing documentation --- .../Functions/ContextMenu/BaseContextMenuArgs.cs | 3 +++ XivCommon/Functions/ContextMenu/ContextMenu.cs | 11 +++++++++++ .../Functions/ContextMenu/CustomContextMenuItem.cs | 2 +- .../Inventory/BaseInventoryContextMenuArgs.cs | 12 ++++++++++++ .../Inventory/InventoryContextMenuItem.cs | 8 ++++++++ .../InventoryContextMenuItemSelectedArgs.cs | 3 +++ .../Inventory/InventoryContextMenuOpenArgs.cs | 3 +++ .../ContextMenu/NormalCustomContextMenuItem.cs | 11 +++++++++++ 8 files changed, 52 insertions(+), 1 deletion(-) diff --git a/XivCommon/Functions/ContextMenu/BaseContextMenuArgs.cs b/XivCommon/Functions/ContextMenu/BaseContextMenuArgs.cs index 35bc539..31ef8e5 100755 --- a/XivCommon/Functions/ContextMenu/BaseContextMenuArgs.cs +++ b/XivCommon/Functions/ContextMenu/BaseContextMenuArgs.cs @@ -1,6 +1,9 @@ using System; namespace XivCommon.Functions.ContextMenu { + /// + /// The base class for context menu arguments + /// public abstract class BaseContextMenuArgs { /// /// Pointer to the context menu addon. diff --git a/XivCommon/Functions/ContextMenu/ContextMenu.cs b/XivCommon/Functions/ContextMenu/ContextMenu.cs index 3c00357..28de447 100755 --- a/XivCommon/Functions/ContextMenu/ContextMenu.cs +++ b/XivCommon/Functions/ContextMenu/ContextMenu.cs @@ -78,8 +78,19 @@ namespace XivCommon.Functions.ContextMenu { /// public event ContextMenuOpenEventDelegate? OpenContextMenu; + /// + /// The delegate for inventory context menu events. + /// public delegate void InventoryContextMenuOpenEventDelegate(InventoryContextMenuOpenArgs args); + /// + /// + /// The event that is fired when an inventory context menu is being prepared for opening. + /// + /// + /// Requires the hook to be enabled. + /// + /// public event InventoryContextMenuOpenEventDelegate? OpenInventoryContextMenu; /// diff --git a/XivCommon/Functions/ContextMenu/CustomContextMenuItem.cs b/XivCommon/Functions/ContextMenu/CustomContextMenuItem.cs index 9170015..b5fbf8c 100755 --- a/XivCommon/Functions/ContextMenu/CustomContextMenuItem.cs +++ b/XivCommon/Functions/ContextMenu/CustomContextMenuItem.cs @@ -36,7 +36,7 @@ namespace XivCommon.Functions.ContextMenu { /// /// the English name of the item, copied to other languages /// the action to perform on click - public CustomContextMenuItem(string name, T action) { + internal CustomContextMenuItem(string name, T action) { this.NameEnglish = name; this.NameJapanese = name; this.NameFrench = name; diff --git a/XivCommon/Functions/ContextMenu/Inventory/BaseInventoryContextMenuArgs.cs b/XivCommon/Functions/ContextMenu/Inventory/BaseInventoryContextMenuArgs.cs index 973b974..116b43d 100755 --- a/XivCommon/Functions/ContextMenu/Inventory/BaseInventoryContextMenuArgs.cs +++ b/XivCommon/Functions/ContextMenu/Inventory/BaseInventoryContextMenuArgs.cs @@ -1,6 +1,9 @@ using System; namespace XivCommon.Functions.ContextMenu.Inventory { + /// + /// The base class for inventory context menu arguments + /// public abstract class BaseInventoryContextMenuArgs { /// /// Pointer to the context menu addon. @@ -17,10 +20,19 @@ namespace XivCommon.Functions.ContextMenu.Inventory { /// public string? ParentAddonName { get; } + /// + /// The ID of the item this context menu is for. + /// public uint ItemId { get; } + /// + /// The amount of the item this context menu is for. + /// public uint ItemAmount { get; } + /// + /// If the item this context menu is for is high-quality. + /// public bool ItemHq { get; } internal BaseInventoryContextMenuArgs(IntPtr addon, IntPtr agent, string? parentAddonName, uint itemId, uint itemAmount, bool itemHq) { diff --git a/XivCommon/Functions/ContextMenu/Inventory/InventoryContextMenuItem.cs b/XivCommon/Functions/ContextMenu/Inventory/InventoryContextMenuItem.cs index 2280514..3d3514c 100755 --- a/XivCommon/Functions/ContextMenu/Inventory/InventoryContextMenuItem.cs +++ b/XivCommon/Functions/ContextMenu/Inventory/InventoryContextMenuItem.cs @@ -1,5 +1,13 @@ namespace XivCommon.Functions.ContextMenu.Inventory { + /// + /// A custom context menu item for inventory items. + /// public class InventoryContextMenuItem : CustomContextMenuItem { + /// + /// Create a new context menu item for inventory items. + /// + /// the English name of the item, copied to other languages + /// the action to perform on click public InventoryContextMenuItem(string name, ContextMenu.InventoryContextMenuItemSelectedDelegate action) : base(name, action) { } } diff --git a/XivCommon/Functions/ContextMenu/Inventory/InventoryContextMenuItemSelectedArgs.cs b/XivCommon/Functions/ContextMenu/Inventory/InventoryContextMenuItemSelectedArgs.cs index 327b76a..d42653b 100755 --- a/XivCommon/Functions/ContextMenu/Inventory/InventoryContextMenuItemSelectedArgs.cs +++ b/XivCommon/Functions/ContextMenu/Inventory/InventoryContextMenuItemSelectedArgs.cs @@ -1,6 +1,9 @@ using System; namespace XivCommon.Functions.ContextMenu.Inventory { + /// + /// The arguments for when an inventory context menu item is selected + /// public class InventoryContextMenuItemSelectedArgs : BaseInventoryContextMenuArgs { internal InventoryContextMenuItemSelectedArgs(IntPtr addon, IntPtr agent, string? parentAddonName, uint itemId, uint itemAmount, bool itemHq) : base(addon, agent, parentAddonName, itemId, itemAmount, itemHq) { } diff --git a/XivCommon/Functions/ContextMenu/Inventory/InventoryContextMenuOpenArgs.cs b/XivCommon/Functions/ContextMenu/Inventory/InventoryContextMenuOpenArgs.cs index a0c60ff..9c15020 100755 --- a/XivCommon/Functions/ContextMenu/Inventory/InventoryContextMenuOpenArgs.cs +++ b/XivCommon/Functions/ContextMenu/Inventory/InventoryContextMenuOpenArgs.cs @@ -2,6 +2,9 @@ using System.Collections.Generic; namespace XivCommon.Functions.ContextMenu.Inventory { + /// + /// The arguments for when an inventory context menu is opened + /// public class InventoryContextMenuOpenArgs : BaseInventoryContextMenuArgs { /// /// Context menu items in this menu. diff --git a/XivCommon/Functions/ContextMenu/NormalCustomContextMenuItem.cs b/XivCommon/Functions/ContextMenu/NormalCustomContextMenuItem.cs index 0e345fe..31bde81 100755 --- a/XivCommon/Functions/ContextMenu/NormalCustomContextMenuItem.cs +++ b/XivCommon/Functions/ContextMenu/NormalCustomContextMenuItem.cs @@ -1,5 +1,16 @@ namespace XivCommon.Functions.ContextMenu { + /// + /// A custom normal context menu item + /// public class NormalContextMenuItem : CustomContextMenuItem { + /// + /// Create a new custom context menu item. + /// + /// + /// Create a new context menu item for inventory items. + /// + /// the English name of the item, copied to other languages + /// the action to perform on click public NormalContextMenuItem(string name, ContextMenu.ContextMenuItemSelectedDelegate action) : base(name, action) { } }