diff --git a/Dalamud/Game/ChatHandlers.cs b/Dalamud/Game/ChatHandlers.cs index c40744ca4..064667596 100644 --- a/Dalamud/Game/ChatHandlers.cs +++ b/Dalamud/Game/ChatHandlers.cs @@ -8,6 +8,8 @@ using Dalamud.Configuration.Internal; using Dalamud.Game.Gui; using Dalamud.Game.Text; using Dalamud.Game.Text.SeStringHandling; +using Dalamud.Game.Text.SeStringHandling.Payloads; +using Dalamud.Interface; using Dalamud.Interface.Internal; using Dalamud.Logging.Internal; using Dalamud.Plugin.Internal; @@ -100,8 +102,6 @@ internal partial class ChatHandlers : IServiceType if (chatGui == null || pluginManager == null || dalamudInterface == null) return; - var assemblyVersion = Assembly.GetAssembly(typeof(ChatHandlers)).GetName().Version.ToString(); - if (this.configuration.PrintDalamudWelcomeMsg) { chatGui.Print(string.Format(Loc.Localize("DalamudWelcome", "Dalamud {0} loaded."), Util.GetScmVersion()) @@ -116,15 +116,30 @@ internal partial class ChatHandlers : IServiceType } } - if (string.IsNullOrEmpty(this.configuration.LastVersion) || !assemblyVersion.StartsWith(this.configuration.LastVersion)) + if (string.IsNullOrEmpty(this.configuration.LastVersion) || !Util.AssemblyVersion.StartsWith(this.configuration.LastVersion)) { + var linkPayload = chatGui.AddChatLinkHandler( + "dalamud", + 8459324, + (_, _) => dalamudInterface.OpenPluginInstallerTo(PluginInstallerOpenKind.Changelogs)); + + var updateMessage = new SeStringBuilder() + .AddText(Loc.Localize("DalamudUpdated", "Dalamud has been updated successfully!")) + .AddUiForeground(500) + .AddText(" [") + .Add(linkPayload) + .AddText(Loc.Localize("DalamudClickToViewChangelogs", " Click here to view the changelog.")) + .Add(RawPayload.LinkTerminator) + .AddText("]") + .AddUiForegroundOff(); + chatGui.Print(new XivChatEntry { - Message = Loc.Localize("DalamudUpdated", "Dalamud has been updated successfully! Please check the discord for a full changelog."), + Message = updateMessage.Build(), Type = XivChatType.Notice, }); - this.configuration.LastVersion = assemblyVersion; + this.configuration.LastVersion = Util.AssemblyVersion; this.configuration.QueueSave(); } diff --git a/Dalamud/Game/Gui/ChatGui.cs b/Dalamud/Game/Gui/ChatGui.cs index 791cbb97a..721070d9b 100644 --- a/Dalamud/Game/Gui/ChatGui.cs +++ b/Dalamud/Game/Gui/ChatGui.cs @@ -220,6 +220,7 @@ internal sealed unsafe class ChatGui : IInternalDisposableService, IChatGui /// The ID of the command to run. /// The command action itself. /// A payload for handling. + [Api13ToDo("Plugins should not specify their own command IDs here. We should assign them ourselves.")] internal DalamudLinkPayload AddChatLinkHandler(string pluginName, uint commandId, Action commandAction) { var payload = new DalamudLinkPayload { Plugin = pluginName, CommandId = commandId }; diff --git a/Dalamud/Interface/DalamudWindowOpenKinds.cs b/Dalamud/Interface/DalamudWindowOpenKinds.cs index 588ff858b..35d2825f7 100644 --- a/Dalamud/Interface/DalamudWindowOpenKinds.cs +++ b/Dalamud/Interface/DalamudWindowOpenKinds.cs @@ -14,16 +14,21 @@ public enum PluginInstallerOpenKind /// Open to the "Installed Plugins" page. /// InstalledPlugins, - + /// /// Open to the "Can be updated" page. /// UpdateablePlugins, /// - /// Open to the "Changelogs" page. + /// Open to the "Plugin Changelogs" page. /// Changelogs, + + /// + /// Open to the "Dalamud Changelogs" page. + /// + DalamudChangelogs, } /// @@ -35,12 +40,12 @@ public enum SettingsOpenKind /// Open to the "General" page. /// General, - + /// /// Open to the "Look & Feel" page. /// LookAndFeel, - + /// /// Open to the "Auto Updates" page. /// diff --git a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs index eca3672c2..317fa86d0 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs @@ -501,6 +501,12 @@ internal class PluginInstallerWindow : Window, IDisposable // Plugins category this.categoryManager.CurrentCategoryKind = PluginCategoryManager.CategoryKind.All; break; + case PluginInstallerOpenKind.DalamudChangelogs: + // Changelog group + this.categoryManager.CurrentGroupKind = PluginCategoryManager.GroupKind.Changelog; + // Dalamud category + this.categoryManager.CurrentCategoryKind = PluginCategoryManager.CategoryKind.DalamudChangelogs; + break; default: throw new ArgumentOutOfRangeException(nameof(kind), kind, null); }