feat: update changelog

This commit is contained in:
goaaats 2021-10-07 18:55:43 +02:00
parent 2c4f858ced
commit 87655d51cb
No known key found for this signature in database
GPG key ID: F18F057873895461
4 changed files with 31 additions and 15 deletions

View file

@ -55,6 +55,11 @@ namespace Dalamud.Configuration.Internal
/// </summary> /// </summary>
public string LastVersion { get; set; } = null; public string LastVersion { get; set; } = null;
/// <summary>
/// Gets or sets the last loaded Dalamud version.
/// </summary>
public string LastChangelogMajorMinor { get; set; } = null;
/// <summary> /// <summary>
/// Gets or sets the chat type used by default for plugin messages. /// Gets or sets the chat type used by default for plugin messages.
/// </summary> /// </summary>

View file

@ -14,6 +14,7 @@ using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Game.Text.SeStringHandling.Payloads; using Dalamud.Game.Text.SeStringHandling.Payloads;
using Dalamud.Interface.Internal; using Dalamud.Interface.Internal;
using Dalamud.Interface.Internal.Notifications; using Dalamud.Interface.Internal.Notifications;
using Dalamud.Interface.Internal.Windows;
using Dalamud.IoC; using Dalamud.IoC;
using Dalamud.IoC.Internal; using Dalamud.IoC.Internal;
using Dalamud.Plugin.Internal; using Dalamud.Plugin.Internal;
@ -260,8 +261,11 @@ namespace Dalamud.Game
Type = XivChatType.Notice, Type = XivChatType.Notice,
}); });
if (dalamudInterface.WarrantsChangelog) if (string.IsNullOrEmpty(configuration.LastChangelogMajorMinor) || (!ChangelogWindow.WarrantsChangelogForMajorMinor.StartsWith(configuration.LastChangelogMajorMinor) && assemblyVersion.StartsWith(ChangelogWindow.WarrantsChangelogForMajorMinor)))
{
dalamudInterface.OpenChangelogWindow(); dalamudInterface.OpenChangelogWindow();
configuration.LastChangelogMajorMinor = ChangelogWindow.WarrantsChangelogForMajorMinor;
}
configuration.LastVersion = assemblyVersion; configuration.LastVersion = assemblyVersion;
configuration.Save(); configuration.Save();

View file

@ -21,7 +21,6 @@ using Dalamud.Logging.Internal;
using Dalamud.Plugin.Internal; using Dalamud.Plugin.Internal;
using Dalamud.Utility; using Dalamud.Utility;
using ImGuiNET; using ImGuiNET;
using Newtonsoft.Json;
using PInvoke; using PInvoke;
using Serilog.Events; using Serilog.Events;
@ -114,11 +113,6 @@ namespace Dalamud.Interface.Internal
set => this.isImGuiDrawDevMenu = value; set => this.isImGuiDrawDevMenu = value;
} }
/// <summary>
/// Gets a value indicating whether the current Dalamud version warrants displaying the changelog.
/// </summary>
public bool WarrantsChangelog => ChangelogWindow.WarrantsChangelog;
/// <inheritdoc/> /// <inheritdoc/>
public void Dispose() public void Dispose()
{ {

View file

@ -1,5 +1,7 @@
using System.Diagnostics; using System.Diagnostics;
using System.Numerics;
using Dalamud.Interface.Colors;
using Dalamud.Interface.Windowing; using Dalamud.Interface.Windowing;
using Dalamud.Utility; using Dalamud.Utility;
using ImGuiNET; using ImGuiNET;
@ -14,15 +16,19 @@ namespace Dalamud.Interface.Internal.Windows
/// <summary> /// <summary>
/// Whether the latest update warrants a changelog window. /// Whether the latest update warrants a changelog window.
/// </summary> /// </summary>
public const bool WarrantsChangelog = true; public const string WarrantsChangelogForMajorMinor = "6.0.";
private const string ChangeLog = 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; 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 <see cref="ChangelogWindow"/> class. /// Initializes a new instance of the <see cref="ChangelogWindow"/> class.
/// </summary> /// </summary>
public ChangelogWindow() public ChangelogWindow()
: base("What's new in XIVLauncher?", ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoResize) : base("What's new in XIVLauncher?")
{ {
this.Namespace = "DalamudChangelogWindow"; this.Namespace = "DalamudChangelogWindow";
this.IsOpen = WarrantsChangelog; this.Size = new Vector2(885, 385);
this.SizeCondition = ImGuiCond.Appearing;
} }
/// <inheritdoc/> /// <inheritdoc/>
@ -45,7 +52,13 @@ Thank you for participating in the Dalamud collaborative testing programme.";
ImGuiHelpers.ScaledDummy(10); ImGuiHelpers.ScaledDummy(10);
ImGui.Text("The following changes were introduced:"); 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); ImGuiHelpers.ScaledDummy(10);