mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-18 14:44:16 +01:00
Disallow linking of invalid items.
This commit is contained in:
parent
aa58d9258b
commit
94c6546461
1 changed files with 19 additions and 10 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue