diff --git a/RotationSolver/UI/ImGuiHelper.cs b/RotationSolver/UI/ImGuiHelper.cs index 43a063629..7390c56ea 100644 --- a/RotationSolver/UI/ImGuiHelper.cs +++ b/RotationSolver/UI/ImGuiHelper.cs @@ -32,12 +32,12 @@ public static void DrawTooltip(Action act, string id) } } public static void DrawEnableTexture(this T texture, bool isSelected, Action selected, - Action showToolTip = null, Action> additionalHeader = null, + Action showToolTip = null, Action> additionalHeader = null, Action otherThing = null) where T : class, ITexture { showToolTip ??= text => { - if (!string.IsNullOrEmpty(text)) ImGui.SetTooltip(text); + if (!string.IsNullOrEmpty(text.Description)) ImGui.SetTooltip(text.Description); }; ImGui.PushStyleVar(ImGuiStyleVar.FramePadding, new Vector2(3f, 3f)); @@ -53,7 +53,7 @@ public static void DrawEnableTexture(this T texture, bool isSelected, Action var desc = texture?.Description; if (ImGui.IsItemHovered()) { - showToolTip(desc); + showToolTip(texture); if (ImGui.IsMouseClicked(ImGuiMouseButton.Left)) { selected?.Invoke(); @@ -72,7 +72,7 @@ public static void DrawEnableTexture(this T texture, bool isSelected, Action if (ImGui.IsItemHovered()) { - showToolTip(desc); + showToolTip(texture); } if(texture is IAction) @@ -386,15 +386,15 @@ public unsafe static void Display(this ICustomRotation rotation, ICustomRotation var t = IconSet.GetTexture(IconSet.GetJobIcon(rotation, IconType.Framed)); ImGui.Image(t.ImGuiHandle, new Vector2(t.Width, t.Height)); - if (!string.IsNullOrEmpty(text)) + if (!string.IsNullOrEmpty(text.Description)) { ImGui.SameLine(); ImGui.Text(" "); ImGui.SameLine(); - ImGui.Text(text); + ImGui.Text(text.Description); } - var type = rotation.GetType(); + var type = text.GetType(); var attrs = new List { RotationDescAttribute.MergeToOne(type.GetCustomAttributes()) }; @@ -407,7 +407,7 @@ public unsafe static void Display(this ICustomRotation rotation, ICustomRotation { foreach (var a in RotationDescAttribute.Merge(attrs)) { - RotationDescAttribute.MergeToOne(a)?.Display(rotation); + RotationDescAttribute.MergeToOne(a)?.Display(text); } } catch (Exception ex) @@ -420,7 +420,7 @@ public unsafe static void Display(this ICustomRotation rotation, ICustomRotation } ImGui.Text(ex.StackTrace); } - }, "Popup" + rotation.GetHashCode().ToString()); + }, "Popup" + text.GetHashCode().ToString()); }, showToolTip => { @@ -442,7 +442,7 @@ public unsafe static void Display(this ICustomRotation rotation, ICustomRotation } if (ImGui.IsItemHovered()) { - showToolTip?.Invoke(r.Description); + showToolTip?.Invoke(r); } ImGui.PopStyleColor(); }