mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-01 05:13:40 +01:00
feat: add warning message on login when plugins need an update
This commit is contained in:
parent
a4ea6e9d6e
commit
117cc3ef44
1 changed files with 16 additions and 1 deletions
|
|
@ -10,6 +10,7 @@ using Dalamud.Game.Chat;
|
||||||
using Dalamud.Game.Chat.SeStringHandling;
|
using Dalamud.Game.Chat.SeStringHandling;
|
||||||
using Dalamud.Game.Chat.SeStringHandling.Payloads;
|
using Dalamud.Game.Chat.SeStringHandling.Payloads;
|
||||||
using Dalamud.Game.Internal.Libc;
|
using Dalamud.Game.Internal.Libc;
|
||||||
|
using Dalamud.Plugin;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace Dalamud.Game {
|
namespace Dalamud.Game {
|
||||||
|
|
@ -113,12 +114,26 @@ namespace Dalamud.Game {
|
||||||
if (string.IsNullOrEmpty(this.dalamud.Configuration.LastVersion) || !assemblyVersion.StartsWith(this.dalamud.Configuration.LastVersion)) {
|
if (string.IsNullOrEmpty(this.dalamud.Configuration.LastVersion) || !assemblyVersion.StartsWith(this.dalamud.Configuration.LastVersion)) {
|
||||||
this.dalamud.Framework.Gui.Chat.PrintChat(new XivChatEntry {
|
this.dalamud.Framework.Gui.Chat.PrintChat(new XivChatEntry {
|
||||||
MessageBytes = Encoding.UTF8.GetBytes("The In-Game addon has been updated or was reinstalled successfully! Please check the discord for a full changelog."),
|
MessageBytes = Encoding.UTF8.GetBytes("The In-Game addon has been updated or was reinstalled successfully! Please check the discord for a full changelog."),
|
||||||
Type = XivChatType.Urgent
|
Type = XivChatType.Notice
|
||||||
});
|
});
|
||||||
|
|
||||||
this.dalamud.Configuration.LastVersion = assemblyVersion;
|
this.dalamud.Configuration.LastVersion = assemblyVersion;
|
||||||
this.dalamud.Configuration.Save(this.dalamud.StartInfo.ConfigurationPath);
|
this.dalamud.Configuration.Save(this.dalamud.StartInfo.ConfigurationPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
var hasNeedsUpdate = this.dalamud.PluginRepository.UpdatePlugins(true).UpdatedCount != 0;
|
||||||
|
|
||||||
|
if (hasNeedsUpdate) {
|
||||||
|
this.dalamud.Framework.Gui.Chat.PrintChat(new XivChatEntry
|
||||||
|
{
|
||||||
|
MessageBytes = Encoding.UTF8.GetBytes("One or more of your plugins needs to be updated. Please use the /xlplugins command in-game to update them!"),
|
||||||
|
Type = XivChatType.Urgent
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.Error(e, "Could not check for plugin updates.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !DEBUG && false
|
#if !DEBUG && false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue