qstbak/Questionable/Questionable.Windows/QuestSequenceWindow.cs
2026-05-01 05:17:35 +10:00

135 lines
4.4 KiB
C#

using System;
using System.Numerics;
using Dalamud.Bindings.ImGui;
using Dalamud.Interface.Utility.Raii;
using Dalamud.Interface.Windowing;
using Dalamud.Plugin;
using LLib.ImGui;
using Questionable.Model.Questing;
using Questionable.Windows.QuestComponents;
namespace Questionable.Windows;
internal sealed class QuestSequenceWindow : LWindow, IPersistableWindowConfig
{
private readonly IDalamudPluginInterface _pluginInterface;
private readonly Configuration _configuration;
private readonly QuestSequenceComponent _questSequenceComponent;
private bool _selectLookupTabNextFrame;
public WindowConfig WindowConfig => _configuration.QuestSequenceWindowConfig;
public QuestSequenceWindow(IDalamudPluginInterface pluginInterface, Configuration configuration, QuestSequenceComponent questSequenceComponent)
: base("Quest Sequence Viewer###QuestionableQuestSequenceViewer", ImGuiWindowFlags.NoTitleBar)
{
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
_pluginInterface = pluginInterface;
_configuration = configuration;
_questSequenceComponent = questSequenceComponent;
base.Size = new Vector2(950f, 700f);
base.SizeCondition = ImGuiCond.FirstUseEver;
WindowSizeConstraints value = default(WindowSizeConstraints);
((WindowSizeConstraints)(ref value))._002Ector();
((WindowSizeConstraints)(ref value)).MinimumSize = new Vector2(750f, 550f);
((WindowSizeConstraints)(ref value)).MaximumSize = new Vector2(float.MaxValue, float.MaxValue);
((Window)this).SizeConstraints = value;
}
public void SaveWindowConfig()
{
_pluginInterface.SavePluginConfig(_configuration);
}
public void OpenForQuest(ElementId questId)
{
_questSequenceComponent.SetLookedUpQuest(questId);
_selectLookupTabNextFrame = true;
base.IsOpenAndUncollapsed = true;
}
public override void DrawContent()
{
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
bool isOpen = base.IsOpen;
QuestSequenceComponent.DrawCustomHeader(ref isOpen);
base.IsOpen = isOpen;
ImGui.Spacing();
ImGui.Spacing();
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Tab, new Vector4(0.15f, 0.13f, 0.2f, 0.7f), true);
try
{
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.TabHovered, new Vector4(0.35f, 0.3f, 0.45f, 0.9f), true);
try
{
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.TabActive, new Vector4(0.28f, 0.24f, 0.35f, 1f), true);
try
{
TabBarDisposable val4 = ImRaii.TabBar((ImU8String)"QuestSequenceTabs", ImGuiTabBarFlags.None);
try
{
if (!val4)
{
return;
}
TabItemDisposable val5 = ImRaii.TabItem((ImU8String)"Current Quest", ImGuiTabItemFlags.None);
try
{
if (TabItemDisposable.op_Implicit(val5))
{
ImGui.Spacing();
_questSequenceComponent.DrawCurrentQuestTab();
}
}
finally
{
((TabItemDisposable)(ref val5)).Dispose();
}
ImGuiTabItemFlags imGuiTabItemFlags = (_selectLookupTabNextFrame ? ImGuiTabItemFlags.SetSelected : ImGuiTabItemFlags.None);
TabItemDisposable val6 = ImRaii.TabItem((ImU8String)"Quest Lookup", imGuiTabItemFlags);
try
{
if (TabItemDisposable.op_Implicit(val6))
{
ImGui.Spacing();
_questSequenceComponent.DrawQuestLookupTab();
}
}
finally
{
((TabItemDisposable)(ref val6)).Dispose();
}
_selectLookupTabNextFrame = false;
}
finally
{
((TabBarDisposable)(ref val4)).Dispose();
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
finally
{
((IDisposable)val)?.Dispose();
}
QuestSequenceComponent.DrawWindowBorder();
}
}