mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 20:33:40 +01:00
Double Click in ItemSearchWindow to link item
This commit is contained in:
parent
a80426bd0e
commit
f1384745eb
1 changed files with 13 additions and 0 deletions
|
|
@ -33,6 +33,7 @@ namespace Dalamud.Interface
|
|||
private int currentKind = 0;
|
||||
|
||||
private int selectedItemIndex = -1;
|
||||
private long selectedTime = 0;
|
||||
private TextureWrap selectedItemTex;
|
||||
|
||||
private CancellationTokenSource searchCancelTokenSource;
|
||||
|
|
@ -140,6 +141,7 @@ namespace Dalamud.Interface
|
|||
{
|
||||
if (ImGui.Selectable(this.searchTask.Result[i].Name, this.selectedItemIndex == i))
|
||||
{
|
||||
long nowTime = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||
this.selectedItemIndex = i;
|
||||
|
||||
try
|
||||
|
|
@ -156,6 +158,17 @@ namespace Dalamud.Interface
|
|||
this.selectedItemTex?.Dispose();
|
||||
this.selectedItemTex = null;
|
||||
}
|
||||
|
||||
if (this.selectedItemIndex == i && nowTime < (selectedTime + 1000))
|
||||
{
|
||||
OnItemChosen?.Invoke(this, this.searchTask.Result[i]);
|
||||
if (this.closeOnChoose)
|
||||
{
|
||||
this.selectedItemTex?.Dispose();
|
||||
isOpen = false;
|
||||
}
|
||||
}
|
||||
this.selectedTime = nowTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue