forked from aly/qstbak
muffin v7.4.10
This commit is contained in:
parent
2df81c5d15
commit
b8dd142c23
47 changed files with 3604 additions and 1058 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
|
|
@ -35,6 +36,8 @@ internal sealed class QuestSequenceComponent
|
|||
|
||||
private int _hoveredSequenceId = -1;
|
||||
|
||||
public bool HasLookedUpQuest => _lookedUpQuestId != null;
|
||||
|
||||
public QuestSequenceComponent(QuestData questData, QuestRegistry questRegistry, QuestFunctions questFunctions, IDataManager dataManager, ILogger<QuestSequenceComponent> logger)
|
||||
{
|
||||
_questData = questData;
|
||||
|
|
@ -96,6 +99,26 @@ internal sealed class QuestSequenceComponent
|
|||
{
|
||||
DrawEmptyState(FontAwesomeIcon.QuestionCircle, "No Active Quest", "Accept a quest to view its sequence information.", new Vector4(0.6f, 0.5f, 0.8f, 0.7f));
|
||||
}
|
||||
if (!(tuple.Item1 is QuestId questId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
ImGui.Spacing();
|
||||
if (ImGui.Button("Copy filename"))
|
||||
{
|
||||
if (_questData.TryGetQuestInfo(questId, out IQuestInfo questInfo))
|
||||
{
|
||||
ImGui.SetClipboardText(GetSequenceFilename(questId.Value, questInfo.Name));
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.SetClipboardText(GetSequenceFilename(questId.Value, questId.Value.ToString(CultureInfo.InvariantCulture)));
|
||||
}
|
||||
}
|
||||
if (ImGui.IsItemHovered())
|
||||
{
|
||||
ImGui.SetTooltip("Copies filename as QuestID_QuestNameWithSpaces.json");
|
||||
}
|
||||
}
|
||||
|
||||
public void DrawQuestLookupTab()
|
||||
|
|
@ -230,6 +253,25 @@ internal sealed class QuestSequenceComponent
|
|||
text.AppendFormatted(questId.Value);
|
||||
text.AppendLiteral(")");
|
||||
ImGui.TextColored(in col, text);
|
||||
ImGui.SameLine();
|
||||
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 8f);
|
||||
using (ImRaii.PushColor(ImGuiCol.Button, new Vector4(0.18f, 0.16f, 0.22f, 0.8f)))
|
||||
{
|
||||
using (ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.28f, 0.24f, 0.32f, 0.95f)))
|
||||
{
|
||||
using (ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.35f, 0.3f, 0.45f, 1f)))
|
||||
{
|
||||
if (ImGuiComponents.IconButton(FontAwesomeIcon.Copy))
|
||||
{
|
||||
ImGui.SetClipboardText(GetSequenceFilename(questId.Value, questInfo.Name));
|
||||
}
|
||||
if (ImGui.IsItemHovered())
|
||||
{
|
||||
ImGui.SetTooltip("Copies filename as QuestID_QuestNameWithSpaces.json");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (currentSequence.HasValue)
|
||||
{
|
||||
ImGui.SameLine();
|
||||
|
|
@ -592,4 +634,15 @@ internal sealed class QuestSequenceComponent
|
|||
}
|
||||
ImGui.SetCursorScreenPos(cursorScreenPos + new Vector2(0f, vector.Y));
|
||||
}
|
||||
|
||||
private static string GetSequenceFilename(int questId, string questName)
|
||||
{
|
||||
string value = (questName ?? string.Empty).Trim();
|
||||
return $"{questId}_{value}.json";
|
||||
}
|
||||
|
||||
public void SetLookedUpQuest(ElementId? id)
|
||||
{
|
||||
_lookedUpQuestId = id;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue