muffin v7.5.0
This commit is contained in:
parent
afafd5e377
commit
a6481e7b9a
67 changed files with 4281 additions and 2372 deletions
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
|
|
@ -59,6 +60,7 @@ internal sealed class QuestSelectionWindow : LWindow
|
|||
public QuestSelectionWindow(QuestData questData, IGameGui gameGui, IChatGui chatGui, QuestFunctions questFunctions, QuestController questController, QuestRegistry questRegistry, IDalamudPluginInterface pluginInterface, TerritoryData territoryData, IClientState clientState, UiUtils uiUtils, QuestTooltipComponent questTooltipComponent)
|
||||
: base("Quest Selection###QuestionableQuestSelection")
|
||||
{
|
||||
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
|
||||
_questData = questData;
|
||||
_gameGui = gameGui;
|
||||
_chatGui = chatGui;
|
||||
|
|
@ -72,10 +74,10 @@ internal sealed class QuestSelectionWindow : LWindow
|
|||
_questTooltipComponent = questTooltipComponent;
|
||||
base.Size = new Vector2(500f, 200f);
|
||||
base.SizeCondition = ImGuiCond.Once;
|
||||
base.SizeConstraints = new WindowSizeConstraints
|
||||
{
|
||||
MinimumSize = new Vector2(500f, 200f)
|
||||
};
|
||||
WindowSizeConstraints value = default(WindowSizeConstraints);
|
||||
((WindowSizeConstraints)(ref value))._002Ector();
|
||||
((WindowSizeConstraints)(ref value)).MinimumSize = new Vector2(500f, 200f);
|
||||
((Window)this).SizeConstraints = value;
|
||||
}
|
||||
|
||||
public unsafe void OpenForTarget(IGameObject? gameObject)
|
||||
|
|
@ -106,7 +108,7 @@ internal sealed class QuestSelectionWindow : LWindow
|
|||
|
||||
public unsafe void OpenForCurrentZone()
|
||||
{
|
||||
ushort territoryId = _clientState.TerritoryType;
|
||||
uint territoryId = _clientState.TerritoryType;
|
||||
string nameAndId = _territoryData.GetNameAndId(territoryId);
|
||||
base.WindowName = "Quests starting in " + nameAndId + "###QuestionableQuestSelection";
|
||||
_quests = (from x in _questRegistry.AllQuests
|
||||
|
|
@ -133,130 +135,145 @@ internal sealed class QuestSelectionWindow : LWindow
|
|||
|
||||
public override void DrawContent()
|
||||
{
|
||||
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
|
||||
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
|
||||
if (_offeredQuests.Count != 0)
|
||||
{
|
||||
ImGui.Checkbox("Only show quests currently offered", ref _onlyAvailableQuests);
|
||||
}
|
||||
using ImRaii.IEndObject endObject = ImRaii.Table("QuestSelection", 4, ImGuiTableFlags.Borders | ImGuiTableFlags.ScrollY);
|
||||
if (!endObject)
|
||||
TableDisposable val = ImRaii.Table((ImU8String)"QuestSelection", 4, ImGuiTableFlags.Borders | ImGuiTableFlags.ScrollY);
|
||||
try
|
||||
{
|
||||
ImGui.Text("Not table");
|
||||
return;
|
||||
}
|
||||
float x;
|
||||
using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push())
|
||||
{
|
||||
x = ImGui.CalcTextSize(FontAwesomeIcon.Copy.ToIconString()).X;
|
||||
}
|
||||
ImGui.PushFont(UiBuilder.IconFont);
|
||||
float initWidthOrWeight = ImGui.CalcTextSize(FontAwesomeIcon.Copy.ToIconString()).X + ImGui.CalcTextSize(FontAwesomeIcon.Copy.ToIconString()).X + ImGui.CalcTextSize(FontAwesomeIcon.Copy.ToIconString()).X + 6f * ImGui.GetStyle().FramePadding.X + 2f * ImGui.GetStyle().ItemSpacing.X;
|
||||
ImGui.PopFont();
|
||||
ImGui.TableSetupColumn("Id", ImGuiTableColumnFlags.WidthFixed, 50f * ImGui.GetIO().FontGlobalScale);
|
||||
ImGui.TableSetupColumn("", ImGuiTableColumnFlags.WidthFixed, x);
|
||||
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.None, 200f);
|
||||
ImGui.TableSetupColumn("Actions", ImGuiTableColumnFlags.WidthFixed, initWidthOrWeight);
|
||||
ImGui.TableHeadersRow();
|
||||
foreach (IQuestInfo item in (_offeredQuests.Count != 0 && _onlyAvailableQuests) ? _offeredQuests : _quests)
|
||||
{
|
||||
ImGui.TableNextRow();
|
||||
string text = item.QuestId.ToString();
|
||||
Quest quest;
|
||||
bool flag = _questRegistry.TryGetQuest(item.QuestId, out quest);
|
||||
if (ImGui.TableNextColumn())
|
||||
if (!val)
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.TextUnformatted(text);
|
||||
ImGui.Text("Not table");
|
||||
return;
|
||||
}
|
||||
if (ImGui.TableNextColumn())
|
||||
float x;
|
||||
using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push())
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
var (col, icon, _) = _uiUtils.GetQuestStyle(item.QuestId);
|
||||
using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push())
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
ImGui.TextColored(in col, icon.ToIconString());
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.TextColored(ImGuiColors.DalamudGrey, icon.ToIconString());
|
||||
}
|
||||
}
|
||||
if (ImGui.IsItemHovered())
|
||||
{
|
||||
_questTooltipComponent.Draw(item);
|
||||
}
|
||||
x = ImGui.CalcTextSize(FontAwesomeIcon.Copy.ToIconString()).X;
|
||||
}
|
||||
if (ImGui.TableNextColumn())
|
||||
ImGui.PushFont(UiBuilder.IconFont);
|
||||
float initWidthOrWeight = ImGui.CalcTextSize(FontAwesomeIcon.Copy.ToIconString()).X + ImGui.CalcTextSize(FontAwesomeIcon.Copy.ToIconString()).X + ImGui.CalcTextSize(FontAwesomeIcon.Copy.ToIconString()).X + 6f * ImGui.GetStyle().FramePadding.X + 2f * ImGui.GetStyle().ItemSpacing.X;
|
||||
ImGui.PopFont();
|
||||
ImGui.TableSetupColumn("Id", ImGuiTableColumnFlags.WidthFixed, 50f * ImGui.GetIO().FontGlobalScale);
|
||||
ImGui.TableSetupColumn("", ImGuiTableColumnFlags.WidthFixed, x);
|
||||
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.None, 200f);
|
||||
ImGui.TableSetupColumn("Actions", ImGuiTableColumnFlags.WidthFixed, initWidthOrWeight);
|
||||
ImGui.TableHeadersRow();
|
||||
foreach (IQuestInfo item in (_offeredQuests.Count != 0 && _onlyAvailableQuests) ? _offeredQuests : _quests)
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
if (quest != null && quest.Root.Disabled)
|
||||
ImGui.TableNextRow();
|
||||
string text = item.QuestId.ToString();
|
||||
Quest quest;
|
||||
bool flag = _questRegistry.TryGetQuest(item.QuestId, out quest);
|
||||
if (ImGui.TableNextColumn())
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.TextUnformatted(text);
|
||||
}
|
||||
if (ImGui.TableNextColumn())
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
var (col, icon, _) = _uiUtils.GetQuestStyle(item.QuestId);
|
||||
using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push())
|
||||
{
|
||||
ImGui.TextColored(ImGuiColors.DalamudOrange, FontAwesomeIcon.Ban.ToIconString());
|
||||
ImGui.SameLine();
|
||||
if (flag)
|
||||
{
|
||||
ImGui.TextColored(in col, icon.ToIconString());
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.TextColored(ImGuiColors.DalamudGrey, icon.ToIconString());
|
||||
}
|
||||
}
|
||||
}
|
||||
ImGui.TextUnformatted(item.Name);
|
||||
}
|
||||
if (!ImGui.TableNextColumn())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
using (ImRaii.PushId(text))
|
||||
{
|
||||
bool num = ImGuiComponents.IconButton(FontAwesomeIcon.Copy);
|
||||
if (ImGui.IsItemHovered())
|
||||
{
|
||||
ImGui.SetTooltip("Copy as file name");
|
||||
}
|
||||
if (num)
|
||||
{
|
||||
CopyToClipboard(item, suffix: true);
|
||||
}
|
||||
else if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
||||
{
|
||||
CopyToClipboard(item, suffix: false);
|
||||
}
|
||||
ImGui.SameLine();
|
||||
if (quest == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
EInteractionType? eInteractionType = quest.FindSequence(0)?.LastStep()?.InteractionType;
|
||||
if (!eInteractionType.HasValue || eInteractionType != EInteractionType.AcceptQuest || !_questFunctions.IsReadyToAcceptQuest(item.QuestId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
ImGui.BeginDisabled(_questController.NextQuest != null || _questController.SimulatedQuest != null);
|
||||
bool num2 = ImGuiComponents.IconButton(FontAwesomeIcon.Play);
|
||||
if (ImGui.IsItemHovered())
|
||||
{
|
||||
ImGui.SetTooltip("Start as next quest");
|
||||
}
|
||||
if (num2)
|
||||
{
|
||||
_questController.SetNextQuest(quest);
|
||||
if (!_questController.ManualPriorityQuests.Contains(quest))
|
||||
if (ImGui.IsItemHovered())
|
||||
{
|
||||
_questController.ManualPriorityQuests.Insert(0, quest);
|
||||
_questTooltipComponent.Draw(item);
|
||||
}
|
||||
_questController.Start("QuestSelectionWindow");
|
||||
}
|
||||
ImGui.SameLine();
|
||||
bool num3 = ImGuiComponents.IconButton(FontAwesomeIcon.AngleDoubleRight);
|
||||
if (ImGui.IsItemHovered())
|
||||
if (ImGui.TableNextColumn())
|
||||
{
|
||||
ImGui.SetTooltip("Set as next quest");
|
||||
ImGui.AlignTextToFramePadding();
|
||||
if (quest != null && quest.Root.Disabled)
|
||||
{
|
||||
using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push())
|
||||
{
|
||||
ImGui.TextColored(ImGuiColors.DalamudOrange, FontAwesomeIcon.Ban.ToIconString());
|
||||
ImGui.SameLine();
|
||||
}
|
||||
}
|
||||
ImGui.TextUnformatted(item.Name);
|
||||
}
|
||||
if (num3)
|
||||
if (!ImGui.TableNextColumn())
|
||||
{
|
||||
_questController.SetNextQuest(quest);
|
||||
continue;
|
||||
}
|
||||
IdDisposable val2 = ImRaii.PushId((ImU8String)text, true);
|
||||
try
|
||||
{
|
||||
bool num = ImGuiComponents.IconButton(FontAwesomeIcon.Copy);
|
||||
if (ImGui.IsItemHovered())
|
||||
{
|
||||
ImGui.SetTooltip("Copy as file name");
|
||||
}
|
||||
if (num)
|
||||
{
|
||||
CopyToClipboard(item, suffix: true);
|
||||
}
|
||||
else if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
||||
{
|
||||
CopyToClipboard(item, suffix: false);
|
||||
}
|
||||
ImGui.SameLine();
|
||||
if (quest == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
EInteractionType? eInteractionType = quest.FindSequence(0)?.LastStep()?.InteractionType;
|
||||
if (!eInteractionType.HasValue || eInteractionType != EInteractionType.AcceptQuest || !_questFunctions.IsReadyToAcceptQuest(item.QuestId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
ImGui.BeginDisabled(_questController.NextQuest != null || _questController.SimulatedQuest != null);
|
||||
bool num2 = ImGuiComponents.IconButton(FontAwesomeIcon.Play);
|
||||
if (ImGui.IsItemHovered())
|
||||
{
|
||||
ImGui.SetTooltip("Start as next quest");
|
||||
}
|
||||
if (num2)
|
||||
{
|
||||
_questController.SetNextQuest(quest);
|
||||
if (!_questController.ManualPriorityQuests.Contains(quest))
|
||||
{
|
||||
_questController.ManualPriorityQuests.Insert(0, quest);
|
||||
}
|
||||
_questController.Start("QuestSelectionWindow");
|
||||
}
|
||||
ImGui.SameLine();
|
||||
bool num3 = ImGuiComponents.IconButton(FontAwesomeIcon.AngleDoubleRight);
|
||||
if (ImGui.IsItemHovered())
|
||||
{
|
||||
ImGui.SetTooltip("Set as next quest");
|
||||
}
|
||||
if (num3)
|
||||
{
|
||||
_questController.SetNextQuest(quest);
|
||||
}
|
||||
ImGui.EndDisabled();
|
||||
}
|
||||
finally
|
||||
{
|
||||
((IDisposable)val2)?.Dispose();
|
||||
}
|
||||
ImGui.EndDisabled();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
((TableDisposable)(ref val)).Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private void CopyToClipboard(IQuestInfo quest, bool suffix)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue