From a0f0a058fc57d3c7dfebe9dd989270cfe603f030 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Fri, 12 Jul 2024 14:37:54 +0200 Subject: [PATCH] Add some UI tooltips --- Questionable/Controller/GameUiController.cs | 4 +-- Questionable/Windows/QuestWindow.cs | 30 +++++++++++++++++---- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/Questionable/Controller/GameUiController.cs b/Questionable/Controller/GameUiController.cs index fdbf7d1c2..5f11dbf5f 100644 --- a/Questionable/Controller/GameUiController.cs +++ b/Questionable/Controller/GameUiController.cs @@ -192,13 +192,13 @@ internal sealed class GameUiController : IDisposable { var step = quest.FindSequence(currentQuest.Sequence)?.FindStep(currentQuest.Step); if (step == null) - _logger.LogInformation("Ignoring current quest dialogue choices, no active step"); + _logger.LogDebug("Ignoring current quest dialogue choices, no active step"); else dialogueChoices.AddRange(step.DialogueChoices.Select(x => new DialogueChoiceInfo(quest, x))); } } else - _logger.LogInformation("Ignoring current quest dialogue choices, no active quest"); + _logger.LogDebug("Ignoring current quest dialogue choices, no active quest"); // add all quests that start with the targeted npc var target = _targetManager.Target; diff --git a/Questionable/Windows/QuestWindow.cs b/Questionable/Windows/QuestWindow.cs index 0a6b81020..0d868109d 100644 --- a/Questionable/Windows/QuestWindow.cs +++ b/Questionable/Windows/QuestWindow.cs @@ -24,6 +24,7 @@ using Questionable.Data; using Questionable.External; using Questionable.Model; using Questionable.Model.V1; +using ObjectKind = Dalamud.Game.ClientState.Objects.Enums.ObjectKind; namespace Questionable.Windows; @@ -339,7 +340,10 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig } } else + { ImGui.Text("No active quest"); + ImGui.TextColored(ImGuiColors.DalamudGrey, $"{_questRegistry.Count} quests loaded"); + } } private unsafe void DrawCreationUtils() @@ -412,12 +416,18 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig ImGui.SameLine(); ImGui.BeginDisabled(!_questData.IsIssuerOfAnyQuest(_targetManager.Target.DataId)); - if (ImGuiComponents.IconButton(FontAwesomeIcon.Bars)) + bool showQuests = ImGuiComponents.IconButton(FontAwesomeIcon.Bars); + if (ImGui.IsItemHovered()) + ImGui.SetTooltip("Show all Quests starting with your current target."); + if (showQuests) _questData.ShowQuestsIssuedByTarget(); ImGui.EndDisabled(); ImGui.SameLine(); - if (ImGuiComponents.IconButton(FontAwesomeIcon.MousePointer)) + bool interact = ImGuiComponents.IconButton(FontAwesomeIcon.MousePointer); + if (ImGui.IsItemHovered()) + ImGui.SetTooltip("Interact with your current target."); + if (interact) { ulong result = TargetSystem.Instance()->InteractWithObject( (GameObject*)_targetManager.Target.Address, false); @@ -427,6 +437,8 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig ImGui.SameLine(); ImGuiComponents.IconButton(FontAwesomeIcon.Copy); + if (ImGui.IsItemHovered()) + ImGui.SetTooltip("Left click: Copy target position as JSON.\nRight click: Copy target position as C# code."); if (ImGui.IsItemClicked(ImGuiMouseButton.Left)) { string interactionType = gameObject->NamePlateIconId switch @@ -449,14 +461,22 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig } else if (ImGui.IsItemClicked(ImGuiMouseButton.Right)) { - EAetheryteLocation location = (EAetheryteLocation)_targetManager.Target.DataId; - ImGui.SetClipboardText(string.Create(CultureInfo.InvariantCulture, - $"{{EAetheryteLocation.{location}, new({_targetManager.Target.Position.X}f, {_targetManager.Target.Position.Y}f, {_targetManager.Target.Position.Z}f)}},")); + if (_targetManager.Target.ObjectKind == ObjectKind.Aetheryte) + { + EAetheryteLocation location = (EAetheryteLocation)_targetManager.Target.DataId; + ImGui.SetClipboardText(string.Create(CultureInfo.InvariantCulture, + $"{{EAetheryteLocation.{location}, new({_targetManager.Target.Position.X}f, {_targetManager.Target.Position.Y}f, {_targetManager.Target.Position.Z}f)}},")); + } + else + ImGui.SetClipboardText(string.Create(CultureInfo.InvariantCulture, + $"new({_targetManager.Target.Position.X}f, {_targetManager.Target.Position.Y}f, {_targetManager.Target.Position.Z}f)")); } } else { ImGuiComponents.IconButton(FontAwesomeIcon.Copy); + if (ImGui.IsItemHovered()) + ImGui.SetTooltip("Left click: Copy target position as JSON.\nRight click: Copy target position as C# code."); if (ImGui.IsItemClicked(ImGuiMouseButton.Left)) { ImGui.SetClipboardText($$"""