From 948b7b30b3618ba3fcc58d738db36fdbbefb2ec0 Mon Sep 17 00:00:00 2001 From: goat Date: Sun, 24 Nov 2019 22:58:22 +0900 Subject: [PATCH] Add a message when assembly version of Dalamud.dll changed --- Dalamud/Configuration/CustomComboPreset.cs | 3 +++ Dalamud/Configuration/DalamudConfiguration.cs | 1 + Dalamud/Game/ChatHandlers.cs | 14 +++++++++++++- Dalamud/Game/Internal/Gui/IconReplacer.cs | 2 -- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Dalamud/Configuration/CustomComboPreset.cs b/Dalamud/Configuration/CustomComboPreset.cs index 903563642..bee8895c9 100644 --- a/Dalamud/Configuration/CustomComboPreset.cs +++ b/Dalamud/Configuration/CustomComboPreset.cs @@ -118,6 +118,9 @@ namespace XIVLauncher.Dalamud [CustomComboInfo("ES Painflare", "Change Energy Siphon into Painflare while you have Aetherflow stacks.", 27)] SummonerESPainflareCombo = 1L << 40, + [CustomComboInfo("DWT", "DWT.", 27)] + SummonerDwtCombo = 1L << 50, + // SCHOLAR [CustomComboInfo("Seraph Fey Blessing/Consolation", "Change Fey Blessing into Consolation when Seraph is out.", 28)] ScholarSeraphConsolationFeature = 1L << 29, diff --git a/Dalamud/Configuration/DalamudConfiguration.cs b/Dalamud/Configuration/DalamudConfiguration.cs index ebc5106c6..296616e00 100644 --- a/Dalamud/Configuration/DalamudConfiguration.cs +++ b/Dalamud/Configuration/DalamudConfiguration.cs @@ -25,6 +25,7 @@ namespace Dalamud public List Fates; + public string LastVersion { get; set; } public static DalamudConfiguration Load(string path) { return JsonConvert.DeserializeObject(File.ReadAllText(path)); diff --git a/Dalamud/Game/ChatHandlers.cs b/Dalamud/Game/ChatHandlers.cs index 46156579c..e65927179 100644 --- a/Dalamud/Game/ChatHandlers.cs +++ b/Dalamud/Game/ChatHandlers.cs @@ -98,8 +98,20 @@ namespace Dalamud.Game { ref StdString message, ref bool isHandled) { if (type == XivChatType.Notice && !this.hasSeenLoadingMsg) { - this.dalamud.Framework.Gui.Chat.Print($"XIVLauncher in-game addon v{Assembly.GetAssembly(typeof(ChatHandlers)).GetName().Version} loaded."); + var assemblyVersion = Assembly.GetAssembly(typeof(ChatHandlers)).GetName().Version.ToString(); + + this.dalamud.Framework.Gui.Chat.Print($"XIVLauncher in-game addon v{assemblyVersion} loaded."); this.hasSeenLoadingMsg = true; + + if (string.IsNullOrEmpty(this.dalamud.Configuration.LastVersion) || !assemblyVersion.StartsWith(this.dalamud.Configuration.LastVersion)) { + 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."), + Type = XivChatType.Urgent + }); + + this.dalamud.Configuration.LastVersion = assemblyVersion; + this.dalamud.Configuration.Save(this.dalamud.StartInfo.ConfigurationPath); + } } #if !DEBUG diff --git a/Dalamud/Game/Internal/Gui/IconReplacer.cs b/Dalamud/Game/Internal/Gui/IconReplacer.cs index 85581ad56..f320cba2c 100644 --- a/Dalamud/Game/Internal/Gui/IconReplacer.cs +++ b/Dalamud/Game/Internal/Gui/IconReplacer.cs @@ -465,7 +465,6 @@ namespace Dalamud.Game.Internal.Gui { // DWT changes. // Now contains DWT, Deathflare, Summon Bahamut, Enkindle Bahamut, FBT, and Enkindle Phoenix. // What a monster of a button. - /* if (this.dalamud.Configuration.ComboPresets.HasFlag(CustomComboPreset.SummonerDwtCombo)) { if (actionID == 3581) { SMNGauge gauge = this.dalamud.ClientState.JobGauges.Get(); @@ -483,7 +482,6 @@ namespace Dalamud.Game.Internal.Gui { } } } - */ if (this.dalamud.Configuration.ComboPresets.HasFlag(CustomComboPreset.SummonerDemiCombo)) { // Replace Deathflare with demi enkindles