feat: allow ctrl- or middle-click
This commit is contained in:
parent
f538c12601
commit
4618b665d8
|
@ -416,7 +416,7 @@ namespace Glamaholic.Ui {
|
||||||
ImGui.CloseCurrentPopup();
|
ImGui.CloseCurrentPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.IsItemClicked(ImGuiMouseButton.Middle)) {
|
if (Util.IsItemMiddleOrCtrlClicked()) {
|
||||||
this.Ui.AlternativeFinders.Add(new AlternativeFinder(this.Ui, item));
|
this.Ui.AlternativeFinders.Add(new AlternativeFinder(this.Ui, item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -521,7 +521,7 @@ namespace Glamaholic.Ui {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mirage != null && mirage.ItemId != 0 && ImGui.IsItemClicked(ImGuiMouseButton.Middle)) {
|
if (mirage != null && mirage.ItemId != 0 && Util.IsItemMiddleOrCtrlClicked()) {
|
||||||
var item = this.Ui.Plugin.DataManager.GetExcelSheet<Item>()!.GetRow(mirage.ItemId);
|
var item = this.Ui.Plugin.DataManager.GetExcelSheet<Item>()!.GetRow(mirage.ItemId);
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
this.Ui.AlternativeFinders.Add(new AlternativeFinder(this.Ui, item));
|
this.Ui.AlternativeFinders.Add(new AlternativeFinder(this.Ui, item));
|
||||||
|
|
|
@ -82,6 +82,14 @@ namespace Glamaholic {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static bool IsItemMiddleOrCtrlClicked() {
|
||||||
|
if (ImGui.IsItemClicked(ImGuiMouseButton.Middle)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ImGui.GetIO().KeyCtrl && ImGui.IsItemClicked(ImGuiMouseButton.Left);
|
||||||
|
}
|
||||||
|
|
||||||
// https://github.com/ufx/GarlandTools/blob/5b2ec54dc792175a1d565fddb6c6b975b9a9ff64/Garland.Data/Hacks.cs#L89
|
// https://github.com/ufx/GarlandTools/blob/5b2ec54dc792175a1d565fddb6c6b975b9a9ff64/Garland.Data/Hacks.cs#L89
|
||||||
internal static bool IsItemSkipped(Item item) {
|
internal static bool IsItemSkipped(Item item) {
|
||||||
var name = item.Name.RawString;
|
var name = item.Name.RawString;
|
||||||
|
|
Loading…
Reference in New Issue