From 87655d51cb08934968281a23c1ab55e7703a01bd Mon Sep 17 00:00:00 2001
From: goaaats <16760685+goaaats@users.noreply.github.com>
Date: Thu, 7 Oct 2021 18:55:43 +0200
Subject: [PATCH] feat: update changelog
---
.../Internal/DalamudConfiguration.cs | 5 ++++
Dalamud/Game/ChatHandlers.cs | 6 +++-
.../Interface/Internal/DalamudInterface.cs | 6 ----
.../Internal/Windows/ChangelogWindow.cs | 29 ++++++++++++++-----
4 files changed, 31 insertions(+), 15 deletions(-)
diff --git a/Dalamud/Configuration/Internal/DalamudConfiguration.cs b/Dalamud/Configuration/Internal/DalamudConfiguration.cs
index 390d9c9e5..03e588583 100644
--- a/Dalamud/Configuration/Internal/DalamudConfiguration.cs
+++ b/Dalamud/Configuration/Internal/DalamudConfiguration.cs
@@ -55,6 +55,11 @@ namespace Dalamud.Configuration.Internal
///
public string LastVersion { get; set; } = null;
+ ///
+ /// Gets or sets the last loaded Dalamud version.
+ ///
+ public string LastChangelogMajorMinor { get; set; } = null;
+
///
/// Gets or sets the chat type used by default for plugin messages.
///
diff --git a/Dalamud/Game/ChatHandlers.cs b/Dalamud/Game/ChatHandlers.cs
index 06349b3d0..5465fef97 100644
--- a/Dalamud/Game/ChatHandlers.cs
+++ b/Dalamud/Game/ChatHandlers.cs
@@ -14,6 +14,7 @@ using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Game.Text.SeStringHandling.Payloads;
using Dalamud.Interface.Internal;
using Dalamud.Interface.Internal.Notifications;
+using Dalamud.Interface.Internal.Windows;
using Dalamud.IoC;
using Dalamud.IoC.Internal;
using Dalamud.Plugin.Internal;
@@ -260,8 +261,11 @@ namespace Dalamud.Game
Type = XivChatType.Notice,
});
- if (dalamudInterface.WarrantsChangelog)
+ if (string.IsNullOrEmpty(configuration.LastChangelogMajorMinor) || (!ChangelogWindow.WarrantsChangelogForMajorMinor.StartsWith(configuration.LastChangelogMajorMinor) && assemblyVersion.StartsWith(ChangelogWindow.WarrantsChangelogForMajorMinor)))
+ {
dalamudInterface.OpenChangelogWindow();
+ configuration.LastChangelogMajorMinor = ChangelogWindow.WarrantsChangelogForMajorMinor;
+ }
configuration.LastVersion = assemblyVersion;
configuration.Save();
diff --git a/Dalamud/Interface/Internal/DalamudInterface.cs b/Dalamud/Interface/Internal/DalamudInterface.cs
index 6e417094e..0fbe8646d 100644
--- a/Dalamud/Interface/Internal/DalamudInterface.cs
+++ b/Dalamud/Interface/Internal/DalamudInterface.cs
@@ -21,7 +21,6 @@ using Dalamud.Logging.Internal;
using Dalamud.Plugin.Internal;
using Dalamud.Utility;
using ImGuiNET;
-using Newtonsoft.Json;
using PInvoke;
using Serilog.Events;
@@ -114,11 +113,6 @@ namespace Dalamud.Interface.Internal
set => this.isImGuiDrawDevMenu = value;
}
- ///
- /// Gets a value indicating whether the current Dalamud version warrants displaying the changelog.
- ///
- public bool WarrantsChangelog => ChangelogWindow.WarrantsChangelog;
-
///
public void Dispose()
{
diff --git a/Dalamud/Interface/Internal/Windows/ChangelogWindow.cs b/Dalamud/Interface/Internal/Windows/ChangelogWindow.cs
index 3774683bf..b3808d501 100644
--- a/Dalamud/Interface/Internal/Windows/ChangelogWindow.cs
+++ b/Dalamud/Interface/Internal/Windows/ChangelogWindow.cs
@@ -1,5 +1,7 @@
using System.Diagnostics;
+using System.Numerics;
+using Dalamud.Interface.Colors;
using Dalamud.Interface.Windowing;
using Dalamud.Utility;
using ImGuiNET;
@@ -14,15 +16,19 @@ namespace Dalamud.Interface.Internal.Windows
///
/// Whether the latest update warrants a changelog window.
///
- public const bool WarrantsChangelog = true;
+ public const string WarrantsChangelogForMajorMinor = "6.0.";
private const string ChangeLog =
- @"* Various behind-the-scenes changes to improve stability and provide more functionality to plugin developers
+ @"This is the biggest update of the in-game addon to date.
+We have redone most of the underlying systems, providing you with a better experience playing and browsing for plugins, including better performance, and developers with a better API and more comfortable development environment. You will receive this update automatically the next time you start the game.
-ATTENTION: YOU WILL HAVE TO UPDATE/REINSTALL ALL OF YOUR PLUGINS!!!!
-If you note any issues or need help, please make sure to ask on our discord server.
+If you note any issues or need help, please make sure to ask on our discord server.";
-Thank you for participating in the Dalamud collaborative testing programme.";
+ private const string UpdatePluginsInfo =
+ @"• All of your plugins were disabled automatically, due to this update. This is normal.
+• Open the plugin installer, then click 'update plugins'. Updated plugins should update and then re-enable themselves.
+ => Please keep in mind that not all of your plugins may already be updated for the new version.
+ => If some plugins are displayed with a red cross in the 'Installed Plugins' tab, they may not yet be available.";
private readonly string assemblyVersion = Util.AssemblyVersion;
@@ -30,11 +36,12 @@ Thank you for participating in the Dalamud collaborative testing programme.";
/// Initializes a new instance of the class.
///
public ChangelogWindow()
- : base("What's new in XIVLauncher?", ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoResize)
+ : base("What's new in XIVLauncher?")
{
this.Namespace = "DalamudChangelogWindow";
- this.IsOpen = WarrantsChangelog;
+ this.Size = new Vector2(885, 385);
+ this.SizeCondition = ImGuiCond.Appearing;
}
///
@@ -45,7 +52,13 @@ Thank you for participating in the Dalamud collaborative testing programme.";
ImGuiHelpers.ScaledDummy(10);
ImGui.Text("The following changes were introduced:");
- ImGui.Text(ChangeLog);
+ ImGui.TextWrapped(ChangeLog);
+
+ ImGuiHelpers.ScaledDummy(5);
+
+ ImGui.TextColored(ImGuiColors.DalamudRed, " !!! ATTENTION !!!");
+
+ ImGui.TextWrapped(UpdatePluginsInfo);
ImGuiHelpers.ScaledDummy(10);