Add events for ClassJob and Level change (#1985)

* Add events for ClassJob and Level change
* Correctly handle uiModuleHandlePacketHook
* Update Dalamud/Plugin/Services/IClientState.cs


Co-authored-by: KazWolfe <KazWolfe@users.noreply.github.com>
This commit is contained in:
Haselnussbomber 2024-07-30 02:17:07 +02:00 committed by GitHub
parent 7369878789
commit 9bb9b3acf4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 124 additions and 26 deletions

View file

@ -9,11 +9,35 @@ namespace Dalamud.Plugin.Services;
/// </summary>
public interface IClientState
{
/// <summary>
/// A delegate type used for the <see cref="ClassJobChanged"/> event.
/// </summary>
/// <param name="classJobId">The new ClassJob id.</param>
public delegate void ClassJobChangeDelegate(uint classJobId);
/// <summary>
/// A delegate type used for the <see cref="LevelChanged"/> event.
/// </summary>
/// <param name="classJobId">The ClassJob id.</param>
/// <param name="level">The level of the corresponding ClassJob.</param>
public delegate void LevelChangeDelegate(uint classJobId, uint level);
/// <summary>
/// Event that gets fired when the current Territory changes.
/// </summary>
public event Action<ushort> TerritoryChanged;
/// <summary>
/// Event that fires when a characters ClassJob changed.
/// </summary>
public event ClassJobChangeDelegate? ClassJobChanged;
/// <summary>
/// Event that fires when <em>any</em> character level changes, including levels
/// for a not-currently-active ClassJob (e.g. PvP matches, DoH/DoL).
/// </summary>
public event LevelChangeDelegate? LevelChanged;
/// <summary>
/// Event that fires when a character is logging in, and the local character object is available.
/// </summary>