feat: notify when dev plugin reloads (closes #443)

This commit is contained in:
goat 2021-09-17 03:16:43 +02:00
parent 5a9c1ecaa3
commit 25a71574cf
No known key found for this signature in database
GPG key ID: F18F057873895461
2 changed files with 15 additions and 2 deletions

View file

@ -7,7 +7,6 @@ using Dalamud.Configuration.Internal;
using Dalamud.Hooking;
using Dalamud.Interface.Internal;
using Dalamud.Interface.Windowing;
using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Component.GUI;
using Serilog;

View file

@ -4,6 +4,7 @@ using System.Threading;
using System.Threading.Tasks;
using Dalamud.Configuration.Internal;
using Dalamud.Interface.Internal.Notifications;
using Dalamud.Logging.Internal;
using Dalamud.Plugin.Internal.Types;
@ -144,7 +145,20 @@ namespace Dalamud.Plugin.Internal
return;
}
this.Reload();
try
{
this.Reload();
Service<NotificationManager>.Get()
.AddNotification(
$"The DevPlugin '{this.Name} was reloaded successfully.", "Plugin reloaded!", NotificationType.Success);
}
catch (Exception ex)
{
Log.Error(ex, "DevPlugin reload failed.");
Service<NotificationManager>.Get()
.AddNotification(
$"The DevPlugin '{this.Name} could not be reloaded.", "Plugin reload failed!", NotificationType.Error);
}
},
this.fileWatcherTokenSource.Token);
}