using System; using System.Numerics; using Dalamud.Bindings.ImGui; using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Windowing; using Dalamud.Plugin.Services; using LLib.ImGui; using Questionable.Controller; using Questionable.Windows.JournalComponents; namespace Questionable.Windows; internal sealed class JournalProgressWindow : LWindow, IDisposable { private readonly QuestJournalComponent _questJournalComponent; private readonly AlliedSocietyJournalComponent _alliedSocietyJournalComponent; private readonly QuestRewardComponent _questRewardComponent; private readonly GatheringJournalComponent _gatheringJournalComponent; private readonly DutyJournalComponent _dutyJournalComponent; private readonly QuestRegistry _questRegistry; private readonly IClientState _clientState; public JournalProgressWindow(QuestJournalComponent questJournalComponent, QuestRewardComponent questRewardComponent, AlliedSocietyJournalComponent alliedSocietyJournalComponent, GatheringJournalComponent gatheringJournalComponent, DutyJournalComponent dutyJournalComponent, QuestRegistry questRegistry, IClientState clientState) : base("Journal Progress###QuestionableJournalProgress") { //IL_011f: Unknown result type (might be due to invalid IL or missing references) _questJournalComponent = questJournalComponent; _alliedSocietyJournalComponent = alliedSocietyJournalComponent; _questRewardComponent = questRewardComponent; _gatheringJournalComponent = gatheringJournalComponent; _dutyJournalComponent = dutyJournalComponent; _questRegistry = questRegistry; _clientState = clientState; _clientState.Login += _questJournalComponent.RefreshCounts; _clientState.Logout += _dutyJournalComponent.ClearCounts; _clientState.Login += _gatheringJournalComponent.RefreshCounts; _clientState.Login += _dutyJournalComponent.RefreshCounts; _clientState.Logout += _questJournalComponent.ClearCounts; _clientState.Logout += _gatheringJournalComponent.ClearCounts; _questRegistry.Reloaded += OnQuestsReloaded; WindowSizeConstraints value = default(WindowSizeConstraints); ((WindowSizeConstraints)(ref value))._002Ector(); ((WindowSizeConstraints)(ref value)).MinimumSize = new Vector2(700f, 500f); ((Window)this).SizeConstraints = value; } private void OnQuestsReloaded(object? sender, EventArgs e) { _questJournalComponent.RefreshCounts(); _dutyJournalComponent.RefreshCounts(); _gatheringJournalComponent.RefreshCounts(); } public override void OnOpen() { _questJournalComponent.UpdateFilter(); _questJournalComponent.RefreshCounts(); _dutyJournalComponent.UpdateFilter(); _dutyJournalComponent.RefreshCounts(); _gatheringJournalComponent.UpdateFilter(); _gatheringJournalComponent.RefreshCounts(); } public override void DrawContent() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) TabBarDisposable val = ImRaii.TabBar((ImU8String)"Journal"); try { if (!(!val)) { _questJournalComponent.DrawQuests(); _dutyJournalComponent.DrawDuties(); _alliedSocietyJournalComponent.DrawAlliedSocietyQuests(); _questRewardComponent.DrawItemRewards(); _gatheringJournalComponent.DrawGatheringItems(); } } finally { ((TabBarDisposable)(ref val)).Dispose(); } } public void Dispose() { _questRegistry.Reloaded -= OnQuestsReloaded; _clientState.Logout -= _gatheringJournalComponent.ClearCounts; _clientState.Logout -= _questJournalComponent.ClearCounts; _clientState.Login -= _dutyJournalComponent.RefreshCounts; _clientState.Login -= _gatheringJournalComponent.RefreshCounts; _clientState.Logout -= _dutyJournalComponent.ClearCounts; _clientState.Login -= _questJournalComponent.RefreshCounts; } }