diff --git a/XivCommon/Functions/BattleTalk.cs b/XivCommon/Functions/BattleTalk.cs index 89c565f..879c10d 100755 --- a/XivCommon/Functions/BattleTalk.cs +++ b/XivCommon/Functions/BattleTalk.cs @@ -6,11 +6,17 @@ using Dalamud.Hooking; using Dalamud.Plugin; namespace XivCommon.Functions { + /// + /// The class containing BattleTalk functionality + /// public class BattleTalk : IDisposable { private GameFunctions Functions { get; } private SeStringManager SeStringManager { get; } private bool HookEnabled { get; } + /// + /// The delegate for BattleTalk events. + /// public delegate void BattleTalkEventDelegate(ref SeString sender, ref SeString message, ref BattleTalkOptions options, ref bool isHandled); /// @@ -44,6 +50,7 @@ namespace XivCommon.Functions { this.AddBattleTalkHook.Enable(); } + /// public void Dispose() { this.AddBattleTalkHook?.Dispose(); } @@ -115,6 +122,9 @@ namespace XivCommon.Functions { } } + /// + /// Options for displaying a BattleTalk window. + /// public class BattleTalkOptions { /// /// Duration to display the window, in seconds. @@ -127,6 +137,9 @@ namespace XivCommon.Functions { public BattleTalkStyle Style { get; set; } = BattleTalkStyle.Normal; } + /// + /// BattleTalk window styles. + /// public enum BattleTalkStyle : byte { /// /// A normal battle talk window with a white background. diff --git a/XivCommon/Functions/Chat.cs b/XivCommon/Functions/Chat.cs index 8d511f7..b15dc4d 100755 --- a/XivCommon/Functions/Chat.cs +++ b/XivCommon/Functions/Chat.cs @@ -5,6 +5,9 @@ using System.Text; using Dalamud.Game; namespace XivCommon.Functions { + /// + /// A class containing chat functionality + /// public class Chat { private GameFunctions Functions { get; } diff --git a/XivCommon/Functions/PartyFinder.cs b/XivCommon/Functions/PartyFinder.cs index 8a09316..4f579c9 100755 --- a/XivCommon/Functions/PartyFinder.cs +++ b/XivCommon/Functions/PartyFinder.cs @@ -4,6 +4,9 @@ using Dalamud.Game; using Dalamud.Hooking; namespace XivCommon.Functions { + /// + /// A class containing Party Finder functionality + /// public class PartyFinder : IDisposable { private delegate byte RequestPartyFinderListingsDelegate(IntPtr agent, byte categoryIdx); @@ -28,6 +31,7 @@ namespace XivCommon.Functions { this.RequestPfListingsHook.Enable(); } + /// public void Dispose() { this.RequestPfListingsHook?.Dispose(); } diff --git a/XivCommon/GameFunctions.cs b/XivCommon/GameFunctions.cs index 96b2300..962a12c 100755 --- a/XivCommon/GameFunctions.cs +++ b/XivCommon/GameFunctions.cs @@ -5,6 +5,9 @@ using Dalamud.Game.Text.SeStringHandling; using XivCommon.Functions; namespace XivCommon { + /// + /// A class containing game functions + /// public class GameFunctions : IDisposable { private IntPtr UiModulePtr { get; } @@ -12,8 +15,19 @@ namespace XivCommon { private GetUiModuleDelegate InternalGetUiModule { get; } + /// + /// Chat functions + /// public Chat Chat { get; } + + /// + /// Party Finder functions + /// public PartyFinder PartyFinder { get; } + + /// + /// BattleTalk functions and events + /// public BattleTalk BattleTalk { get; } internal GameFunctions(Hooks hooks, SigScanner scanner, SeStringManager seStringManager) { @@ -27,11 +41,16 @@ namespace XivCommon { this.BattleTalk = new BattleTalk(this, scanner, seStringManager, hooks.HasFlag(Hooks.BattleTalk)); } + /// public void Dispose() { this.BattleTalk.Dispose(); this.PartyFinder.Dispose(); } + /// + /// Gets the pointer to the UI module + /// + /// Pointer public IntPtr GetUiModule() { return this.InternalGetUiModule(Marshal.ReadIntPtr(this.UiModulePtr)); } diff --git a/XivCommon/Hooks.cs b/XivCommon/Hooks.cs index 18d7cb9..8711b01 100755 --- a/XivCommon/Hooks.cs +++ b/XivCommon/Hooks.cs @@ -1,6 +1,9 @@ using System; namespace XivCommon { + /// + /// Flags for which hooks to use + /// [Flags] public enum Hooks { /// diff --git a/XivCommon/XivCommonBase.cs b/XivCommon/XivCommonBase.cs index ba0721b..2353b12 100755 --- a/XivCommon/XivCommonBase.cs +++ b/XivCommon/XivCommonBase.cs @@ -2,13 +2,30 @@ using Dalamud.Plugin; namespace XivCommon { + /// + /// A base class for accessing XivCommon functionality. + /// public class XivCommonBase : IDisposable { + /// + /// Game functions and events + /// public GameFunctions Functions { get; } + /// + /// + /// Construct a new XivCommon base. + /// + /// + /// This will automatically enable hooks based on the hooks parameter. + /// + /// + /// The of the plugin constructing this base + /// Flags indicating which hooks to enable public XivCommonBase(DalamudPluginInterface @interface, Hooks hooks = HooksExt.DefaultHooks) { this.Functions = new GameFunctions(hooks, @interface.TargetModuleScanner, @interface.SeStringManager); } + /// public void Dispose() { this.Functions.Dispose(); }