Add some UI tooltips

pull/5/head
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);
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;

View 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
@ -448,15 +460,23 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig
""");
}
else if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
{
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($$"""