Add some UI tooltips

arr-p5
Liza 2024-07-12 14:37:54 +02:00
parent 995a0b7cdd
commit a0f0a058fc
Signed by: liza
GPG Key ID: 7199F8D727D55F67
2 changed files with 27 additions and 7 deletions

View File

@ -192,13 +192,13 @@ internal sealed class GameUiController : IDisposable
{ {
var step = quest.FindSequence(currentQuest.Sequence)?.FindStep(currentQuest.Step); var step = quest.FindSequence(currentQuest.Sequence)?.FindStep(currentQuest.Step);
if (step == null) if (step == null)
_logger.LogInformation("Ignoring current quest dialogue choices, no active step"); _logger.LogDebug("Ignoring current quest dialogue choices, no active step");
else else
dialogueChoices.AddRange(step.DialogueChoices.Select(x => new DialogueChoiceInfo(quest, x))); dialogueChoices.AddRange(step.DialogueChoices.Select(x => new DialogueChoiceInfo(quest, x)));
} }
} }
else 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 // add all quests that start with the targeted npc
var target = _targetManager.Target; var target = _targetManager.Target;

View File

@ -24,6 +24,7 @@ using Questionable.Data;
using Questionable.External; using Questionable.External;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
using ObjectKind = Dalamud.Game.ClientState.Objects.Enums.ObjectKind;
namespace Questionable.Windows; namespace Questionable.Windows;
@ -339,7 +340,10 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig
} }
} }
else else
{
ImGui.Text("No active quest"); ImGui.Text("No active quest");
ImGui.TextColored(ImGuiColors.DalamudGrey, $"{_questRegistry.Count} quests loaded");
}
} }
private unsafe void DrawCreationUtils() private unsafe void DrawCreationUtils()
@ -412,12 +416,18 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig
ImGui.SameLine(); ImGui.SameLine();
ImGui.BeginDisabled(!_questData.IsIssuerOfAnyQuest(_targetManager.Target.DataId)); 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(); _questData.ShowQuestsIssuedByTarget();
ImGui.EndDisabled(); ImGui.EndDisabled();
ImGui.SameLine(); 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( ulong result = TargetSystem.Instance()->InteractWithObject(
(GameObject*)_targetManager.Target.Address, false); (GameObject*)_targetManager.Target.Address, false);
@ -427,6 +437,8 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig
ImGui.SameLine(); ImGui.SameLine();
ImGuiComponents.IconButton(FontAwesomeIcon.Copy); 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)) if (ImGui.IsItemClicked(ImGuiMouseButton.Left))
{ {
string interactionType = gameObject->NamePlateIconId switch string interactionType = gameObject->NamePlateIconId switch
@ -449,14 +461,22 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig
} }
else if (ImGui.IsItemClicked(ImGuiMouseButton.Right)) else if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
{ {
EAetheryteLocation location = (EAetheryteLocation)_targetManager.Target.DataId; if (_targetManager.Target.ObjectKind == ObjectKind.Aetheryte)
ImGui.SetClipboardText(string.Create(CultureInfo.InvariantCulture, {
$"{{EAetheryteLocation.{location}, new({_targetManager.Target.Position.X}f, {_targetManager.Target.Position.Y}f, {_targetManager.Target.Position.Z}f)}},")); 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 else
{ {
ImGuiComponents.IconButton(FontAwesomeIcon.Copy); 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)) if (ImGui.IsItemClicked(ImGuiMouseButton.Left))
{ {
ImGui.SetClipboardText($$""" ImGui.SetClipboardText($$"""