From f94839cd0c36347c315ae58a2a9d9a0fa5ea6d77 Mon Sep 17 00:00:00 2001 From: Raymond Date: Sun, 12 Sep 2021 17:20:49 -0400 Subject: [PATCH 1/5] comment HandlePopulateItemLinkDetour --- Dalamud/Game/Gui/ChatGui.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dalamud/Game/Gui/ChatGui.cs b/Dalamud/Game/Gui/ChatGui.cs index 3cc6bb75c..0aa7bb94f 100644 --- a/Dalamud/Game/Gui/ChatGui.cs +++ b/Dalamud/Game/Gui/ChatGui.cs @@ -338,7 +338,7 @@ namespace Dalamud.Game.Gui this.LastLinkedItemId = Marshal.ReadInt32(itemInfoPtr, 8); this.LastLinkedItemFlags = Marshal.ReadByte(itemInfoPtr, 0x14); - Log.Verbose($"HandlePopulateItemLinkDetour {linkObjectPtr} {itemInfoPtr} - linked:{this.LastLinkedItemId}"); + // Log.Verbose($"HandlePopulateItemLinkDetour {linkObjectPtr} {itemInfoPtr} - linked:{this.LastLinkedItemId}"); } catch (Exception ex) { From 4c5f3eb1c2c71785b8ac965e785d9a2e130efeb4 Mon Sep 17 00:00:00 2001 From: Raymond Date: Sun, 12 Sep 2021 17:22:39 -0400 Subject: [PATCH 2/5] show dataKind failure in xldata --- Dalamud/Interface/Internal/Windows/DataWindow.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dalamud/Interface/Internal/Windows/DataWindow.cs b/Dalamud/Interface/Internal/Windows/DataWindow.cs index 9963d55f2..22a4ed7ca 100644 --- a/Dalamud/Interface/Internal/Windows/DataWindow.cs +++ b/Dalamud/Interface/Internal/Windows/DataWindow.cs @@ -165,9 +165,9 @@ namespace Dalamud.Interface.Internal.Windows }; dataKind = dataKind.Replace(" ", string.Empty).ToLower(); - var matched = Enum.GetValues(typeof(DataKind)) - .Cast() - .Where(k => Enum.GetName(typeof(DataKind), k).Replace("_", string.Empty).ToLower() == dataKind) + + var matched = Enum.GetValues() + .Where(kind => Enum.GetName(kind).Replace("_", string.Empty).ToLower() == dataKind) .FirstOrDefault(); if (matched != default) @@ -176,7 +176,7 @@ namespace Dalamud.Interface.Internal.Windows } else { - Service.Get().PrintError("/xldata: Invalid Data Type"); + Service.Get().PrintError($"/xldata: Invalid data type {dataKind}"); } } From 6f886d4604cb8d8e97dc094da85f6ddf63575c89 Mon Sep 17 00:00:00 2001 From: Raymond Date: Sun, 12 Sep 2021 20:31:46 -0400 Subject: [PATCH 3/5] remove old pre-sestring commented code --- Dalamud/Game/ChatHandlers.cs | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/Dalamud/Game/ChatHandlers.cs b/Dalamud/Game/ChatHandlers.cs index 78dc3fc63..402a5c061 100644 --- a/Dalamud/Game/ChatHandlers.cs +++ b/Dalamud/Game/ChatHandlers.cs @@ -223,28 +223,6 @@ namespace Dalamud.Game var linkMatch = this.urlRegex.Match(message.TextValue); if (linkMatch.Value.Length > 0) this.LastLink = linkMatch.Value; - - // Handle all of this with SeString some day - /* - if ((this.HandledChatTypeColors.ContainsKey(type) || type == XivChatType.Say || type == XivChatType.Shout || - type == XivChatType.Alliance || type == XivChatType.TellOutgoing || type == XivChatType.Yell)) { - var italicsStart = message.TextValue.IndexOf("*", StringComparison.InvariantCulture); - var italicsEnd = message.TextValue.IndexOf("*", italicsStart + 1, StringComparison.InvariantCulture); - - var messageString = message.TextValue; - - while (italicsEnd != -1) { - var it = MakeItalics( - messageString.Substring(italicsStart, italicsEnd - italicsStart + 1).Replace("*", "")); - messageString = messageString.Remove(italicsStart, italicsEnd - italicsStart + 1); - messageString = messageString.Insert(italicsStart, it); - italicsStart = messageString.IndexOf("*"); - italicsEnd = messageString.IndexOf("*", italicsStart + 1); - } - - message.RawData = Encoding.UTF8.GetBytes(messageString); - } - */ } private void PrintWelcomeMessage() From dd928243612caab0c2091154ef53430514967dc7 Mon Sep 17 00:00:00 2001 From: Raymond Date: Sun, 12 Sep 2021 20:34:35 -0400 Subject: [PATCH 4/5] comment unused method --- Dalamud/Interface/Windowing/Window.cs | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Dalamud/Interface/Windowing/Window.cs b/Dalamud/Interface/Windowing/Window.cs index 575a65b79..7b7c7bc72 100644 --- a/Dalamud/Interface/Windowing/Window.cs +++ b/Dalamud/Interface/Windowing/Window.cs @@ -220,20 +220,20 @@ namespace Dalamud.Interface.Windowing ImGui.PopID(); } - private void CheckState() - { - if (this.internalLastIsOpen != this.internalIsOpen) - { - if (this.internalIsOpen) - { - this.OnOpen(); - } - else - { - this.OnClose(); - } - } - } + // private void CheckState() + // { + // if (this.internalLastIsOpen != this.internalIsOpen) + // { + // if (this.internalIsOpen) + // { + // this.OnOpen(); + // } + // else + // { + // this.OnClose(); + // } + // } + // } private void ApplyConditionals() { From 9db492d26d19cc6d46d7e317d87c9af12be01a20 Mon Sep 17 00:00:00 2001 From: Raymond Date: Sun, 12 Sep 2021 21:05:42 -0400 Subject: [PATCH 5/5] formatting --- Dalamud/Interface/Windowing/Window.cs | 1 + Dalamud/Plugin/Internal/PluginManager.cs | 28 ++++++++++++++---------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Dalamud/Interface/Windowing/Window.cs b/Dalamud/Interface/Windowing/Window.cs index 7b7c7bc72..dc8e47b6d 100644 --- a/Dalamud/Interface/Windowing/Window.cs +++ b/Dalamud/Interface/Windowing/Window.cs @@ -1,4 +1,5 @@ using System.Numerics; + using Dalamud.Configuration.Internal; using Dalamud.Game.ClientState.Keys; using ImGuiNET; diff --git a/Dalamud/Plugin/Internal/PluginManager.cs b/Dalamud/Plugin/Internal/PluginManager.cs index 50405778b..1c479a65a 100644 --- a/Dalamud/Plugin/Internal/PluginManager.cs +++ b/Dalamud/Plugin/Internal/PluginManager.cs @@ -171,8 +171,11 @@ namespace Dalamud.Plugin.Internal /// /// Load all plugins, sorted by priority. Any plugins with no explicit definition file or a negative priority - /// are loaded asynchronously. Should only be called during Dalamud startup. + /// are loaded asynchronously. /// + /// + /// This should only be called during Dalamud startup. + /// public void LoadAllPlugins() { if (this.SafeMode) @@ -267,8 +270,11 @@ namespace Dalamud.Plugin.Internal var asyncPlugins = pluginDefs.Where(def => def.Manifest == null || def.Manifest.LoadPriority <= 0); Task.Run(() => LoadPlugins(asyncPlugins)) - .ContinueWith(task => this.PluginsReady = true) - .ContinueWith(task => this.NotifyInstalledPluginsChanged()); + .ContinueWith(task => + { + this.PluginsReady = true; + this.NotifyInstalledPluginsChanged(); + }); } /// @@ -727,24 +733,22 @@ namespace Dalamud.Plugin.Internal var plugin = metadata.InstalledPlugin; // Can't update that! - if (plugin is LocalDevPlugin) + if (plugin.IsDev) return null; var updateStatus = new PluginUpdateStatus { InternalName = plugin.Manifest.InternalName, Name = plugin.Manifest.Name, - Version = metadata.UseTesting ? metadata.UpdateManifest.TestingAssemblyVersion : metadata.UpdateManifest.AssemblyVersion, + Version = metadata.UseTesting + ? metadata.UpdateManifest.TestingAssemblyVersion + : metadata.UpdateManifest.AssemblyVersion, }; - if (dryRun) - { - updateStatus.WasUpdated = true; - } - else - { - updateStatus.WasUpdated = true; + updateStatus.WasUpdated = true; + if (!dryRun) + { // Unload if loaded if (plugin.State == PluginState.Loaded || plugin.State == PluginState.LoadError) {