This commit is contained in:
goat 2020-05-22 14:05:04 +02:00
commit 72b416f35a
3 changed files with 32 additions and 19 deletions

View file

@ -28,6 +28,8 @@ namespace Dalamud
public Dictionary<int, PreferredRole> PreferredRoleReminders { get; set; } public Dictionary<int, PreferredRole> PreferredRoleReminders { get; set; }
public bool DutyFinderTaskbarFlash { get; set; } = true;
public string LanguageOverride { get; set; } public string LanguageOverride { get; set; }
public string LastVersion { get; set; } public string LastVersion { get; set; }

View file

@ -67,14 +67,16 @@ namespace Dalamud.Game.Network {
contentFinderCondition.Image = 112324; contentFinderCondition.Image = 112324;
} }
if (!NativeFunctions.ApplicationIsActivated()) { if (this.dalamud.Configuration.DutyFinderTaskbarFlash && !NativeFunctions.ApplicationIsActivated()) {
var flashInfo = new NativeFunctions.FLASHWINFO(); var flashInfo = new NativeFunctions.FLASHWINFO
flashInfo.cbSize = (uint)Marshal.SizeOf<NativeFunctions.FLASHWINFO>(); {
flashInfo.uCount = uint.MaxValue; cbSize = (uint)Marshal.SizeOf<NativeFunctions.FLASHWINFO>(),
flashInfo.dwTimeout = 0; uCount = uint.MaxValue,
flashInfo.dwFlags = NativeFunctions.FlashWindow.FLASHW_ALL | dwTimeout = 0,
NativeFunctions.FlashWindow.FLASHW_TIMERNOFG; dwFlags = NativeFunctions.FlashWindow.FLASHW_ALL |
flashInfo.hwnd = Process.GetCurrentProcess().MainWindowHandle; NativeFunctions.FlashWindow.FLASHW_TIMERNOFG,
hwnd = Process.GetCurrentProcess().MainWindowHandle
};
NativeFunctions.FlashWindowEx(ref flashInfo); NativeFunctions.FlashWindowEx(ref flashInfo);
} }

View file

@ -120,7 +120,7 @@ namespace Dalamud.Interface
asyncEnum = asyncEnum.Where( asyncEnum = asyncEnum.Where(
x => (x.Name.ToLower().Contains(this.searchText.ToLower()) || x => (x.Name.ToLower().Contains(this.searchText.ToLower()) ||
int.TryParse(this.searchText, out var parsedId) && int.TryParse(this.searchText, out var parsedId) &&
parsedId == x.RowId)); parsedId == x.RowId) && x.Icon < 65000);
} }
if (this.currentKind != 0) if (this.currentKind != 0)
@ -161,6 +161,7 @@ namespace Dalamud.Interface
if (ImGui.IsMouseDoubleClicked(0)) if (ImGui.IsMouseDoubleClicked(0))
{ {
if (this.selectedItemTex != null){
OnItemChosen?.Invoke(this, this.searchTask.Result[i]); OnItemChosen?.Invoke(this, this.searchTask.Result[i]);
if (this.closeOnChoose) if (this.closeOnChoose)
{ {
@ -172,6 +173,7 @@ namespace Dalamud.Interface
} }
} }
} }
}
else else
{ {
ImGui.TextColored(new Vector4(0.86f, 0.86f, 0.86f, 1.00f), Loc.Localize("DalamudItemSelectHint", "Type to start searching...")); ImGui.TextColored(new Vector4(0.86f, 0.86f, 0.86f, 1.00f), Loc.Localize("DalamudItemSelectHint", "Type to start searching..."));
@ -189,15 +191,17 @@ namespace Dalamud.Interface
ImGui.EndChild(); ImGui.EndChild();
// Darken choose button if it shouldn't be clickable // 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"))) { if (ImGui.Button(Loc.Localize("Choose", "Choose"))) {
try { try {
if (this.selectedItemTex != null) {
OnItemChosen?.Invoke(this, this.searchTask.Result[this.selectedItemIndex]); OnItemChosen?.Invoke(this, this.searchTask.Result[this.selectedItemIndex]);
if (this.closeOnChoose) { if (this.closeOnChoose) {
this.selectedItemTex?.Dispose(); this.selectedItemTex?.Dispose();
isOpen = false; isOpen = false;
} }
}
} catch (Exception ex) { } catch (Exception ex) {
Log.Error($"Exception in Choose: {ex.Message}"); 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(); ImGui.End();
return isOpen; return isOpen;