feat: add CfPop event to ClientState

This commit is contained in:
goat 2020-12-08 09:06:14 +01:00
parent 37f0fba52a
commit b6df202344
3 changed files with 25 additions and 8 deletions

View file

@ -22,8 +22,10 @@ namespace Dalamud.Game.Network {
private readonly bool optOutMbUploads;
private readonly IMarketBoardUploader uploader;
public delegate Task CfPop(ContentFinderCondition cfc);
public event CfPop ProcessCfPop;
/// <summary>
/// Event which gets fired when a duty is ready.
/// </summary>
public event EventHandler<ContentFinderCondition> CfPop;
public NetworkHandlers(Dalamud dalamud, bool optOutMbUploads) {
this.dalamud = dalamud;
@ -79,11 +81,11 @@ namespace Dalamud.Game.Network {
NativeFunctions.FlashWindowEx(ref flashInfo);
}
Task.Run(async () => {
Task.Run(() => {
if(this.dalamud.Configuration.DutyFinderChatMessage)
this.dalamud.Framework.Gui.Chat.Print("Duty pop: " + cfcName);
await this.ProcessCfPop?.Invoke(contentFinderCondition);
CfPop?.Invoke(this, contentFinderCondition);
});
return;