Add some UI tooltips
authorLiza Carvelli <liza@carvel.li>
Fri, 12 Jul 2024 12:37:54 +0000 (14:37 +0200)
committerLiza Carvelli <liza@carvel.li>
Fri, 12 Jul 2024 12:37:54 +0000 (14:37 +0200)
Questionable/Controller/GameUiController.cs
Questionable/Windows/QuestWindow.cs

index fdbf7d1c23be1cfeb59b3cfa1a2a6d234220cc5e..5f11dbf5f6fd4a83d8052df3b514a12f4da40221 100644 (file)
@@ -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;
index 0a6b81020538ecbeaf7bccc81cf234c5c43f52fe..0d868109db2ae42fbad9e9a3eb47dda6b8523846 100644 (file)
@@ -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($$"""