From 94c6546461e1133932f230133fa80c0e5f2bc1df Mon Sep 17 00:00:00 2001 From: Cara Date: Sun, 17 May 2020 14:10:27 +0930 Subject: [PATCH 1/3] Disallow linking of invalid items. --- Dalamud/Interface/ItemSearchWindow.cs | 29 ++++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/Dalamud/Interface/ItemSearchWindow.cs b/Dalamud/Interface/ItemSearchWindow.cs index 96dea4d93..112c35b36 100644 --- a/Dalamud/Interface/ItemSearchWindow.cs +++ b/Dalamud/Interface/ItemSearchWindow.cs @@ -161,11 +161,13 @@ namespace Dalamud.Interface if (ImGui.IsMouseDoubleClicked(0)) { - OnItemChosen?.Invoke(this, this.searchTask.Result[i]); - if (this.closeOnChoose) - { - this.selectedItemTex?.Dispose(); - isOpen = false; + if (this.selectedItemTex != null){ + OnItemChosen?.Invoke(this, this.searchTask.Result[i]); + if (this.closeOnChoose) + { + this.selectedItemTex?.Dispose(); + isOpen = false; + } } } } @@ -189,14 +191,16 @@ namespace Dalamud.Interface ImGui.EndChild(); // Darken choose button if it shouldn't be clickable - ImGui.PushStyleVar(ImGuiStyleVar.Alpha, this.selectedItemIndex < 0 ? 0.25f : 1); + ImGui.PushStyleVar(ImGuiStyleVar.Alpha, this.selectedItemIndex < 0 || this.selectedItemTex == null ? 0.25f : 1); if (ImGui.Button(Loc.Localize("Choose", "Choose"))) { try { - OnItemChosen?.Invoke(this, this.searchTask.Result[this.selectedItemIndex]); - if (this.closeOnChoose) { - this.selectedItemTex?.Dispose(); - isOpen = false; + if (this.selectedItemTex != null) { + OnItemChosen?.Invoke(this, this.searchTask.Result[this.selectedItemIndex]); + if (this.closeOnChoose) { + this.selectedItemTex?.Dispose(); + isOpen = false; + } } } catch (Exception ex) { Log.Error($"Exception in Choose: {ex.Message}"); @@ -214,6 +218,11 @@ namespace Dalamud.Interface } } + if (this.selectedItemIndex >= 0 && this.selectedItemTex == null) { + ImGui.SameLine(); + ImGui.Text(Loc.Localize("DalamudItemNotLinkable", "This item is not linkable.")); + } + ImGui.End(); return isOpen; From b3ab3a53562295c6840dd71387408b074881b2e7 Mon Sep 17 00:00:00 2001 From: Poliwrath Date: Mon, 18 May 2020 02:36:23 -0400 Subject: [PATCH 2/3] add DutyFinderTaskbarFlash --- Dalamud/Configuration/DalamudConfiguration.cs | 2 ++ Dalamud/Game/Network/NetworkHandlers.cs | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Dalamud/Configuration/DalamudConfiguration.cs b/Dalamud/Configuration/DalamudConfiguration.cs index 7a1671cc2..86c01ef0e 100644 --- a/Dalamud/Configuration/DalamudConfiguration.cs +++ b/Dalamud/Configuration/DalamudConfiguration.cs @@ -27,6 +27,8 @@ namespace Dalamud public Dictionary PreferredRoleReminders { get; set; } + public bool DutyFinderTaskbarFlash { get; set; } = true; + public string LanguageOverride { get; set; } public string LastVersion { get; set; } diff --git a/Dalamud/Game/Network/NetworkHandlers.cs b/Dalamud/Game/Network/NetworkHandlers.cs index 14e126028..0b8c17817 100644 --- a/Dalamud/Game/Network/NetworkHandlers.cs +++ b/Dalamud/Game/Network/NetworkHandlers.cs @@ -67,14 +67,16 @@ namespace Dalamud.Game.Network { contentFinderCondition.Image = 112324; } - if (!NativeFunctions.ApplicationIsActivated()) { - var flashInfo = new NativeFunctions.FLASHWINFO(); - flashInfo.cbSize = (uint)Marshal.SizeOf(); - flashInfo.uCount = uint.MaxValue; - flashInfo.dwTimeout = 0; - flashInfo.dwFlags = NativeFunctions.FlashWindow.FLASHW_ALL | - NativeFunctions.FlashWindow.FLASHW_TIMERNOFG; - flashInfo.hwnd = Process.GetCurrentProcess().MainWindowHandle; + if (this.dalamud.Configuration.DutyFinderTaskbarFlash && !NativeFunctions.ApplicationIsActivated()) { + var flashInfo = new NativeFunctions.FLASHWINFO + { + cbSize = (uint)Marshal.SizeOf(), + uCount = uint.MaxValue, + dwTimeout = 0, + dwFlags = NativeFunctions.FlashWindow.FLASHW_ALL | + NativeFunctions.FlashWindow.FLASHW_TIMERNOFG, + hwnd = Process.GetCurrentProcess().MainWindowHandle + }; NativeFunctions.FlashWindowEx(ref flashInfo); } From 219b4a30111cda3808c5eb89d0ebc8ea9f187d47 Mon Sep 17 00:00:00 2001 From: Cara Date: Mon, 18 May 2020 19:06:24 +0930 Subject: [PATCH 3/3] Don't show invalid items in list at all --- Dalamud/Interface/ItemSearchWindow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dalamud/Interface/ItemSearchWindow.cs b/Dalamud/Interface/ItemSearchWindow.cs index 112c35b36..f05ffa66d 100644 --- a/Dalamud/Interface/ItemSearchWindow.cs +++ b/Dalamud/Interface/ItemSearchWindow.cs @@ -120,7 +120,7 @@ namespace Dalamud.Interface asyncEnum = asyncEnum.Where( x => (x.Name.ToLower().Contains(this.searchText.ToLower()) || int.TryParse(this.searchText, out var parsedId) && - parsedId == x.RowId)); + parsedId == x.RowId) && x.Icon < 65000); } if (this.currentKind != 0)