From a6481e7b9a4a9e5143af7c44c14b6e8752bd1ca4 Mon Sep 17 00:00:00 2001 From: alydev Date: Fri, 1 May 2026 05:17:35 +1000 Subject: [PATCH] muffin v7.5.0 --- LLib/LLib.GameUI/LAtkValue.cs | 3 +- LLib/LLib.ImGui/LWindow.cs | 50 +- LLib/LLib.Shop/GrandCompanyShop.cs | 48 +- LLib/LLib.Shop/RegularShopBase.cs | 8 +- .../AssemblyQuestLoader.cs | 32 +- .../AethernetCommandHandler.cs | 2 +- .../ChocoboNameHandler.cs | 10 +- .../CraftworksSupplyController.cs | 21 +- .../InteractionUiController.cs | 25 +- .../ShopController.cs | 12 +- .../TurnInDelivery.cs | 6 +- .../UseItem.cs | 2 +- .../AethernetShortcut.cs | 4 +- .../AetheryteShortcut.cs | 4 +- .../ExtraConditionUtils.cs | 2 +- .../SkipCondition.cs | 4 +- .../PartyWatchDog.cs | 6 +- .../CombatController.cs | 2 +- .../Questionable.Data/AetheryteData.cs | 4 +- .../Questionable.Data/TerritoryData.cs | 24 +- .../AetheryteFunctions.cs | 2 +- .../Questionable.Functions/GameFunctions.cs | 6 +- .../ChangelogCategoryComponent.cs | 29 +- .../ChangelogEntryComponent.cs | 42 +- .../ChangelogFooterComponent.cs | 21 +- .../ChangelogHeaderComponent.cs | 14 +- .../BlacklistConfigComponent.cs | 232 +++-- .../ConfigComponent.cs | 58 +- .../DebugConfigComponent.cs | 235 ++--- .../DutyConfigComponent.cs | 606 ++++++++----- .../GeneralConfigComponent.cs | 787 ++++++++++------- .../NotificationConfigComponent.cs | 116 ++- .../PluginConfigComponent.cs | 90 +- .../SinglePlayerDutyConfigComponent.cs | 824 +++++++++++------- .../StopConditionComponent.cs | 277 +++--- .../AlliedSocietyJournalComponent.cs | 135 ++- .../DutyJournalComponent.cs | 205 +++-- .../GatheringJournalComponent.cs | 68 +- .../QuestJournalComponent.cs | 128 +-- .../QuestJournalUtils.cs | 187 ++-- .../QuestRewardComponent.cs | 60 +- .../ARealmRebornComponent.cs | 50 +- .../ActiveQuestComponent.cs | 343 +++++--- .../EventInfoComponent.cs | 13 +- .../ManualPriorityComponent.cs | 60 +- .../PresetBuilderComponent.cs | 54 +- .../QuestSequenceComponent.cs | 385 +++++--- .../QuestTooltipComponent.cs | 23 +- .../QuestValidationComponent.cs | 85 +- .../QuickAccessButtonsComponent.cs | 14 +- .../SavedPresetsComponent.cs | 112 ++- .../ValidationDetailsRenderer.cs | 130 ++- .../QuestSelector.cs | 12 +- .../Questionable.Windows/ChangelogWindow.cs | 114 ++- .../Questionable.Windows/ConfigWindow.cs | 38 +- .../FateSelectionWindow.cs | 151 +++- .../JournalProgressWindow.cs | 34 +- .../OneTimeSetupWindow.cs | 22 +- .../Questionable.Windows/PriorityWindow.cs | 83 +- .../QuestSelectionWindow.cs | 229 ++--- .../QuestSequenceWindow.cs | 93 +- .../QuestValidationWindow.cs | 9 +- .../Questionable.Windows/QuestWindow.cs | 29 +- .../SeasonalDutySelectionWindow.cs | 151 +++- .../Questionable/DalamudInitializer.cs | 24 +- ...BED51BF056C4__MultipleWhitespaceRegex_0.cs | 2 +- ...907141F781E9D97ABED51BF056C4__Utilities.cs | 2 +- 67 files changed, 4281 insertions(+), 2372 deletions(-) diff --git a/LLib/LLib.GameUI/LAtkValue.cs b/LLib/LLib.GameUI/LAtkValue.cs index b0643a9..2363798 100644 --- a/LLib/LLib.GameUI/LAtkValue.cs +++ b/LLib/LLib.GameUI/LAtkValue.cs @@ -8,7 +8,8 @@ public static class LAtkValue { public unsafe static string? ReadAtkString(this AtkValue atkValue) { - if (atkValue.Type == FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Undefined) + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + if ((int)atkValue.Type == 0) { return null; } diff --git a/LLib/LLib.ImGui/LWindow.cs b/LLib/LLib.ImGui/LWindow.cs index a355121..6a3ad29 100644 --- a/LLib/LLib.ImGui/LWindow.cs +++ b/LLib/LLib.ImGui/LWindow.cs @@ -1,4 +1,3 @@ -using System.Runtime.CompilerServices; using Dalamud.Bindings.ImGui; using Dalamud.Interface.Windowing; @@ -33,39 +32,15 @@ public abstract class LWindow : Window } } - protected new bool IsPinned - { - get - { - return InternalIsPinned(this); - } - set - { - InternalIsPinned(this) = value; - } - } - - protected new bool IsClickthrough - { - get - { - return InternalIsClickthrough(this); - } - set - { - InternalIsClickthrough(this) = value; - } - } - protected int? Alpha { get { - return (int?)(100000f * InternalAlpha(this)); + return (int?)(100000f * base.BgAlpha); } set { - InternalAlpha(this) = (float?)value / 100000f; + base.BgAlpha = (float?)value / 100000f; } } @@ -85,11 +60,11 @@ public abstract class LWindow : Window { if (base.AllowPinning) { - IsPinned = windowConfig.IsPinned; + base.IsPinned = windowConfig.IsPinned; } if (base.AllowClickthrough) { - IsClickthrough = windowConfig.IsClickthrough; + base.IsClickthrough = windowConfig.IsClickthrough; } Alpha = windowConfig.Alpha; } @@ -106,14 +81,14 @@ public abstract class LWindow : Window if (windowConfig != null) { bool flag = false; - if (base.AllowPinning && windowConfig.IsPinned != IsPinned) + if (base.AllowPinning && windowConfig.IsPinned != base.IsPinned) { - windowConfig.IsPinned = IsPinned; + windowConfig.IsPinned = base.IsPinned; flag = true; } - if (base.AllowClickthrough && windowConfig.IsClickthrough != IsClickthrough) + if (base.AllowClickthrough && windowConfig.IsClickthrough != base.IsClickthrough) { - windowConfig.IsClickthrough = IsClickthrough; + windowConfig.IsClickthrough = base.IsClickthrough; flag = true; } if (windowConfig.Alpha != Alpha) @@ -176,13 +151,4 @@ public abstract class LWindow : Window UpdateWindowConfig(); } } - - [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "internalIsPinned")] - private static extern ref bool InternalIsPinned(Window @this); - - [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "internalIsClickthrough")] - private static extern ref bool InternalIsClickthrough(Window @this); - - [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "internalAlpha")] - private static extern ref float? InternalAlpha(Window @this); } diff --git a/LLib/LLib.Shop/GrandCompanyShop.cs b/LLib/LLib.Shop/GrandCompanyShop.cs index a4cea2c..2803480 100644 --- a/LLib/LLib.Shop/GrandCompanyShop.cs +++ b/LLib/LLib.Shop/GrandCompanyShop.cs @@ -1,4 +1,5 @@ using System; +using System.Runtime.CompilerServices; using Dalamud.Game.Addon.Lifecycle; using Dalamud.Game.Addon.Lifecycle.AddonArgTypes; using Dalamud.Plugin.Services; @@ -222,10 +223,11 @@ public sealed class GrandCompanyShop : IDisposable private unsafe void FireCallback(AtkUnitBase* addon, params int[] args) { + //IL_001e: Unknown result type (might be due to invalid IL or missing references) AtkValue* ptr = stackalloc AtkValue[args.Length]; for (int i = 0; i < args.Length; i++) { - ptr[i].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int; + Unsafe.Write(&ptr[i].Type, (AtkValueType)3); ptr[i].Int = args[i]; } addon->FireCallback((uint)args.Length, ptr); @@ -233,48 +235,64 @@ public sealed class GrandCompanyShop : IDisposable private unsafe void FirePurchaseCallback(AtkUnitBase* addon, GrandCompanyItem item) { + //IL_000f: Unknown result type (might be due to invalid IL or missing references) + //IL_0024: Unknown result type (might be due to invalid IL or missing references) + //IL_0048: Unknown result type (might be due to invalid IL or missing references) + //IL_006a: Unknown result type (might be due to invalid IL or missing references) + //IL_008c: Unknown result type (might be due to invalid IL or missing references) + //IL_00ae: Unknown result type (might be due to invalid IL or missing references) + //IL_00d0: Unknown result type (might be due to invalid IL or missing references) + //IL_00f7: Unknown result type (might be due to invalid IL or missing references) + //IL_011e: Unknown result type (might be due to invalid IL or missing references) AtkValue* ptr = stackalloc AtkValue[9]; - ptr->Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int; + Unsafe.Write(&ptr->Type, (AtkValueType)3); ptr->Int = 0; - ptr[1].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int; + Unsafe.Write(&ptr[1].Type, (AtkValueType)3); ptr[1].Int = item.Index; - ptr[2].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int; + Unsafe.Write(&ptr[2].Type, (AtkValueType)3); ptr[2].Int = 1; - ptr[3].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int; + Unsafe.Write(&ptr[3].Type, (AtkValueType)3); ptr[3].Int = 0; - ptr[4].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int; + Unsafe.Write(&ptr[4].Type, (AtkValueType)3); ptr[4].Int = 0; - ptr[5].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int; + Unsafe.Write(&ptr[5].Type, (AtkValueType)3); ptr[5].Int = 0; - ptr[6].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.UInt; + Unsafe.Write(&ptr[6].Type, (AtkValueType)5); ptr[6].UInt = item.ItemId; - ptr[7].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.UInt; + Unsafe.Write(&ptr[7].Type, (AtkValueType)5); ptr[7].UInt = item.IconId; - ptr[8].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.UInt; + Unsafe.Write(&ptr[8].Type, (AtkValueType)5); ptr[8].UInt = item.SealCost; addon->FireCallback(9u, ptr); } private unsafe static void ClickYes(AtkUnitBase* addon) { + //IL_000e: Unknown result type (might be due to invalid IL or missing references) AtkValue* ptr = stackalloc AtkValue[1]; - ptr->Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int; + Unsafe.Write(&ptr->Type, (AtkValueType)3); ptr->Int = 0; addon->FireCallback(1u, ptr); } private unsafe static int GetAtkValueInt(AtkUnitBase* addon, int index) { + //IL_0035: Unknown result type (might be due to invalid IL or missing references) + //IL_003a: Unknown result type (might be due to invalid IL or missing references) + //IL_003b: Unknown result type (might be due to invalid IL or missing references) + //IL_003d: Unknown result type (might be due to invalid IL or missing references) + //IL_0053: Expected I4, but got Unknown if (addon == null || addon->AtkValues == null || index < 0 || index >= addon->AtkValuesCount) { return -1; } AtkValue atkValue = addon->AtkValues[index]; - return atkValue.Type switch + AtkValueType type = atkValue.Type; + return (type - 2) switch { - FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int => atkValue.Int, - FFXIVClientStructs.FFXIV.Component.GUI.ValueType.UInt => (int)atkValue.UInt, - FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Bool => (atkValue.Byte != 0) ? 1 : 0, + 1 => atkValue.Int, + 3 => (int)atkValue.UInt, + 0 => (atkValue.Byte != 0) ? 1 : 0, _ => -1, }; } diff --git a/LLib/LLib.Shop/RegularShopBase.cs b/LLib/LLib.Shop/RegularShopBase.cs index b3fd1f8..1006416 100644 --- a/LLib/LLib.Shop/RegularShopBase.cs +++ b/LLib/LLib.Shop/RegularShopBase.cs @@ -91,10 +91,10 @@ public class RegularShopBase short num = 0; short num2 = 0; address->GetPosition(&num, &num2); - short num3 = 0; - short num4 = 0; - address->GetSize(&num3, &num4, scaled: true); - num += num3; + ushort num3 = 0; + ushort num4 = 0; + address->GetSize(&num3, &num4, true); + num += (short)num3; Vector2? position = _parentWindow.Position; if (position.HasValue) { diff --git a/QuestPaths/Questionable.QuestPaths/AssemblyQuestLoader.cs b/QuestPaths/Questionable.QuestPaths/AssemblyQuestLoader.cs index 491c956..be01124 100644 --- a/QuestPaths/Questionable.QuestPaths/AssemblyQuestLoader.cs +++ b/QuestPaths/Questionable.QuestPaths/AssemblyQuestLoader.cs @@ -103944,7 +103944,7 @@ public static class AssemblyQuestLoader CollectionsMarshal.SetCount(list351, num); CollectionsMarshal.AsSpan(list351)[0] = "JerryWester"; questRoot48.Author = list351; - num = 6; + num = 7; List list352 = new List(num); CollectionsMarshal.SetCount(list352, num); Span span146 = CollectionsMarshal.AsSpan(list352); @@ -104037,7 +104037,11 @@ public static class AssemblyQuestLoader }; obj231.Steps = list358; reference260 = obj231; - ref QuestSequence reference261 = ref span146[5]; + span146[5] = new QuestSequence + { + Sequence = 5 + }; + ref QuestSequence reference261 = ref span146[6]; QuestSequence obj232 = new QuestSequence { Sequence = byte.MaxValue @@ -167020,7 +167024,7 @@ public static class AssemblyQuestLoader CollectionsMarshal.SetCount(list136, num); CollectionsMarshal.AsSpan(list136)[0] = "liza"; questRoot14.Author = list136; - num = 8; + num = 9; List list137 = new List(num); CollectionsMarshal.SetCount(list137, num); Span span51 = CollectionsMarshal.AsSpan(list137); @@ -167137,7 +167141,11 @@ public static class AssemblyQuestLoader }; obj103.Steps = list144; reference116 = obj103; - ref QuestSequence reference117 = ref span51[7]; + span51[7] = new QuestSequence + { + Sequence = 7 + }; + ref QuestSequence reference117 = ref span51[8]; QuestSequence obj104 = new QuestSequence { Sequence = byte.MaxValue @@ -167331,7 +167339,7 @@ public static class AssemblyQuestLoader CollectionsMarshal.SetCount(list160, num); CollectionsMarshal.AsSpan(list160)[0] = "liza"; questRoot16.Author = list160; - num = 5; + num = 6; List list161 = new List(num); CollectionsMarshal.SetCount(list161, num); Span span53 = CollectionsMarshal.AsSpan(list161); @@ -167483,7 +167491,11 @@ public static class AssemblyQuestLoader }; obj121.Steps = list168; reference136 = obj121; - ref QuestSequence reference137 = ref span53[4]; + span53[4] = new QuestSequence + { + Sequence = 4 + }; + ref QuestSequence reference137 = ref span53[5]; QuestSequence obj122 = new QuestSequence { Sequence = byte.MaxValue @@ -285052,7 +285064,7 @@ public static class AssemblyQuestLoader CollectionsMarshal.SetCount(list24, num); CollectionsMarshal.AsSpan(list24)[0] = "liza"; questRoot4.Author = list24; - num = 3; + num = 4; List list25 = new List(num); CollectionsMarshal.SetCount(list25, num); Span span9 = CollectionsMarshal.AsSpan(list25); @@ -285086,7 +285098,11 @@ public static class AssemblyQuestLoader }; obj16.Steps = list27; reference19 = obj16; - ref QuestSequence reference20 = ref span9[2]; + span9[2] = new QuestSequence + { + Sequence = 2 + }; + ref QuestSequence reference20 = ref span9[3]; QuestSequence obj17 = new QuestSequence { Sequence = byte.MaxValue diff --git a/Questionable/Questionable.Controller.DebugCommands/AethernetCommandHandler.cs b/Questionable/Questionable.Controller.DebugCommands/AethernetCommandHandler.cs index f56905b..9b16ac1 100644 --- a/Questionable/Questionable.Controller.DebugCommands/AethernetCommandHandler.cs +++ b/Questionable/Questionable.Controller.DebugCommands/AethernetCommandHandler.cs @@ -31,7 +31,7 @@ internal sealed class AethernetCommandHandler : IDebugCommandHandler public void Execute(string[] arguments) { - ushort territoryType = _clientState.TerritoryType; + uint territoryType = _clientState.TerritoryType; Dictionary values = AethernetShardConverter.Values; AetheryteData aetheryteData = new AetheryteData(_dataManager); HashSet hashSet = new HashSet(); diff --git a/Questionable/Questionable.Controller.GameUi/ChocoboNameHandler.cs b/Questionable/Questionable.Controller.GameUi/ChocoboNameHandler.cs index 621d8c0..247a372 100644 --- a/Questionable/Questionable.Controller.GameUi/ChocoboNameHandler.cs +++ b/Questionable/Questionable.Controller.GameUi/ChocoboNameHandler.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; using Dalamud.Game.Addon.Lifecycle; @@ -113,6 +114,8 @@ internal sealed class ChocoboNameHandler : IDisposable private unsafe void FireInputStringCallback(AtkUnitBase* addon, string text) { + //IL_005b: Unknown result type (might be due to invalid IL or missing references) + //IL_00a1: Unknown result type (might be due to invalid IL or missing references) AtkComponentNode* componentNodeById = addon->GetComponentNodeById(9u); if (componentNodeById == null) { @@ -127,13 +130,13 @@ internal sealed class ChocoboNameHandler : IDisposable } asAtkComponentTextInput->SetText(text); AtkValue* ptr = stackalloc AtkValue[2]; - ptr->Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int; + Unsafe.Write(&ptr->Type, (AtkValueType)3); ptr->Int = 0; byte[] bytes = Encoding.UTF8.GetBytes(text); nint num = Marshal.AllocHGlobal(bytes.Length + 1); Marshal.Copy(bytes, 0, num, bytes.Length); Marshal.WriteByte(num + bytes.Length, 0); - ptr[1].Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.String; + Unsafe.Write(&ptr[1].Type, (AtkValueType)8); ptr[1].String = (byte*)num; addon->FireCallback(2u, ptr); Marshal.FreeHGlobal(num); @@ -141,8 +144,9 @@ internal sealed class ChocoboNameHandler : IDisposable private unsafe static void ClickYes(AtkUnitBase* addon) { + //IL_000e: Unknown result type (might be due to invalid IL or missing references) AtkValue* ptr = stackalloc AtkValue[1]; - ptr->Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int; + Unsafe.Write(&ptr->Type, (AtkValueType)3); ptr->Int = 0; addon->FireCallback(1u, ptr); } diff --git a/Questionable/Questionable.Controller.GameUi/CraftworksSupplyController.cs b/Questionable/Questionable.Controller.GameUi/CraftworksSupplyController.cs index 45b61dc..67cff8c 100644 --- a/Questionable/Questionable.Controller.GameUi/CraftworksSupplyController.cs +++ b/Questionable/Questionable.Controller.GameUi/CraftworksSupplyController.cs @@ -54,6 +54,8 @@ internal sealed class CraftworksSupplyController : IDisposable private unsafe void InteractWithBankaCraftworksSupply(AtkUnitBase* addon) { + //IL_006d: Unknown result type (might be due to invalid IL or missing references) + //IL_0093: Unknown result type (might be due to invalid IL or missing references) AtkValue* atkValues = addon->AtkValues; uint uInt = atkValues[7].UInt; uint num = 6 - uInt; @@ -66,12 +68,12 @@ internal sealed class CraftworksSupplyController : IDisposable { new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int, + Type = (AtkValueType)3, Int = 2 }, new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int, + Type = (AtkValueType)3, Int = i } }; @@ -88,6 +90,11 @@ internal sealed class CraftworksSupplyController : IDisposable private unsafe void ContextIconMenuPostReceiveEvent(AddonEvent type, AddonArgs args) { + //IL_0084: Unknown result type (might be due to invalid IL or missing references) + //IL_00aa: Unknown result type (might be due to invalid IL or missing references) + //IL_00d3: Unknown result type (might be due to invalid IL or missing references) + //IL_0100: Unknown result type (might be due to invalid IL or missing references) + //IL_0129: Unknown result type (might be due to invalid IL or missing references) if (!ShouldHandleUiInteractions) { return; @@ -110,27 +117,27 @@ internal sealed class CraftworksSupplyController : IDisposable { new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int, + Type = (AtkValueType)3, Int = 0 }, new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int, + Type = (AtkValueType)3, Int = 0 }, new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.UInt, + Type = (AtkValueType)5, UInt = 20802u }, new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.UInt, + Type = (AtkValueType)5, UInt = 0u }, new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Undefined, + Type = (AtkValueType)0, Int = 0 } }; diff --git a/Questionable/Questionable.Controller.GameUi/InteractionUiController.cs b/Questionable/Questionable.Controller.GameUi/InteractionUiController.cs index ac3dee9..043ba54 100644 --- a/Questionable/Questionable.Controller.GameUi/InteractionUiController.cs +++ b/Questionable/Questionable.Controller.GameUi/InteractionUiController.cs @@ -186,6 +186,8 @@ internal sealed class InteractionUiController : IDisposable private unsafe void SelectStringPostSetup(AddonSelectString* addonSelectString, bool checkAllSteps) { + //IL_004c: Unknown result type (might be due to invalid IL or missing references) + //IL_0052: Invalid comparison between Unknown and I4 if (!ShouldHandleUiInteractions) { return; @@ -198,7 +200,7 @@ internal sealed class InteractionUiController : IDisposable List list = new List(); for (ushort num = 7; num < addonSelectString->AtkUnitBase.AtkValuesCount; num++) { - if (addonSelectString->AtkUnitBase.AtkValues[(int)num].Type == FFXIVClientStructs.FFXIV.Component.GUI.ValueType.String) + if ((int)addonSelectString->AtkUnitBase.AtkValues[(int)num].Type == 8) { list.Add(addonSelectString->AtkUnitBase.AtkValues[(int)num].ReadAtkString()); } @@ -872,6 +874,8 @@ internal sealed class InteractionUiController : IDisposable private unsafe void DifficultySelectYesNoPostSetup(AtkUnitBase* addonDifficultySelectYesNo, bool checkAllSteps) { + //IL_00f6: Unknown result type (might be due to invalid IL or missing references) + //IL_011c: Unknown result type (might be due to invalid IL or missing references) if (!_questController.IsRunning) { return; @@ -899,12 +903,12 @@ internal sealed class InteractionUiController : IDisposable { new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int, + Type = (AtkValueType)3, Int = 0 }, new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int, + Type = (AtkValueType)3, Int = _configuration.SinglePlayerDuties.RetryDifficulty } }; @@ -992,6 +996,8 @@ internal sealed class InteractionUiController : IDisposable private unsafe void PointMenuPostSetup(AtkUnitBase* addonPointMenu) { + //IL_00f5: Unknown result type (might be due to invalid IL or missing references) + //IL_011c: Unknown result type (might be due to invalid IL or missing references) if (!ShouldHandleUiInteractions) { return; @@ -1029,12 +1035,12 @@ internal sealed class InteractionUiController : IDisposable { new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int, + Type = (AtkValueType)3, Int = 13 }, new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.UInt, + Type = (AtkValueType)5, UInt = num } }; @@ -1054,6 +1060,9 @@ internal sealed class InteractionUiController : IDisposable private unsafe void EasterMowingResultPostSetup(AddonEvent type, AddonArgs args) { + //IL_004d: Unknown result type (might be due to invalid IL or missing references) + //IL_0072: Unknown result type (might be due to invalid IL or missing references) + //IL_009a: Unknown result type (might be due to invalid IL or missing references) if (_seasonalDutyController.IsRunning || ShouldHandleUiInteractions) { _logger.LogInformation("Dismissing EasterMowingResult"); @@ -1062,17 +1071,17 @@ internal sealed class InteractionUiController : IDisposable { new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int, + Type = (AtkValueType)3, Int = -1 }, new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int, + Type = (AtkValueType)3, Int = 1 }, new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int, + Type = (AtkValueType)3, Int = 1 } }; diff --git a/Questionable/Questionable.Controller.GameUi/ShopController.cs b/Questionable/Questionable.Controller.GameUi/ShopController.cs index 08f2c2e..8e8ae51 100644 --- a/Questionable/Questionable.Controller.GameUi/ShopController.cs +++ b/Questionable/Questionable.Controller.GameUi/ShopController.cs @@ -137,26 +137,30 @@ internal sealed class ShopController : IDisposable, IShopWindow public unsafe void TriggerPurchase(AtkUnitBase* addonShop, int buyNow) { + //IL_0016: Unknown result type (might be due to invalid IL or missing references) + //IL_003b: Unknown result type (might be due to invalid IL or missing references) + //IL_0072: Unknown result type (might be due to invalid IL or missing references) + //IL_009a: Unknown result type (might be due to invalid IL or missing references) AtkValue* values = stackalloc AtkValue[4] { new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int, + Type = (AtkValueType)3, Int = 0 }, new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int, + Type = (AtkValueType)3, Int = _shop.ItemForSale.Position }, new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Int, + Type = (AtkValueType)3, Int = buyNow }, new AtkValue { - Type = FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Undefined, + Type = (AtkValueType)0, Int = 0 } }; diff --git a/Questionable/Questionable.Controller.Steps.Gathering/TurnInDelivery.cs b/Questionable/Questionable.Controller.Steps.Gathering/TurnInDelivery.cs index 62f3a61..fb2f57e 100644 --- a/Questionable/Questionable.Controller.Steps.Gathering/TurnInDelivery.cs +++ b/Questionable/Questionable.Controller.Steps.Gathering/TurnInDelivery.cs @@ -41,6 +41,8 @@ internal static class TurnInDelivery public unsafe override ETaskResult Update() { + //IL_0180: Unknown result type (might be due to invalid IL or missing references) + //IL_01a6: Unknown result type (might be due to invalid IL or missing references) AgentSatisfactionSupply* ptr = AgentSatisfactionSupply.Instance(); if (ptr == null || !ptr->IsAgentActive()) { @@ -87,12 +89,12 @@ internal static class TurnInDelivery { new AtkValue { - Type = ValueType.Int, + Type = (AtkValueType)3, Int = 1 }, new AtkValue { - Type = ValueType.Int, + Type = (AtkValueType)3, Int = 1 } }; diff --git a/Questionable/Questionable.Controller.Steps.Interactions/UseItem.cs b/Questionable/Questionable.Controller.Steps.Interactions/UseItem.cs index 2f38989..785ac38 100644 --- a/Questionable/Questionable.Controller.Steps.Interactions/UseItem.cs +++ b/Questionable/Questionable.Controller.Steps.Interactions/UseItem.cs @@ -50,7 +50,7 @@ internal static class UseItem return new global::_003C_003Ez__ReadOnlyArray(new ITask[4] { useOnSelf, - new WaitCondition.Task(() => clientState.TerritoryType == 140, "Wait(territory: " + territoryData.GetNameAndId(140) + ")"), + new WaitCondition.Task(() => clientState.TerritoryType == 140, "Wait(territory: " + territoryData.GetNameAndId(140u) + ")"), new Mount.MountTask(140, position.HasValue ? Mount.EMountIf.AwayFromPosition : Mount.EMountIf.Always, position), new MoveTask(140, new Vector3(-408.92343f, 23.167036f, -351.16223f), null, 0.25f, null, DisableNavmesh: true, false, Fly: false, Land: false, IgnoreDistanceToObject: false, RestartNavigation: true, EInteractionType.WalkTo) }); diff --git a/Questionable/Questionable.Controller.Steps.Shared/AethernetShortcut.cs b/Questionable/Questionable.Controller.Steps.Shared/AethernetShortcut.cs index 8071c56..dc3b027 100644 --- a/Questionable/Questionable.Controller.Steps.Shared/AethernetShortcut.cs +++ b/Questionable/Questionable.Controller.Steps.Shared/AethernetShortcut.cs @@ -70,7 +70,7 @@ internal static class AethernetShortcut logger.LogInformation("Skipping aethernet shortcut because the target is in the same territory"); return false; } - if (base.Task.SkipConditions.InTerritory.Contains(clientState.TerritoryType)) + if (base.Task.SkipConditions.InTerritory.Contains((ushort)clientState.TerritoryType)) { logger.LogInformation("Skipping aethernet shortcut because the target is in the specified territory"); return false; @@ -98,7 +98,7 @@ internal static class AethernetShortcut } if (aetheryteFunctions.IsAetheryteUnlocked(base.Task.From) && aetheryteFunctions.IsAetheryteUnlocked(base.Task.To)) { - ushort territoryType = clientState.TerritoryType; + uint territoryType = clientState.TerritoryType; IGameObject gameObject = objectTable[0]; if (gameObject == null) { diff --git a/Questionable/Questionable.Controller.Steps.Shared/AetheryteShortcut.cs b/Questionable/Questionable.Controller.Steps.Shared/AetheryteShortcut.cs index 5a00a82..2ee3712 100644 --- a/Questionable/Questionable.Controller.Steps.Shared/AetheryteShortcut.cs +++ b/Questionable/Questionable.Controller.Steps.Shared/AetheryteShortcut.cs @@ -77,13 +77,13 @@ internal static class AetheryteShortcut private bool ShouldSkipTeleport() { - ushort territoryType = clientState.TerritoryType; + uint territoryType = clientState.TerritoryType; if (base.Task.Step != null) { SkipAetheryteCondition skipAetheryteCondition = base.Task.Step.SkipConditions?.AetheryteShortcutIf ?? new SkipAetheryteCondition(); if (skipAetheryteCondition != null && !skipAetheryteCondition.Never) { - if (skipAetheryteCondition.InTerritory.Contains(territoryType)) + if (skipAetheryteCondition.InTerritory.Contains((ushort)territoryType)) { logger.LogInformation("Skipping aetheryte teleport due to SkipCondition (InTerritory)"); return true; diff --git a/Questionable/Questionable.Controller.Steps.Shared/ExtraConditionUtils.cs b/Questionable/Questionable.Controller.Steps.Shared/ExtraConditionUtils.cs index 0f12b04..4affed9 100644 --- a/Questionable/Questionable.Controller.Steps.Shared/ExtraConditionUtils.cs +++ b/Questionable/Questionable.Controller.Steps.Shared/ExtraConditionUtils.cs @@ -27,7 +27,7 @@ internal sealed class ExtraConditionUtils return false; } - public static bool MatchesExtraCondition(EExtraSkipCondition skipCondition, Vector3 position, ushort territoryType) + public static bool MatchesExtraCondition(EExtraSkipCondition skipCondition, Vector3 position, uint territoryType) { return skipCondition switch { diff --git a/Questionable/Questionable.Controller.Steps.Shared/SkipCondition.cs b/Questionable/Questionable.Controller.Steps.Shared/SkipCondition.cs index 0c8ffe0..18a5b35 100644 --- a/Questionable/Questionable.Controller.Steps.Shared/SkipCondition.cs +++ b/Questionable/Questionable.Controller.Steps.Shared/SkipCondition.cs @@ -157,12 +157,12 @@ internal static class SkipCondition private bool CheckTerritoryCondition(SkipStepConditions skipConditions) { - if (skipConditions.InTerritory.Count > 0 && skipConditions.InTerritory.Contains(clientState.TerritoryType)) + if (skipConditions.InTerritory.Count > 0 && skipConditions.InTerritory.Contains((ushort)clientState.TerritoryType)) { logger.LogInformation("Skipping step, as in a skip.InTerritory"); return true; } - if (skipConditions.NotInTerritory.Count > 0 && !skipConditions.NotInTerritory.Contains(clientState.TerritoryType)) + if (skipConditions.NotInTerritory.Count > 0 && !skipConditions.NotInTerritory.Contains((ushort)clientState.TerritoryType)) { logger.LogInformation("Skipping step, as not in a skip.NotInTerritory"); return true; diff --git a/Questionable/Questionable.Controller.Utils/PartyWatchDog.cs b/Questionable/Questionable.Controller.Utils/PartyWatchDog.cs index c5767af..5c857b4 100644 --- a/Questionable/Questionable.Controller.Utils/PartyWatchDog.cs +++ b/Questionable/Questionable.Controller.Utils/PartyWatchDog.cs @@ -23,7 +23,7 @@ internal sealed class PartyWatchdog : IDisposable private readonly ILogger _logger; - private ushort? _uncheckedTeritoryId; + private uint? _uncheckedTeritoryId; public PartyWatchdog(QuestController questController, Configuration configuration, TerritoryData territoryData, IClientState clientState, IChatGui chatGui, ILogger logger) { @@ -36,7 +36,7 @@ internal sealed class PartyWatchdog : IDisposable _clientState.TerritoryChanged += TerritoryChanged; } - private unsafe void TerritoryChanged(ushort newTerritoryId) + private unsafe void TerritoryChanged(uint newTerritoryId) { if (!_configuration.Advanced.DisablePartyWatchdog) { @@ -137,7 +137,7 @@ internal sealed class PartyWatchdog : IDisposable _uncheckedTeritoryId = null; } - private bool IsDutyConfiguredForParty(ushort territoryId) + private bool IsDutyConfiguredForParty(uint territoryId) { if (!_territoryData.TryGetContentFinderConditionIdForTerritory(territoryId, out var cfcId)) { diff --git a/Questionable/Questionable.Controller/CombatController.cs b/Questionable/Questionable.Controller/CombatController.cs index 37f3875..4a5c846 100644 --- a/Questionable/Questionable.Controller/CombatController.cs +++ b/Questionable/Questionable.Controller/CombatController.cs @@ -571,7 +571,7 @@ internal sealed class CombatController : IDisposable } } - private void TerritoryChanged(ushort territoryId) + private void TerritoryChanged(uint territoryId) { Stop("TerritoryChanged"); } diff --git a/Questionable/Questionable.Data/AetheryteData.cs b/Questionable/Questionable.Data/AetheryteData.cs index 3122eb3..bea51fd 100644 --- a/Questionable/Questionable.Data/AetheryteData.cs +++ b/Questionable/Questionable.Data/AetheryteData.cs @@ -906,7 +906,7 @@ internal sealed class AetheryteData } } - public float CalculateDistance(Vector3 fromPosition, ushort fromTerritoryType, EAetheryteLocation to) + public float CalculateDistance(Vector3 fromPosition, uint fromTerritoryType, EAetheryteLocation to) { if (!TerritoryIds.TryGetValue(to, out var value) || fromTerritoryType != value) { @@ -919,7 +919,7 @@ internal sealed class AetheryteData return (fromPosition - value2).Length(); } - public float CalculateAirshipLandingDistance(Vector3 fromPosition, ushort fromTerritoryType, EAetheryteLocation to) + public float CalculateAirshipLandingDistance(Vector3 fromPosition, uint fromTerritoryType, EAetheryteLocation to) { if (!TerritoryIds.TryGetValue(to, out var value) || fromTerritoryType != value) { diff --git a/Questionable/Questionable.Data/TerritoryData.cs b/Questionable/Questionable.Data/TerritoryData.cs index d9e748c..78a3024 100644 --- a/Questionable/Questionable.Data/TerritoryData.cs +++ b/Questionable/Questionable.Data/TerritoryData.cs @@ -25,9 +25,9 @@ internal sealed class TerritoryData private readonly ImmutableDictionary _territoryNames; - private readonly ImmutableHashSet _territoriesWithMount; + private readonly ImmutableHashSet _territoriesWithMount; - private readonly ImmutableDictionary _dutyTerritories; + private readonly ImmutableDictionary _dutyTerritories; private readonly ImmutableDictionary _instanceNames; @@ -50,10 +50,10 @@ internal sealed class TerritoryData select x).ToImmutableDictionary(x => x.RowId, x => x.Name); _territoriesWithMount = (from x in dataManager.GetExcelSheet() where x.RowId != 0 && x.Mount - select (ushort)x.RowId).ToImmutableHashSet(); + select x.RowId).ToImmutableHashSet(); _dutyTerritories = (from x in dataManager.GetExcelSheet() where x.RowId != 0 && x.ContentFinderCondition.RowId != 0 - select x).ToImmutableDictionary((TerritoryType x) => (ushort)x.RowId, (TerritoryType x) => x.ContentFinderCondition.Value.ContentType.RowId); + select x).ToImmutableDictionary((TerritoryType x) => x.RowId, (TerritoryType x) => x.ContentFinderCondition.Value.ContentType.RowId); _instanceNames = (from x in dataManager.GetExcelSheet() where x.RowId != 0 && x.Content.RowId != 0 && x.ContentLinkType == 1 && x.ContentType.RowId != 6 select x).ToImmutableDictionary((ContentFinderCondition x) => x.Content.RowId, (ContentFinderCondition x) => x.Name.ToDalamudString().ToString()); @@ -78,12 +78,12 @@ internal sealed class TerritoryData select (QuestId: x.QuestId, Index: x.Index, CfcId: LookupContentFinderConditionForQuestBattle(dataManager, x.QuestBattleId))).ToImmutableDictionary<(ElementId, byte, uint), (ElementId, byte), uint>(((ElementId QuestId, byte Index, uint CfcId) x) => (QuestId: x.QuestId, Index: x.Index), ((ElementId QuestId, byte Index, uint CfcId) x) => x.CfcId); } - public string? GetName(ushort territoryId) + public string? GetName(uint territoryId) { return _territoryNames.GetValueOrDefault(territoryId); } - public string GetNameAndId(ushort territoryId) + public string GetNameAndId(uint territoryId) { string name = GetName(territoryId); if (name != null) @@ -99,17 +99,17 @@ internal sealed class TerritoryData return territoryId.ToString(CultureInfo.InvariantCulture); } - public bool CanUseMount(ushort territoryId) + public bool CanUseMount(uint territoryId) { return _territoriesWithMount.Contains(territoryId); } - public bool IsDutyInstance(ushort territoryId) + public bool IsDutyInstance(uint territoryId) { return _dutyTerritories.ContainsKey(territoryId); } - public bool IsQuestBattleInstance(ushort territoryId) + public bool IsQuestBattleInstance(uint territoryId) { if (_dutyTerritories.TryGetValue(territoryId, out var value)) { @@ -118,7 +118,7 @@ internal sealed class TerritoryData return false; } - public string? GetInstanceName(ushort instanceId) + public string? GetInstanceName(uint instanceId) { return _instanceNames.GetValueOrDefault(instanceId); } @@ -143,7 +143,7 @@ internal sealed class TerritoryData return false; } - public bool TryGetContentFinderConditionIdForTerritory(ushort territoryId, out uint cfcId) + public bool TryGetContentFinderConditionIdForTerritory(uint territoryId, out uint cfcId) { return _territoryToContentFinderCondition.TryGetValue(territoryId, out cfcId); } @@ -187,6 +187,6 @@ internal sealed class TerritoryData { return dataManager.GetExcelSheet().GetRow(questBattleId).ContentFinderCondition.RowId; } - return dataManager.GetExcelSheet().GetRow(questBattleId).Unknown0; + return dataManager.GetExcelSheet().GetRow(questBattleId).SoloDuty.RowId; } } diff --git a/Questionable/Questionable.Functions/AetheryteFunctions.cs b/Questionable/Questionable.Functions/AetheryteFunctions.cs index 9df51af..6a8c8ef 100644 --- a/Questionable/Questionable.Functions/AetheryteFunctions.cs +++ b/Questionable/Questionable.Functions/AetheryteFunctions.cs @@ -105,7 +105,7 @@ internal sealed class AetheryteFunctions { if ((EAetheryteLocation)ptr->FreeAetheryteId != aetheryteLocation) { - return (EAetheryteLocation)ptr->FreeAetherytePlayStationPlus == aetheryteLocation; + return (EAetheryteLocation)ptr->FreeAetherytePSPlus == aetheryteLocation; } return true; } diff --git a/Questionable/Questionable.Functions/GameFunctions.cs b/Questionable/Questionable.Functions/GameFunctions.cs index d9d615a..dc15082 100644 --- a/Questionable/Questionable.Functions/GameFunctions.cs +++ b/Questionable/Questionable.Functions/GameFunctions.cs @@ -53,7 +53,7 @@ internal sealed class GameFunctions private readonly AbandonDutyDelegate _abandonDuty; - private readonly ReadOnlyDictionary _territoryToAetherCurrentCompFlgSet; + private readonly ReadOnlyDictionary _territoryToAetherCurrentCompFlgSet; private readonly ReadOnlyDictionary _contentFinderConditionToContentId; @@ -72,13 +72,13 @@ internal sealed class GameFunctions _territoryToAetherCurrentCompFlgSet = (from x in dataManager.GetExcelSheet() where x.RowId != 0 where x.AetherCurrentCompFlgSet.RowId != 0 - select x).ToDictionary((TerritoryType x) => (ushort)x.RowId, (TerritoryType x) => x.AetherCurrentCompFlgSet.RowId).AsReadOnly(); + select x).ToDictionary((TerritoryType x) => x.RowId, (TerritoryType x) => x.AetherCurrentCompFlgSet.RowId).AsReadOnly(); _contentFinderConditionToContentId = (from x in dataManager.GetExcelSheet() where x.RowId != 0 && x.Content.RowId != 0 select x).ToDictionary((ContentFinderCondition x) => x.RowId, (ContentFinderCondition x) => x.Content.RowId).AsReadOnly(); } - public unsafe bool IsFlyingUnlocked(ushort territoryId) + public unsafe bool IsFlyingUnlocked(uint territoryId) { if (_configuration.Advanced.NeverFly) { diff --git a/Questionable/Questionable.Windows.ChangelogComponents/ChangelogCategoryComponent.cs b/Questionable/Questionable.Windows.ChangelogComponents/ChangelogCategoryComponent.cs index 6a009d1..9b78ffd 100644 --- a/Questionable/Questionable.Windows.ChangelogComponents/ChangelogCategoryComponent.cs +++ b/Questionable/Questionable.Windows.ChangelogComponents/ChangelogCategoryComponent.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Numerics; using Dalamud.Bindings.ImGui; @@ -40,26 +41,41 @@ internal static class ChangelogCategoryComponent { float cursorPosY = ImGui.GetCursorPosY(); ImGui.SetCursorPosX(baseX); - using (ImRaii.PushFont(UiBuilder.IconFont)) + FontDisposable val = ImRaii.PushFont(UiBuilder.IconFont, true); + try { ImGui.TextColored(in color, icon.ToIconString()); } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.SameLine(); ImGui.SetCursorPosY(cursorPosY); - using (ImRaii.PushColor(ImGuiCol.Text, color)) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, color, true); + try { ImGui.TextUnformatted(text); } + finally + { + ((IDisposable)val2)?.Dispose(); + } } private static void DrawChange(ChangeEntry change, float baseX, float changeIndent) { ImGui.SetCursorPosX(baseX + changeIndent); float cursorPosY = ImGui.GetCursorPosY(); - using (ImRaii.PushFont(UiBuilder.IconFont)) + FontDisposable val = ImRaii.PushFont(UiBuilder.IconFont, true); + try { ImGui.TextColored(new Vector4(0.95f, 0.95f, 1f, 1f), FontAwesomeIcon.CaretRight.ToIconString()); } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.SameLine(); ImGui.SetCursorPosY(cursorPosY); float num = ImGui.GetContentRegionAvail().X - 8f; @@ -79,10 +95,15 @@ internal static class ChangelogCategoryComponent { ImGui.SetCursorPosX(baseX + num); float cursorPosY = ImGui.GetCursorPosY(); - using (ImRaii.PushFont(UiBuilder.IconFont)) + FontDisposable val = ImRaii.PushFont(UiBuilder.IconFont, true); + try { ImGui.TextColored(new Vector4(0.85f, 0.85f, 0.92f, 1f), FontAwesomeIcon.AngleRight.ToIconString()); } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.SameLine(); ImGui.SetCursorPosY(cursorPosY); float num2 = ImGui.GetContentRegionAvail().X - 8f; diff --git a/Questionable/Questionable.Windows.ChangelogComponents/ChangelogEntryComponent.cs b/Questionable/Questionable.Windows.ChangelogComponents/ChangelogEntryComponent.cs index 28267b1..3648a16 100644 --- a/Questionable/Questionable.Windows.ChangelogComponents/ChangelogEntryComponent.cs +++ b/Questionable/Questionable.Windows.ChangelogComponents/ChangelogEntryComponent.cs @@ -37,20 +37,28 @@ internal sealed class ChangelogEntryComponent string text2 = "v" + changelog.Version; float fontSize = ImGui.GetFontSize(); float num = fontSize; + FontDisposable val = ImRaii.PushFont(UiBuilder.MonoFont, true); Vector2 versionSize; - using (ImRaii.PushFont(UiBuilder.MonoFont)) + try { versionSize = ImGui.CalcTextSize(text2); } + finally + { + ((IDisposable)val)?.Dispose(); + } Vector2 dateSize = ImGui.CalcTextSize(text); float scaledIconFontSize = fontSize * 0.85f; float x = ImGui.GetContentRegionAvail().X; + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Header, new Vector4(0.2f, 0.18f, 0.25f, 0.6f), true); bool flag; - using (ImRaii.PushColor(ImGuiCol.Header, new Vector4(0.2f, 0.18f, 0.25f, 0.6f))) + try { - using (ImRaii.PushColor(ImGuiCol.HeaderHovered, new Vector4(0.3f, 0.25f, 0.35f, 0.8f))) + ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.HeaderHovered, new Vector4(0.3f, 0.25f, 0.35f, 0.8f), true); + try { - using (ImRaii.PushColor(ImGuiCol.HeaderActive, new Vector4(0.25f, 0.22f, 0.3f, 1f))) + ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.HeaderActive, new Vector4(0.25f, 0.22f, 0.3f, 1f), true); + try { Vector2 cursorPos = ImGui.GetCursorPos(); Vector2 cursorScreenPos = ImGui.GetCursorScreenPos(); @@ -67,7 +75,19 @@ internal sealed class ChangelogEntryComponent DrawDateWithIcon(text, dateSize, scaledIconFontSize, cursorScreenPos, cursorPos, x, verticalOffset, fontSize); ImGui.SetCursorPos(cursorPos2); } + finally + { + ((IDisposable)val4)?.Dispose(); + } } + finally + { + ((IDisposable)val3)?.Dispose(); + } + } + finally + { + ((IDisposable)val2)?.Dispose(); } if (flag) { @@ -78,11 +98,16 @@ internal sealed class ChangelogEntryComponent private static void DrawVersionText(string versionText, Vector2 versionSize, Vector2 headerStartPos, float verticalOffset) { float x = headerStartPos.X + ImGui.GetStyle().FramePadding.X * 2f + 20f; - using (ImRaii.PushFont(UiBuilder.MonoFont)) + FontDisposable val = ImRaii.PushFont(UiBuilder.MonoFont, true); + try { ImGui.SetCursorPos(new Vector2(x, headerStartPos.Y + verticalOffset)); ImGui.TextColored(new Vector4(0.95f, 0.95f, 0.95f, 1f), versionText); } + finally + { + ((IDisposable)val)?.Dispose(); + } } private void DrawNewBadge(bool isNew, Vector2 headerStartScreenPos, float availableWidth) @@ -100,11 +125,16 @@ internal sealed class ChangelogEntryComponent private static void DrawDateWithIcon(string dateText, Vector2 dateSize, float scaledIconFontSize, Vector2 headerStartScreenPos, Vector2 headerStartPos, float availableWidth, float verticalOffset, float defaultFontSize) { string text = FontAwesomeIcon.Calendar.ToIconString(); + FontDisposable val = ImRaii.PushFont(UiBuilder.IconFont, true); Vector2 vector; - using (ImRaii.PushFont(UiBuilder.IconFont)) + try { vector = ImGui.CalcTextSize(text); } + finally + { + ((IDisposable)val)?.Dispose(); + } float num = vector.X * (scaledIconFontSize / defaultFontSize); float num2 = num + 4f + dateSize.X; float num3 = availableWidth - num2 - 12f; diff --git a/Questionable/Questionable.Windows.ChangelogComponents/ChangelogFooterComponent.cs b/Questionable/Questionable.Windows.ChangelogComponents/ChangelogFooterComponent.cs index 558e6bc..2a6b2e9 100644 --- a/Questionable/Questionable.Windows.ChangelogComponents/ChangelogFooterComponent.cs +++ b/Questionable/Questionable.Windows.ChangelogComponents/ChangelogFooterComponent.cs @@ -19,18 +19,33 @@ internal sealed class ChangelogFooterComponent float num = 120f; float num2 = (ImGui.GetContentRegionAvail().X - num) * 0.5f; ImGui.SetCursorPosX(ImGui.GetCursorPosX() + num2); - using (ImRaii.PushColor(ImGuiCol.Button, new Vector4(0.55f, 0.45f, 0.75f, 0.6f))) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Button, new Vector4(0.55f, 0.45f, 0.75f, 0.6f), true); + try { - using (ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.65f, 0.55f, 0.85f, 0.8f))) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.65f, 0.55f, 0.85f, 0.8f), true); + try { - using (ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.75f, 0.55f, 0.95f, 1f))) + ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.75f, 0.55f, 0.95f, 1f), true); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.CheckCircle, "Got It!")) { onConfirm(); } } + finally + { + ((IDisposable)val3)?.Dispose(); + } } + finally + { + ((IDisposable)val2)?.Dispose(); + } + } + finally + { + ((IDisposable)val)?.Dispose(); } } } diff --git a/Questionable/Questionable.Windows.ChangelogComponents/ChangelogHeaderComponent.cs b/Questionable/Questionable.Windows.ChangelogComponents/ChangelogHeaderComponent.cs index 53af959..6b25961 100644 --- a/Questionable/Questionable.Windows.ChangelogComponents/ChangelogHeaderComponent.cs +++ b/Questionable/Questionable.Windows.ChangelogComponents/ChangelogHeaderComponent.cs @@ -200,7 +200,8 @@ internal sealed class ChangelogHeaderComponent { float num = MathF.Sin(_animationTime * 2f) * 3f; float num2 = MathF.Sin(_animationTime * 1.5f + (float)Math.PI / 2f) * 1.5f; - using (ImRaii.PushFont(UiBuilder.IconFont)) + FontDisposable val = ImRaii.PushFont(UiBuilder.IconFont, true); + try { string text = FontAwesomeIcon.FileAlt.ToIconString(); ImGui.SetCursorPosX(centerX - ImGui.CalcTextSize(text).X * 0.5f + num2); @@ -213,6 +214,10 @@ internal sealed class ChangelogHeaderComponent ImGui.TextColored(new Vector4(0.75f, 0.55f, 0.95f, 1f), text); ImGui.PopStyleVar(); } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.SetCursorPosY(ImGui.GetCursorPosY() - num + 4f); } @@ -220,7 +225,8 @@ internal sealed class ChangelogHeaderComponent { float num = MathF.Max(0f, 1f - (_animationTime - 0.1f) * 3f); float num2 = num * num * (3f - 2f * num) * 20f; - using (ImRaii.PushFont(UiBuilder.MonoFont)) + FontDisposable val = ImRaii.PushFont(UiBuilder.MonoFont, true); + try { string text = "What's New in Questionable?"; ImGui.SetCursorPosX(centerX - ImGui.CalcTextSize(text).X * 0.5f - num2); @@ -228,6 +234,10 @@ internal sealed class ChangelogHeaderComponent ImGui.TextColored(new Vector4(0.95f, 0.95f, 1f, 1f), text); ImGui.PopStyleVar(); } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.SetCursorPosY(ImGui.GetCursorPosY() + 6f); } diff --git a/Questionable/Questionable.Windows.ConfigComponents/BlacklistConfigComponent.cs b/Questionable/Questionable.Windows.ConfigComponents/BlacklistConfigComponent.cs index 287c2da..f724da6 100644 --- a/Questionable/Questionable.Windows.ConfigComponents/BlacklistConfigComponent.cs +++ b/Questionable/Questionable.Windows.ConfigComponents/BlacklistConfigComponent.cs @@ -51,136 +51,175 @@ internal sealed class BlacklistConfigComponent : ConfigComponent public override void DrawTab() { - using ImRaii.IEndObject endObject = ImRaii.TabItem("Blacklist###QuestBlacklist"); - if (!endObject) + //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) + //IL_00a5: Unknown result type (might be due to invalid IL or missing references) + //IL_00aa: Unknown result type (might be due to invalid IL or missing references) + //IL_00ab: Unknown result type (might be due to invalid IL or missing references) + TabItemDisposable val = ImRaii.TabItem((ImU8String)"Blacklist###QuestBlacklist"); + try { - return; - } - ImGui.TextWrapped("Blacklisted quests will never be automatically picked up or executed by Questionable."); - ImGui.TextWrapped("Use this to permanently skip specific quests you don't want to do."); - ImGui.Separator(); - DrawCurrentlyAcceptedQuests(); - HashSet blacklistedQuests = base.Configuration.General.BlacklistedQuests; - ImU8String text = new ImU8String(22, 1); - text.AppendLiteral("Blacklisted Quests ("); - text.AppendFormatted(blacklistedQuests.Count); - text.AppendLiteral("):"); - ImGui.Text(text); - using (ImRaii.IEndObject endObject2 = ImRaii.Child("BlacklistedQuestsList", new Vector2(-1f, 200f), border: true)) - { - if (endObject2) + if (!val) { - if (blacklistedQuests.Count > 0) + return; + } + ImGui.TextWrapped("Blacklisted quests will never be automatically picked up or executed by Questionable."); + ImGui.TextWrapped("Use this to permanently skip specific quests you don't want to do."); + ImGui.Separator(); + DrawCurrentlyAcceptedQuests(); + HashSet blacklistedQuests = base.Configuration.General.BlacklistedQuests; + ImU8String text = new ImU8String(22, 1); + text.AppendLiteral("Blacklisted Quests ("); + text.AppendFormatted(blacklistedQuests.Count); + text.AppendLiteral("):"); + ImGui.Text(text); + ChildDisposable val2 = ImRaii.Child((ImU8String)"BlacklistedQuestsList", new Vector2(-1f, 200f), true); + try + { + if (ChildDisposable.op_Implicit(val2)) { - ElementId elementId = null; - int num = 0; - foreach (ElementId item in blacklistedQuests.OrderBy((ElementId x) => x.ToString())) + if (blacklistedQuests.Count > 0) { - if (!_questRegistry.TryGetQuest(item, out Quest quest)) + ElementId elementId = null; + int num = 0; + foreach (ElementId item in blacklistedQuests.OrderBy((ElementId x) => x.ToString())) { - ImU8String id = new ImU8String(5, 1); - id.AppendLiteral("Quest"); - id.AppendFormatted(item); - using (ImRaii.PushId(id)) + IdDisposable val3; + if (!_questRegistry.TryGetQuest(item, out Quest quest)) { + ImU8String imU8String = new ImU8String(5, 1); + imU8String.AppendLiteral("Quest"); + imU8String.AppendFormatted(item); + val3 = ImRaii.PushId(imU8String, true); + try + { + ImGui.AlignTextToFramePadding(); + Vector4 col = new Vector4(0.7f, 0.7f, 0.7f, 1f); + ImU8String text2 = new ImU8String(16, 1); + text2.AppendLiteral("Unknown Quest ("); + text2.AppendFormatted(item); + text2.AppendLiteral(")"); + ImGui.TextColored(in col, text2); + ImGui.SameLine(ImGui.GetContentRegionAvail().X - ImGui.CalcTextSize(FontAwesomeIcon.Times.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 2f); + if (ImGuiComponents.IconButton($"##Remove{num}", FontAwesomeIcon.Times)) + { + elementId = item; + } + } + finally + { + ((IDisposable)val3)?.Dispose(); + } + num++; + continue; + } + ImU8String imU8String2 = new ImU8String(5, 1); + imU8String2.AppendLiteral("Quest"); + imU8String2.AppendFormatted(item); + val3 = ImRaii.PushId(imU8String2, true); + try + { + (Vector4, FontAwesomeIcon, string) questStyle = _uiUtils.GetQuestStyle(item); + bool flag; + using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push()) + { + ImGui.AlignTextToFramePadding(); + ImGui.TextColored(in questStyle.Item1, questStyle.Item2.ToIconString()); + flag = ImGui.IsItemHovered(); + } + ImGui.SameLine(); ImGui.AlignTextToFramePadding(); - Vector4 col = new Vector4(0.7f, 0.7f, 0.7f, 1f); - ImU8String text2 = new ImU8String(16, 1); - text2.AppendLiteral("Unknown Quest ("); - text2.AppendFormatted(item); - text2.AppendLiteral(")"); - ImGui.TextColored(in col, text2); + ImGui.TextUnformatted(quest.Info.Name); + flag |= ImGui.IsItemHovered(); + if (flag) + { + _questTooltipComponent.Draw(quest.Info); + } ImGui.SameLine(ImGui.GetContentRegionAvail().X - ImGui.CalcTextSize(FontAwesomeIcon.Times.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 2f); if (ImGuiComponents.IconButton($"##Remove{num}", FontAwesomeIcon.Times)) { elementId = item; } + if (ImGui.IsItemHovered()) + { + ImGui.SetTooltip("Remove from blacklist"); + } + } + finally + { + ((IDisposable)val3)?.Dispose(); } num++; - continue; } - ImU8String id2 = new ImU8String(5, 1); - id2.AppendLiteral("Quest"); - id2.AppendFormatted(item); - using (ImRaii.PushId(id2)) + if (elementId != null) { - (Vector4, FontAwesomeIcon, string) questStyle = _uiUtils.GetQuestStyle(item); - bool flag; - using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push()) - { - ImGui.AlignTextToFramePadding(); - ImGui.TextColored(in questStyle.Item1, questStyle.Item2.ToIconString()); - flag = ImGui.IsItemHovered(); - } - ImGui.SameLine(); - ImGui.AlignTextToFramePadding(); - ImGui.TextUnformatted(quest.Info.Name); - flag |= ImGui.IsItemHovered(); - if (flag) - { - _questTooltipComponent.Draw(quest.Info); - } - ImGui.SameLine(ImGui.GetContentRegionAvail().X - ImGui.CalcTextSize(FontAwesomeIcon.Times.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 2f); - if (ImGuiComponents.IconButton($"##Remove{num}", FontAwesomeIcon.Times)) - { - elementId = item; - } - if (ImGui.IsItemHovered()) - { - ImGui.SetTooltip("Remove from blacklist"); - } + base.Configuration.General.BlacklistedQuests.Remove(elementId); + Save(); } - num++; } - if (elementId != null) + else { - base.Configuration.General.BlacklistedQuests.Remove(elementId); - Save(); + ImGui.PushStyleColor(ImGuiCol.Text, new Vector4(0.7f, 0.7f, 0.7f, 1f)); + ImGui.TextWrapped("No quests blacklisted. Use the dropdown above or add from currently accepted quests."); + ImGui.PopStyleColor(); } } - else + } + finally + { + ((ChildDisposable)(ref val2)).Dispose(); + } + _questSelector.DrawSelection(); + if (blacklistedQuests.Count <= 0) + { + return; + } + DisabledDisposable val4 = ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl)); + try + { + if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All")) { - ImGui.PushStyleColor(ImGuiCol.Text, new Vector4(0.7f, 0.7f, 0.7f, 1f)); - ImGui.TextWrapped("No quests blacklisted. Use the dropdown above or add from currently accepted quests."); - ImGui.PopStyleColor(); + base.Configuration.General.BlacklistedQuests.Clear(); + Save(); } } - } - _questSelector.DrawSelection(); - if (blacklistedQuests.Count <= 0) - { - return; - } - using (ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl))) - { - if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All")) + finally { - base.Configuration.General.BlacklistedQuests.Clear(); - Save(); + ((IDisposable)val4)?.Dispose(); + } + if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) + { + ImGui.SetTooltip("Hold CTRL to enable this button."); } } - if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) + finally { - ImGui.SetTooltip("Hold CTRL to enable this button."); + ((TabItemDisposable)(ref val)).Dispose(); } } private void DrawCurrentlyAcceptedQuests() { + //IL_0030: Unknown result type (might be due to invalid IL or missing references) + //IL_0035: Unknown result type (might be due to invalid IL or missing references) + //IL_0036: Unknown result type (might be due to invalid IL or missing references) List currentlyAcceptedQuests = GetCurrentlyAcceptedQuests(); ImGui.Text("Currently Accepted Quests:"); - using (ImRaii.IEndObject endObject = ImRaii.Child("AcceptedQuestsList", new Vector2(-1f, 100f), border: true)) + ChildDisposable val = ImRaii.Child((ImU8String)"AcceptedQuestsList", new Vector2(-1f, 100f), true); + try { - if (endObject) + if (ChildDisposable.op_Implicit(val)) { if (currentlyAcceptedQuests.Count > 0) { foreach (Quest item in currentlyAcceptedQuests) { - ImU8String id = new ImU8String(13, 1); - id.AppendLiteral("AcceptedQuest"); - id.AppendFormatted(item.Id); - using (ImRaii.PushId(id)) + ImU8String imU8String = new ImU8String(13, 1); + imU8String.AppendLiteral("AcceptedQuest"); + imU8String.AppendFormatted(item.Id); + IdDisposable val2 = ImRaii.PushId(imU8String, true); + try { (Vector4, FontAwesomeIcon, string) questStyle = _uiUtils.GetQuestStyle(item.Id); bool flag = false; @@ -199,7 +238,8 @@ internal sealed class BlacklistConfigComponent : ConfigComponent _questTooltipComponent.Draw(item.Info); } ImGui.SameLine(ImGui.GetContentRegionAvail().X - ImGui.CalcTextSize(FontAwesomeIcon.Ban.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 2f); - using (ImRaii.Disabled(flag2)) + DisabledDisposable val3 = ImRaii.Disabled(flag2); + try { if (ImGuiComponents.IconButton($"##Blacklist{item.Id}", FontAwesomeIcon.Ban)) { @@ -207,11 +247,19 @@ internal sealed class BlacklistConfigComponent : ConfigComponent Save(); } } + finally + { + ((IDisposable)val3)?.Dispose(); + } if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { ImGui.SetTooltip(flag2 ? "Quest already blacklisted" : "Add this quest to blacklist"); } } + finally + { + ((IDisposable)val2)?.Dispose(); + } } } else @@ -222,6 +270,10 @@ internal sealed class BlacklistConfigComponent : ConfigComponent } } } + finally + { + ((ChildDisposable)(ref val)).Dispose(); + } ImGui.Spacing(); } diff --git a/Questionable/Questionable.Windows.ConfigComponents/ConfigComponent.cs b/Questionable/Questionable.Windows.ConfigComponents/ConfigComponent.cs index f0519c0..be8d3b0 100644 --- a/Questionable/Questionable.Windows.ConfigComponents/ConfigComponent.cs +++ b/Questionable/Questionable.Windows.ConfigComponents/ConfigComponent.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using Dalamud.Bindings.ImGui; using Dalamud.Game.Text; @@ -58,31 +59,52 @@ internal abstract class ConfigComponent protected static void DrawNotes(bool enabledByDefault, IEnumerable notes) { - using ImRaii.Color color = new ImRaii.Color(); - color.Push(ImGuiCol.TextDisabled, (!enabledByDefault) ? ImGuiColors.DalamudYellow : ImGuiColors.ParsedBlue); - ImGui.SameLine(); - using (ImRaii.PushFont(UiBuilder.IconFont)) + //IL_0000: Unknown result type (might be due to invalid IL or missing references) + //IL_0006: Expected O, but got Unknown + //IL_0071: Unknown result type (might be due to invalid IL or missing references) + //IL_0076: Unknown result type (might be due to invalid IL or missing references) + ColorDisposable val = new ColorDisposable(); + try { - if (!enabledByDefault) + val.Push(ImGuiCol.TextDisabled, (!enabledByDefault) ? ImGuiColors.DalamudYellow : ImGuiColors.ParsedBlue, true); + ImGui.SameLine(); + FontDisposable val2 = ImRaii.PushFont(UiBuilder.IconFont, true); + try { - ImGui.TextDisabled(FontAwesomeIcon.ExclamationTriangle.ToIconString()); + if (!enabledByDefault) + { + ImGui.TextDisabled(FontAwesomeIcon.ExclamationTriangle.ToIconString()); + } + else + { + ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); + } } - else + finally { - ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); + ((IDisposable)val2)?.Dispose(); + } + if (!ImGui.IsItemHovered()) + { + return; + } + TooltipDisposable val3 = ImRaii.Tooltip(); + try + { + ImGui.TextColored(ImGuiColors.DalamudYellow, "While testing, the following issues have been found:"); + foreach (string note in notes) + { + ImGui.BulletText(note); + } + } + finally + { + ((TooltipDisposable)(ref val3)).Dispose(); } } - if (!ImGui.IsItemHovered()) + finally { - return; - } - using (ImRaii.Tooltip()) - { - ImGui.TextColored(ImGuiColors.DalamudYellow, "While testing, the following issues have been found:"); - foreach (string note in notes) - { - ImGui.BulletText(note); - } + ((IDisposable)val)?.Dispose(); } } } diff --git a/Questionable/Questionable.Windows.ConfigComponents/DebugConfigComponent.cs b/Questionable/Questionable.Windows.ConfigComponents/DebugConfigComponent.cs index ce8b997..6521301 100644 --- a/Questionable/Questionable.Windows.ConfigComponents/DebugConfigComponent.cs +++ b/Questionable/Questionable.Windows.ConfigComponents/DebugConfigComponent.cs @@ -1,3 +1,4 @@ +using System; using Dalamud.Bindings.ImGui; using Dalamud.Interface.Colors; using Dalamud.Interface.Components; @@ -15,118 +16,150 @@ internal sealed class DebugConfigComponent : ConfigComponent public override void DrawTab() { - using ImRaii.IEndObject endObject = ImRaii.TabItem("Advanced###Debug"); - if (!endObject) + //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) + TabItemDisposable val = ImRaii.TabItem((ImU8String)"Advanced###Debug"); + try { - return; - } - ImGui.TextColored(ImGuiColors.DalamudRed, "Enabling any option here may cause unexpected behavior. Use at your own risk."); - ImGui.Separator(); - DrawChocoboSettings(); - ImGui.Separator(); - bool v = base.Configuration.Advanced.DebugOverlay; - if (ImGui.Checkbox("Enable debug overlay", ref v)) - { - base.Configuration.Advanced.DebugOverlay = v; - Save(); - } - using (ImRaii.Disabled(!v)) - { - using (ImRaii.PushIndent()) + if (!val) { - bool v2 = base.Configuration.Advanced.CombatDataOverlay; - if (ImGui.Checkbox("Enable combat data overlay", ref v2)) + return; + } + ImGui.TextColored(ImGuiColors.DalamudRed, "Enabling any option here may cause unexpected behavior. Use at your own risk."); + ImGui.Separator(); + DrawChocoboSettings(); + ImGui.Separator(); + bool v = base.Configuration.Advanced.DebugOverlay; + if (ImGui.Checkbox("Enable debug overlay", ref v)) + { + base.Configuration.Advanced.DebugOverlay = v; + Save(); + } + DisabledDisposable val2 = ImRaii.Disabled(!v); + IndentDisposable val3; + try + { + val3 = ImRaii.PushIndent(1, true); + try { - base.Configuration.Advanced.CombatDataOverlay = v2; - Save(); + bool v2 = base.Configuration.Advanced.CombatDataOverlay; + if (ImGui.Checkbox("Enable combat data overlay", ref v2)) + { + base.Configuration.Advanced.CombatDataOverlay = v2; + Save(); + } + } + finally + { + ((IDisposable)val3)?.Dispose(); } } + finally + { + ((IDisposable)val2)?.Dispose(); + } + bool v3 = base.Configuration.Advanced.NeverFly; + if (ImGui.Checkbox("Disable flying (even if unlocked for the zone)", ref v3)) + { + base.Configuration.Advanced.NeverFly = v3; + Save(); + } + bool v4 = base.Configuration.Advanced.AdditionalStatusInformation; + if (ImGui.Checkbox("Draw additional status information", ref v4)) + { + base.Configuration.Advanced.AdditionalStatusInformation = v4; + Save(); + } + bool v5 = base.Configuration.Advanced.DisablePartyWatchdog; + if (ImGui.Checkbox("Disable Party Watchdog", ref v5)) + { + base.Configuration.Advanced.DisablePartyWatchdog = v5; + Save(); + } + ImGui.SameLine(); + ImGuiComponents.HelpMarker("The Party Watchdog stops Questionable when entering certain zones with other party members, or when entering unsupported content. Disabling this allows Questionable to continue working while in a party, but may cause unexpected behavior in group content."); + ImGui.Separator(); + ImGui.Text("AutoDuty Settings"); + val3 = ImRaii.PushIndent(1, true); + try + { + ImGui.AlignTextToFramePadding(); + bool v6 = base.Configuration.Advanced.DisableAutoDutyBareMode; + if (ImGui.Checkbox("Use Pre-Loop/Loop/Post-Loop settings", ref v6)) + { + base.Configuration.Advanced.DisableAutoDutyBareMode = v6; + Save(); + } + ImGui.SameLine(); + ImGuiComponents.HelpMarker("Typically, the loop settings for AutoDuty are disabled when running dungeons with Questionable, since they can cause issues (or even shut down your PC)."); + } + finally + { + ((IDisposable)val3)?.Dispose(); + } + ImGui.Separator(); + ImGui.Text("Quest/Interaction Skips"); + val3 = ImRaii.PushIndent(1, true); + try + { + bool v7 = base.Configuration.Advanced.SkipAetherCurrents; + if (ImGui.Checkbox("Don't pick up aether currents/aether current quests", ref v7)) + { + base.Configuration.Advanced.SkipAetherCurrents = v7; + Save(); + } + ImGui.SameLine(); + ImGuiComponents.HelpMarker("If not done during the MSQ by Questionable, you have to manually pick up any missed aether currents/quests. There is no way to automatically pick up all missing aether currents."); + bool v8 = base.Configuration.Advanced.SkipClassJobQuests; + if (ImGui.Checkbox("Don't pick up class/job/role quests", ref v8)) + { + base.Configuration.Advanced.SkipClassJobQuests = v8; + Save(); + } + ImGui.SameLine(); + ImGuiComponents.HelpMarker("Class and job skills for A Realm Reborn, Heavensward and (for the Lv70 skills) Stormblood are locked behind quests. Not recommended if you plan on queueing for instances with duty finder/party finder.\n\nNote: This setting is ignored for the first class/job quest if your character is not high enough level to start the level 4 MSQ."); + bool v9 = base.Configuration.Advanced.SkipARealmRebornHardModePrimals; + if (ImGui.Checkbox("Don't pick up ARR hard mode primal quests", ref v9)) + { + base.Configuration.Advanced.SkipARealmRebornHardModePrimals = v9; + Save(); + } + ImGui.SameLine(); + ImGuiComponents.HelpMarker("Hard mode Ifrit/Garuda/Titan are required for the Patch 2.5 quest 'Good Intentions' and to start Heavensward."); + bool v10 = base.Configuration.Advanced.SkipCrystalTowerRaids; + if (ImGui.Checkbox("Don't pick up Crystal Tower quests", ref v10)) + { + base.Configuration.Advanced.SkipCrystalTowerRaids = v10; + Save(); + } + ImGui.SameLine(); + ImGuiComponents.HelpMarker("Crystal Tower raids are required for the Patch 2.55 quest 'A Time to Every Purpose' and to start Heavensward."); + bool v11 = base.Configuration.Advanced.PreventQuestCompletion; + if (ImGui.Checkbox("Prevent quest completion", ref v11)) + { + base.Configuration.Advanced.PreventQuestCompletion = v11; + Save(); + } + ImGui.SameLine(); + ImGuiComponents.HelpMarker("When enabled, Questionable will not attempt to turn-in and complete quests. This will do everything automatically except the final turn-in step."); + } + finally + { + ((IDisposable)val3)?.Dispose(); + } } - bool v3 = base.Configuration.Advanced.NeverFly; - if (ImGui.Checkbox("Disable flying (even if unlocked for the zone)", ref v3)) + finally { - base.Configuration.Advanced.NeverFly = v3; - Save(); - } - bool v4 = base.Configuration.Advanced.AdditionalStatusInformation; - if (ImGui.Checkbox("Draw additional status information", ref v4)) - { - base.Configuration.Advanced.AdditionalStatusInformation = v4; - Save(); - } - bool v5 = base.Configuration.Advanced.DisablePartyWatchdog; - if (ImGui.Checkbox("Disable Party Watchdog", ref v5)) - { - base.Configuration.Advanced.DisablePartyWatchdog = v5; - Save(); - } - ImGui.SameLine(); - ImGuiComponents.HelpMarker("The Party Watchdog stops Questionable when entering certain zones with other party members, or when entering unsupported content. Disabling this allows Questionable to continue working while in a party, but may cause unexpected behavior in group content."); - ImGui.Separator(); - ImGui.Text("AutoDuty Settings"); - using (ImRaii.PushIndent()) - { - ImGui.AlignTextToFramePadding(); - bool v6 = base.Configuration.Advanced.DisableAutoDutyBareMode; - if (ImGui.Checkbox("Use Pre-Loop/Loop/Post-Loop settings", ref v6)) - { - base.Configuration.Advanced.DisableAutoDutyBareMode = v6; - Save(); - } - ImGui.SameLine(); - ImGuiComponents.HelpMarker("Typically, the loop settings for AutoDuty are disabled when running dungeons with Questionable, since they can cause issues (or even shut down your PC)."); - } - ImGui.Separator(); - ImGui.Text("Quest/Interaction Skips"); - using (ImRaii.PushIndent()) - { - bool v7 = base.Configuration.Advanced.SkipAetherCurrents; - if (ImGui.Checkbox("Don't pick up aether currents/aether current quests", ref v7)) - { - base.Configuration.Advanced.SkipAetherCurrents = v7; - Save(); - } - ImGui.SameLine(); - ImGuiComponents.HelpMarker("If not done during the MSQ by Questionable, you have to manually pick up any missed aether currents/quests. There is no way to automatically pick up all missing aether currents."); - bool v8 = base.Configuration.Advanced.SkipClassJobQuests; - if (ImGui.Checkbox("Don't pick up class/job/role quests", ref v8)) - { - base.Configuration.Advanced.SkipClassJobQuests = v8; - Save(); - } - ImGui.SameLine(); - ImGuiComponents.HelpMarker("Class and job skills for A Realm Reborn, Heavensward and (for the Lv70 skills) Stormblood are locked behind quests. Not recommended if you plan on queueing for instances with duty finder/party finder.\n\nNote: This setting is ignored for the first class/job quest if your character is not high enough level to start the level 4 MSQ."); - bool v9 = base.Configuration.Advanced.SkipARealmRebornHardModePrimals; - if (ImGui.Checkbox("Don't pick up ARR hard mode primal quests", ref v9)) - { - base.Configuration.Advanced.SkipARealmRebornHardModePrimals = v9; - Save(); - } - ImGui.SameLine(); - ImGuiComponents.HelpMarker("Hard mode Ifrit/Garuda/Titan are required for the Patch 2.5 quest 'Good Intentions' and to start Heavensward."); - bool v10 = base.Configuration.Advanced.SkipCrystalTowerRaids; - if (ImGui.Checkbox("Don't pick up Crystal Tower quests", ref v10)) - { - base.Configuration.Advanced.SkipCrystalTowerRaids = v10; - Save(); - } - ImGui.SameLine(); - ImGuiComponents.HelpMarker("Crystal Tower raids are required for the Patch 2.55 quest 'A Time to Every Purpose' and to start Heavensward."); - bool v11 = base.Configuration.Advanced.PreventQuestCompletion; - if (ImGui.Checkbox("Prevent quest completion", ref v11)) - { - base.Configuration.Advanced.PreventQuestCompletion = v11; - Save(); - } - ImGui.SameLine(); - ImGuiComponents.HelpMarker("When enabled, Questionable will not attempt to turn-in and complete quests. This will do everything automatically except the final turn-in step."); + ((TabItemDisposable)(ref val)).Dispose(); } } private void DrawChocoboSettings() { ImGui.Text("Chocobo Settings"); - using (ImRaii.PushIndent()) + IndentDisposable val = ImRaii.PushIndent(1, true); + try { ImGui.AlignTextToFramePadding(); ImGui.Text("Chocobo Name:"); @@ -147,6 +180,10 @@ internal sealed class DebugConfigComponent : ConfigComponent ImGui.SameLine(); ImGuiComponents.HelpMarker("The name to give your chocobo during the 'My Little Chocobo' quest.\nMust be 2-20 characters. First letter will be capitalized.\nIf left empty, defaults to 'Kweh'."); } + finally + { + ((IDisposable)val)?.Dispose(); + } } private static string FormatChocoboName(string name) diff --git a/Questionable/Questionable.Windows.ConfigComponents/DutyConfigComponent.cs b/Questionable/Questionable.Windows.ConfigComponents/DutyConfigComponent.cs index 426c4c3..922c3eb 100644 --- a/Questionable/Questionable.Windows.ConfigComponents/DutyConfigComponent.cs +++ b/Questionable/Questionable.Windows.ConfigComponents/DutyConfigComponent.cs @@ -106,285 +106,398 @@ internal sealed class DutyConfigComponent : ConfigComponent public override void DrawTab() { - using ImRaii.IEndObject endObject = ImRaii.TabItem("Duties###Duties"); - if (!endObject) + //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) + //IL_0260: Unknown result type (might be due to invalid IL or missing references) + //IL_0265: Unknown result type (might be due to invalid IL or missing references) + //IL_0267: Unknown result type (might be due to invalid IL or missing references) + //IL_027d: Unknown result type (might be due to invalid IL or missing references) + //IL_0282: Unknown result type (might be due to invalid IL or missing references) + //IL_0284: Unknown result type (might be due to invalid IL or missing references) + //IL_02ae: Unknown result type (might be due to invalid IL or missing references) + //IL_02b3: Unknown result type (might be due to invalid IL or missing references) + //IL_02b5: Unknown result type (might be due to invalid IL or missing references) + //IL_02df: Unknown result type (might be due to invalid IL or missing references) + //IL_02e4: Unknown result type (might be due to invalid IL or missing references) + //IL_02e6: Unknown result type (might be due to invalid IL or missing references) + //IL_0310: Unknown result type (might be due to invalid IL or missing references) + //IL_0315: Unknown result type (might be due to invalid IL or missing references) + //IL_0317: Unknown result type (might be due to invalid IL or missing references) + TabItemDisposable val = ImRaii.TabItem((ImU8String)"Duties###Duties"); + try { - return; - } - bool v = base.Configuration.Duties.RunInstancedContentWithAutoDuty; - if (ImGui.Checkbox("Run instanced content with AutoDuty and BossMod", ref v)) - { - base.Configuration.Duties.RunInstancedContentWithAutoDuty = v; - Save(); - } - ImGui.SameLine(); - ImGuiComponents.HelpMarker("The combat module used for this is configured by AutoDuty, ignoring whichever selection you've made in Questionable's \"General\" configuration."); - using (ImRaii.Disabled(!v)) - { - using (ImRaii.PushIndent(ImGui.GetFrameHeight() + ImGui.GetStyle().ItemInnerSpacing.X)) + if (!val) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed)) + return; + } + bool v = base.Configuration.Duties.RunInstancedContentWithAutoDuty; + if (ImGui.Checkbox("Run instanced content with AutoDuty and BossMod", ref v)) + { + base.Configuration.Duties.RunInstancedContentWithAutoDuty = v; + Save(); + } + ImGui.SameLine(); + ImGuiComponents.HelpMarker("The combat module used for this is configured by AutoDuty, ignoring whichever selection you've made in Questionable's \"General\" configuration."); + DisabledDisposable val2 = ImRaii.Disabled(!v); + try + { + IndentDisposable val3 = ImRaii.PushIndent(ImGui.GetFrameHeight() + ImGui.GetStyle().ItemInnerSpacing.X, true, true); + try { - ImGui.TextUnformatted("Work in Progress:"); - ImGui.BulletText("Duty Support mode is limited."); - ImGui.BulletText("Unsynced modes require being significantly overleveled or having a high-level party member."); - ImGui.BulletText("Most players will need to use Duty Support mode when progressing normally through the game."); + ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true); + try + { + ImGui.TextUnformatted("Work in Progress:"); + ImGui.BulletText("Duty Support mode is limited."); + ImGui.BulletText("Unsynced modes require being significantly overleveled or having a high-level party member."); + ImGui.BulletText("Most players will need to use Duty Support mode when progressing normally through the game."); + } + finally + { + ((IDisposable)val4)?.Dispose(); + } } + finally + { + ((IDisposable)val3)?.Dispose(); + } + ImGui.Spacing(); + bool v2 = base.Configuration.Duties.RunLevelingModeWhenUnderleveled; + if (ImGui.Checkbox("Run AutoDuty Leveling mode when underleveled for MSQ", ref v2)) + { + base.Configuration.Duties.RunLevelingModeWhenUnderleveled = v2; + Save(); + } + ImGui.SameLine(); + ImGuiComponents.HelpMarker("When enabled, Questionable will automatically run AutoDuty's Leveling mode when your character is underleveled for the next Main Scenario Quest.\n\nLeveling mode runs the highest available dungeon for your level to gain XP.\n\nThis is useful for characters without the Road to 90 XP buff who may not have enough XP to continue the MSQ."); + ImGui.Spacing(); + ImGui.Text("Default duty mode:"); + ImGui.SameLine(); + int currentItem = (int)base.Configuration.Duties.DefaultDutyMode; + ImGui.SetNextItemWidth(200f); + if (ImGui.Combo((ImU8String)"##DefaultDutyMode", ref currentItem, (ReadOnlySpan)DutyModeLabels, DutyModeLabels.Length)) + { + base.Configuration.Duties.DefaultDutyMode = (EDutyMode)currentItem; + Save(); + } + ImGui.SameLine(); + ImGuiComponents.HelpMarker("\ufffd Duty Support: Run with NPC party members (level synced)\n\ufffd Unsync (Solo): Run alone at your current level (unsynced)\n\ufffd Unsync (Party): Run with your party at current level (unsynced)\n\nYou can override this setting for individual duties below."); } - ImGui.Spacing(); - bool v2 = base.Configuration.Duties.RunLevelingModeWhenUnderleveled; - if (ImGui.Checkbox("Run AutoDuty Leveling mode when underleveled for MSQ", ref v2)) + finally { - base.Configuration.Duties.RunLevelingModeWhenUnderleveled = v2; - Save(); - } - ImGui.SameLine(); - ImGuiComponents.HelpMarker("When enabled, Questionable will automatically run AutoDuty's Leveling mode when your character is underleveled for the next Main Scenario Quest.\n\nLeveling mode runs the highest available dungeon for your level to gain XP.\n\nThis is useful for characters without the Road to 90 XP buff who may not have enough XP to continue the MSQ."); - ImGui.Spacing(); - ImGui.Text("Default duty mode:"); - ImGui.SameLine(); - int currentItem = (int)base.Configuration.Duties.DefaultDutyMode; - ImGui.SetNextItemWidth(200f); - if (ImGui.Combo((ImU8String)"##DefaultDutyMode", ref currentItem, (ReadOnlySpan)DutyModeLabels, DutyModeLabels.Length)) - { - base.Configuration.Duties.DefaultDutyMode = (EDutyMode)currentItem; - Save(); - } - ImGui.SameLine(); - ImGuiComponents.HelpMarker("\ufffd Duty Support: Run with NPC party members (level synced)\n\ufffd Unsync (Solo): Run alone at your current level (unsynced)\n\ufffd Unsync (Party): Run with your party at current level (unsynced)\n\nYou can override this setting for individual duties below."); - } - ImGui.Separator(); - using (ImRaii.Disabled(!v)) - { - ImGui.Text("Questionable includes a default list of duties that work if AutoDuty and BossMod are installed."); - ImGui.Text("The included list of duties can change with each update, and is based on the following spreadsheet:"); - if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.GlobeEurope, "Open AutoDuty spreadsheet")) - { - Util.OpenLink("https://docs.google.com/spreadsheets/d/151RlpqRcCpiD_VbQn6Duf-u-S71EP7d0mx3j1PDNoNA/edit?pli=1#gid=0"); + ((IDisposable)val2)?.Dispose(); } ImGui.Separator(); - ImGui.Text("You can override the settings for each individual duty:"); - using ImRaii.IEndObject endObject2 = ImRaii.TabBar("DutyTypeTabs"); - if (endObject2) + val2 = ImRaii.Disabled(!v); + try { - using (ImRaii.IEndObject endObject3 = ImRaii.TabItem("Dungeons")) + ImGui.Text("Questionable includes a default list of duties that work if AutoDuty and BossMod are installed."); + ImGui.Text("The included list of duties can change with each update, and is based on the following spreadsheet:"); + if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.GlobeEurope, "Open AutoDuty spreadsheet")) { - if (endObject3) - { - DrawConfigTable(v, _contentFinderConditionNames); - } + Util.OpenLink("https://docs.google.com/spreadsheets/d/151RlpqRcCpiD_VbQn6Duf-u-S71EP7d0mx3j1PDNoNA/edit?pli=1#gid=0"); } - using (ImRaii.IEndObject endObject4 = ImRaii.TabItem("Trials")) + ImGui.Separator(); + ImGui.Text("You can override the settings for each individual duty:"); + TabBarDisposable val5 = ImRaii.TabBar((ImU8String)"DutyTypeTabs"); + try { - if (endObject4) + if (TabBarDisposable.op_Implicit(val5)) { - DrawConfigTable(v, _allTrialNames); + TabItemDisposable val6 = ImRaii.TabItem((ImU8String)"Dungeons"); + try + { + if (TabItemDisposable.op_Implicit(val6)) + { + DrawConfigTable(v, _contentFinderConditionNames); + } + } + finally + { + ((TabItemDisposable)(ref val6)).Dispose(); + } + TabItemDisposable val7 = ImRaii.TabItem((ImU8String)"Trials"); + try + { + if (TabItemDisposable.op_Implicit(val7)) + { + DrawConfigTable(v, _allTrialNames); + } + } + finally + { + ((TabItemDisposable)(ref val7)).Dispose(); + } + TabItemDisposable val8 = ImRaii.TabItem((ImU8String)"Normal Raids"); + try + { + if (TabItemDisposable.op_Implicit(val8)) + { + DrawConfigTable(v, _allNormalRaidNames); + } + } + finally + { + ((TabItemDisposable)(ref val8)).Dispose(); + } + TabItemDisposable val9 = ImRaii.TabItem((ImU8String)"Alliance Raids"); + try + { + if (TabItemDisposable.op_Implicit(val9)) + { + DrawConfigTable(v, _allAllianceRaidNames); + } + } + finally + { + ((TabItemDisposable)(ref val9)).Dispose(); + } } + DrawEnableAllButton(); + ImGui.SameLine(); + DrawClipboardButtons(); + ImGui.SameLine(); + DrawResetButton(); } - using (ImRaii.IEndObject endObject5 = ImRaii.TabItem("Normal Raids")) + finally { - if (endObject5) - { - DrawConfigTable(v, _allNormalRaidNames); - } - } - using ImRaii.IEndObject endObject6 = ImRaii.TabItem("Alliance Raids"); - if (endObject6) - { - DrawConfigTable(v, _allAllianceRaidNames); + ((TabBarDisposable)(ref val5)).Dispose(); } } - DrawEnableAllButton(); - ImGui.SameLine(); - DrawClipboardButtons(); - ImGui.SameLine(); - DrawResetButton(); + finally + { + ((IDisposable)val2)?.Dispose(); + } + } + finally + { + ((TabItemDisposable)(ref val)).Dispose(); } } private void DrawConfigTable(bool runInstancedContentWithAutoDuty, Dictionary> contentByExpansion) { - using ImRaii.IEndObject endObject = ImRaii.Child("DutyConfiguration", new Vector2(725f, 400f), border: true); - if (!endObject) + //IL_001a: Unknown result type (might be due to invalid IL or missing references) + //IL_001f: Unknown result type (might be due to invalid IL or missing references) + //IL_0020: Unknown result type (might be due to invalid IL or missing references) + //IL_014f: Unknown result type (might be due to invalid IL or missing references) + //IL_0154: Unknown result type (might be due to invalid IL or missing references) + //IL_0156: Unknown result type (might be due to invalid IL or missing references) + //IL_02bc: Unknown result type (might be due to invalid IL or missing references) + //IL_02c1: Unknown result type (might be due to invalid IL or missing references) + ChildDisposable val = ImRaii.Child((ImU8String)"DutyConfiguration", new Vector2(725f, 400f), true); + try { - return; - } - EExpansionVersion[] values = Enum.GetValues(); - for (int i = 0; i < values.Length; i++) - { - EExpansionVersion eExpansionVersion = values[i]; - (int enabledCount, int totalCount) dutyCountsForExpansion = GetDutyCountsForExpansion(eExpansionVersion, contentByExpansion); - int item = dutyCountsForExpansion.enabledCount; - int item2 = dutyCountsForExpansion.totalCount; - string obj = ((item2 > 0) ? $"{eExpansionVersion.ToFriendlyString()} ({item}/{item2})" : eExpansionVersion.ToFriendlyString()); - string key = eExpansionVersion.ToString(); - ImGui.SetNextItemOpen(base.Configuration.Duties.ExpansionHeaderStates.GetValueOrDefault(key, defaultValue: false), ImGuiCond.Always); - if (ImGui.CollapsingHeader(obj)) + if (!val) { - if (!base.Configuration.Duties.ExpansionHeaderStates.GetValueOrDefault(key, defaultValue: false)) + return; + } + EExpansionVersion[] values = Enum.GetValues(); + for (int i = 0; i < values.Length; i++) + { + EExpansionVersion eExpansionVersion = values[i]; + (int enabledCount, int totalCount) dutyCountsForExpansion = GetDutyCountsForExpansion(eExpansionVersion, contentByExpansion); + int item = dutyCountsForExpansion.enabledCount; + int item2 = dutyCountsForExpansion.totalCount; + string obj = ((item2 > 0) ? $"{eExpansionVersion.ToFriendlyString()} ({item}/{item2})" : eExpansionVersion.ToFriendlyString()); + string key = eExpansionVersion.ToString(); + ImGui.SetNextItemOpen(base.Configuration.Duties.ExpansionHeaderStates.GetValueOrDefault(key, defaultValue: false), ImGuiCond.Always); + if (ImGui.CollapsingHeader(obj)) { - base.Configuration.Duties.ExpansionHeaderStates[key] = true; - Save(); - } - ImU8String table = new ImU8String(6, 1); - table.AppendLiteral("Duties"); - table.AppendFormatted(eExpansionVersion); - using ImRaii.IEndObject endObject2 = ImRaii.Table(table, 3, ImGuiTableFlags.SizingFixedFit); - if (!ImRaii.IEndObject.op_True(endObject2)) - { - continue; - } - ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthStretch); - ImGui.TableSetupColumn("Enabled", ImGuiTableColumnFlags.WidthFixed, 200f); - ImGui.TableSetupColumn("Mode", ImGuiTableColumnFlags.WidthFixed, 150f); - if (!contentByExpansion.TryGetValue(eExpansionVersion, out List value)) - { - continue; - } - foreach (DutyInfo item3 in value) - { - item3.Deconstruct(out uint CfcId, out uint TerritoryId, out string Name); - uint num = CfcId; - uint value2 = TerritoryId; - string text = Name; - DutyOptions dutyOptions; - bool flag = _questRegistry.TryGetDutyByContentFinderConditionId(num, out dutyOptions); - ImGui.TableNextRow(); - string[] array; - int currentItem; - if (flag) + if (!base.Configuration.Duties.ExpansionHeaderStates.GetValueOrDefault(key, defaultValue: false)) { - array = (dutyOptions.Enabled ? SupportedCfcOptions : UnsupportedCfcOptions); - currentItem = 0; - if (base.Configuration.Duties.WhitelistedDutyCfcIds.Contains(num)) - { - currentItem = 1; - } - if (base.Configuration.Duties.BlacklistedDutyCfcIds.Contains(num)) - { - currentItem = 2; - } + base.Configuration.Duties.ExpansionHeaderStates[key] = true; + Save(); } - else + ImU8String imU8String = new ImU8String(6, 1); + imU8String.AppendLiteral("Duties"); + imU8String.AppendFormatted(eExpansionVersion); + TableDisposable val2 = ImRaii.Table(imU8String, 3, ImGuiTableFlags.SizingFixedFit); + try { - array = new string[2] { "Disabled", "Enabled" }; - currentItem = (base.Configuration.Duties.WhitelistedDutyCfcIds.Contains(num) ? 1 : 0); - } - if (ImGui.TableNextColumn()) - { - ImGui.AlignTextToFramePadding(); - ImGui.TextUnformatted(text); - if (ImGui.IsItemHovered() && base.Configuration.Advanced.AdditionalStatusInformation) + if (!TableDisposable.op_Implicit(val2)) { - using ImRaii.IEndObject endObject3 = ImRaii.Tooltip(); - if (endObject3) + continue; + } + ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthStretch); + ImGui.TableSetupColumn("Enabled", ImGuiTableColumnFlags.WidthFixed, 200f); + ImGui.TableSetupColumn("Mode", ImGuiTableColumnFlags.WidthFixed, 150f); + if (!contentByExpansion.TryGetValue(eExpansionVersion, out List value)) + { + continue; + } + foreach (DutyInfo item3 in value) + { + item3.Deconstruct(out uint CfcId, out uint TerritoryId, out string Name); + uint num = CfcId; + uint value2 = TerritoryId; + string text = Name; + DutyOptions dutyOptions; + bool flag = _questRegistry.TryGetDutyByContentFinderConditionId(num, out dutyOptions); + ImGui.TableNextRow(); + string[] array; + int currentItem; + if (flag) { - ImGui.TextUnformatted(text); - ImGui.Separator(); - ImU8String text2 = new ImU8String(13, 1); - text2.AppendLiteral("TerritoryId: "); - text2.AppendFormatted(value2); - ImGui.BulletText(text2); - ImU8String text3 = new ImU8String(26, 1); - text3.AppendLiteral("ContentFinderConditionId: "); - text3.AppendFormatted(num); - ImGui.BulletText(text3); - if (flag) + array = (dutyOptions.Enabled ? SupportedCfcOptions : UnsupportedCfcOptions); + currentItem = 0; + if (base.Configuration.Duties.WhitelistedDutyCfcIds.Contains(num)) { - ImGui.BulletText("Duty Support: Available"); + currentItem = 1; } - } - } - if (runInstancedContentWithAutoDuty && !_autoDutyIpc.HasPath(num)) - { - ImGuiComponents.HelpMarker("This duty is not supported by AutoDuty", FontAwesomeIcon.Times, ImGuiColors.DalamudRed); - } - else if (flag && dutyOptions.Notes.Count > 0) - { - ConfigComponent.DrawNotes(dutyOptions.Enabled, dutyOptions.Notes); - } - } - if (ImGui.TableNextColumn()) - { - ImU8String id = new ImU8String(16, 1); - id.AppendLiteral("##DungeonEnabled"); - id.AppendFormatted(num); - using (ImRaii.PushId(id)) - { - ImGui.SetNextItemWidth(200f); - if (ImGui.Combo((ImU8String)string.Empty, ref currentItem, (ReadOnlySpan)array, array.Length)) - { - base.Configuration.Duties.WhitelistedDutyCfcIds.Remove(num); - base.Configuration.Duties.BlacklistedDutyCfcIds.Remove(num); - if (flag) + if (base.Configuration.Duties.BlacklistedDutyCfcIds.Contains(num)) { - switch (currentItem) - { - case 1: - base.Configuration.Duties.WhitelistedDutyCfcIds.Add(num); - break; - case 2: - base.Configuration.Duties.BlacklistedDutyCfcIds.Add(num); - break; - } + currentItem = 2; } - else if (currentItem == 1) - { - base.Configuration.Duties.WhitelistedDutyCfcIds.Add(num); - } - Save(); - } - } - } - if (!ImGui.TableNextColumn()) - { - continue; - } - ImU8String id2 = new ImU8String(13, 1); - id2.AppendLiteral("##DungeonMode"); - id2.AppendFormatted(num); - using (ImRaii.PushId(id2)) - { - EDutyMode value3; - bool flag2 = base.Configuration.Duties.DutyModeOverrides.TryGetValue(num, out value3); - EDutyMode num2 = (flag2 ? value3 : ((EDutyMode)(-1))); - Name = "Use Default"; - string[] dutyModeLabels = DutyModeLabels; - int num3 = 0; - string[] array2 = new string[1 + dutyModeLabels.Length]; - array2[num3] = Name; - num3++; - ReadOnlySpan readOnlySpan = new ReadOnlySpan(dutyModeLabels); - readOnlySpan.CopyTo(new Span(array2).Slice(num3, readOnlySpan.Length)); - num3 += readOnlySpan.Length; - string[] array3 = array2; - int currentItem2 = (int)(num2 + 1); - ImGui.SetNextItemWidth(150f); - if (ImGui.Combo((ImU8String)string.Empty, ref currentItem2, (ReadOnlySpan)array3, array3.Length)) - { - if (currentItem2 == 0) - { - base.Configuration.Duties.DutyModeOverrides.Remove(num); } else { - base.Configuration.Duties.DutyModeOverrides[num] = (EDutyMode)(currentItem2 - 1); + array = new string[2] { "Disabled", "Enabled" }; + currentItem = (base.Configuration.Duties.WhitelistedDutyCfcIds.Contains(num) ? 1 : 0); + } + if (ImGui.TableNextColumn()) + { + ImGui.AlignTextToFramePadding(); + ImGui.TextUnformatted(text); + if (ImGui.IsItemHovered() && base.Configuration.Advanced.AdditionalStatusInformation) + { + TooltipDisposable val3 = ImRaii.Tooltip(); + try + { + if (((TooltipDisposable)(ref val3)).Alive) + { + ImGui.TextUnformatted(text); + ImGui.Separator(); + ImU8String text2 = new ImU8String(13, 1); + text2.AppendLiteral("TerritoryId: "); + text2.AppendFormatted(value2); + ImGui.BulletText(text2); + ImU8String text3 = new ImU8String(26, 1); + text3.AppendLiteral("ContentFinderConditionId: "); + text3.AppendFormatted(num); + ImGui.BulletText(text3); + if (flag) + { + ImGui.BulletText("Duty Support: Available"); + } + } + } + finally + { + ((TooltipDisposable)(ref val3)).Dispose(); + } + } + if (runInstancedContentWithAutoDuty && !_autoDutyIpc.HasPath(num)) + { + ImGuiComponents.HelpMarker("This duty is not supported by AutoDuty", FontAwesomeIcon.Times, (Vector4?)ImGuiColors.DalamudRed); + } + else if (flag && dutyOptions.Notes.Count > 0) + { + ConfigComponent.DrawNotes(dutyOptions.Enabled, dutyOptions.Notes); + } + } + if (ImGui.TableNextColumn()) + { + ImU8String imU8String2 = new ImU8String(16, 1); + imU8String2.AppendLiteral("##DungeonEnabled"); + imU8String2.AppendFormatted(num); + IdDisposable val4 = ImRaii.PushId(imU8String2, true); + try + { + ImGui.SetNextItemWidth(200f); + if (ImGui.Combo((ImU8String)string.Empty, ref currentItem, (ReadOnlySpan)array, array.Length)) + { + base.Configuration.Duties.WhitelistedDutyCfcIds.Remove(num); + base.Configuration.Duties.BlacklistedDutyCfcIds.Remove(num); + if (flag) + { + switch (currentItem) + { + case 1: + base.Configuration.Duties.WhitelistedDutyCfcIds.Add(num); + break; + case 2: + base.Configuration.Duties.BlacklistedDutyCfcIds.Add(num); + break; + } + } + else if (currentItem == 1) + { + base.Configuration.Duties.WhitelistedDutyCfcIds.Add(num); + } + Save(); + } + } + finally + { + ((IDisposable)val4)?.Dispose(); + } + } + if (!ImGui.TableNextColumn()) + { + continue; + } + ImU8String imU8String3 = new ImU8String(13, 1); + imU8String3.AppendLiteral("##DungeonMode"); + imU8String3.AppendFormatted(num); + IdDisposable val5 = ImRaii.PushId(imU8String3, true); + try + { + EDutyMode value3; + bool flag2 = base.Configuration.Duties.DutyModeOverrides.TryGetValue(num, out value3); + EDutyMode num2 = (flag2 ? value3 : ((EDutyMode)(-1))); + Name = "Use Default"; + string[] dutyModeLabels = DutyModeLabels; + int num3 = 0; + string[] array2 = new string[1 + dutyModeLabels.Length]; + array2[num3] = Name; + num3++; + ReadOnlySpan readOnlySpan = new ReadOnlySpan(dutyModeLabels); + readOnlySpan.CopyTo(new Span(array2).Slice(num3, readOnlySpan.Length)); + num3 += readOnlySpan.Length; + string[] array3 = array2; + int currentItem2 = (int)(num2 + 1); + ImGui.SetNextItemWidth(150f); + if (ImGui.Combo((ImU8String)string.Empty, ref currentItem2, (ReadOnlySpan)array3, array3.Length)) + { + if (currentItem2 == 0) + { + base.Configuration.Duties.DutyModeOverrides.Remove(num); + } + else + { + base.Configuration.Duties.DutyModeOverrides[num] = (EDutyMode)(currentItem2 - 1); + } + Save(); + } + if (ImGui.IsItemHovered()) + { + EDutyMode eDutyMode = (flag2 ? value3 : base.Configuration.Duties.DefaultDutyMode); + ImGui.SetTooltip(flag2 ? ("Override: " + DutyModeLabels[(int)eDutyMode]) : ("Using default: " + DutyModeLabels[(int)eDutyMode])); + } + } + finally + { + ((IDisposable)val5)?.Dispose(); } - Save(); - } - if (ImGui.IsItemHovered()) - { - EDutyMode eDutyMode = (flag2 ? value3 : base.Configuration.Duties.DefaultDutyMode); - ImGui.SetTooltip(flag2 ? ("Override: " + DutyModeLabels[(int)eDutyMode]) : ("Using default: " + DutyModeLabels[(int)eDutyMode])); } } + finally + { + ((TableDisposable)(ref val2)).Dispose(); + } + } + else if (base.Configuration.Duties.ExpansionHeaderStates.GetValueOrDefault(key, defaultValue: false)) + { + base.Configuration.Duties.ExpansionHeaderStates[key] = false; + Save(); } } - else if (base.Configuration.Duties.ExpansionHeaderStates.GetValueOrDefault(key, defaultValue: false)) - { - base.Configuration.Duties.ExpansionHeaderStates[key] = false; - Save(); - } + } + finally + { + ((ChildDisposable)(ref val)).Dispose(); } } @@ -441,7 +554,8 @@ internal sealed class DutyConfigComponent : ConfigComponent private void DrawClipboardButtons() { - using (ImRaii.Disabled(base.Configuration.Duties.WhitelistedDutyCfcIds.Count + base.Configuration.Duties.BlacklistedDutyCfcIds.Count + base.Configuration.Duties.DutyModeOverrides.Count == 0)) + DisabledDisposable val = ImRaii.Disabled(base.Configuration.Duties.WhitelistedDutyCfcIds.Count + base.Configuration.Duties.BlacklistedDutyCfcIds.Count + base.Configuration.Duties.DutyModeOverrides.Count == 0); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Copy, "Export to clipboard")) { @@ -451,9 +565,14 @@ internal sealed class DutyConfigComponent : ConfigComponent ImGui.SetClipboardText("qst:duty:" + Convert.ToBase64String(Encoding.UTF8.GetBytes(string.Join(";", first.Concat(second).Concat(second2))))); } } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.SameLine(); string text = ImGui.GetClipboardText().Trim(); - using (ImRaii.Disabled(string.IsNullOrEmpty(text) || !text.StartsWith("qst:duty:", StringComparison.InvariantCulture))) + val = ImRaii.Disabled(string.IsNullOrEmpty(text) || !text.StartsWith("qst:duty:", StringComparison.InvariantCulture)); + try { if (!ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Paste, "Import from Clipboard")) { @@ -492,11 +611,16 @@ internal sealed class DutyConfigComponent : ConfigComponent } Save(); } + finally + { + ((IDisposable)val)?.Dispose(); + } } private void DrawResetButton() { - using (ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl))) + DisabledDisposable val = ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl)); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Undo, "Reset to default")) { @@ -507,6 +631,10 @@ internal sealed class DutyConfigComponent : ConfigComponent Save(); } } + finally + { + ((IDisposable)val)?.Dispose(); + } if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { ImGui.SetTooltip("Hold CTRL to enable this button."); diff --git a/Questionable/Questionable.Windows.ConfigComponents/GeneralConfigComponent.cs b/Questionable/Questionable.Windows.ConfigComponents/GeneralConfigComponent.cs index cb63d08..0388a23 100644 --- a/Questionable/Questionable.Windows.ConfigComponents/GeneralConfigComponent.cs +++ b/Questionable/Questionable.Windows.ConfigComponents/GeneralConfigComponent.cs @@ -95,384 +95,533 @@ internal sealed class GeneralConfigComponent : ConfigComponent public override void DrawTab() { - using ImRaii.IEndObject endObject = ImRaii.TabItem("General###General"); - if (!endObject) + //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) + //IL_0147: Unknown result type (might be due to invalid IL or missing references) + //IL_014c: Unknown result type (might be due to invalid IL or missing references) + //IL_014e: Unknown result type (might be due to invalid IL or missing references) + //IL_02fc: Unknown result type (might be due to invalid IL or missing references) + //IL_0301: Unknown result type (might be due to invalid IL or missing references) + //IL_042d: Unknown result type (might be due to invalid IL or missing references) + //IL_0432: Unknown result type (might be due to invalid IL or missing references) + //IL_0434: Unknown result type (might be due to invalid IL or missing references) + //IL_0737: Unknown result type (might be due to invalid IL or missing references) + //IL_073c: Unknown result type (might be due to invalid IL or missing references) + //IL_07de: Unknown result type (might be due to invalid IL or missing references) + //IL_07e3: Unknown result type (might be due to invalid IL or missing references) + //IL_0885: Unknown result type (might be due to invalid IL or missing references) + //IL_088a: Unknown result type (might be due to invalid IL or missing references) + //IL_09ac: Unknown result type (might be due to invalid IL or missing references) + //IL_09b1: Unknown result type (might be due to invalid IL or missing references) + //IL_0ad2: Unknown result type (might be due to invalid IL or missing references) + //IL_0ad7: Unknown result type (might be due to invalid IL or missing references) + //IL_0c5e: Unknown result type (might be due to invalid IL or missing references) + //IL_0c63: Unknown result type (might be due to invalid IL or missing references) + //IL_0d05: Unknown result type (might be due to invalid IL or missing references) + //IL_0d0a: Unknown result type (might be due to invalid IL or missing references) + //IL_0dac: Unknown result type (might be due to invalid IL or missing references) + //IL_0db1: Unknown result type (might be due to invalid IL or missing references) + TabItemDisposable val = ImRaii.TabItem((ImU8String)"General###General"); + try { - return; - } - int currentItem = (int)base.Configuration.General.CombatModule; - if (ImGui.Combo((ImU8String)"Preferred Combat Module", ref currentItem, (ReadOnlySpan)_combatModuleNames, _combatModuleNames.Length)) - { - base.Configuration.General.CombatModule = (Configuration.ECombatModule)currentItem; - Save(); - } - int num = Array.FindIndex(_mountIds, (uint x) => x == base.Configuration.General.MountId); - if (num == -1) - { - num = 0; - base.Configuration.General.MountId = _mountIds[num]; - Save(); - } - string text = ((num >= 0 && num < _mountNames.Length) ? _mountNames[num] : "Unknown"); - if (ImGui.BeginCombo("Preferred Mount", text, ImGuiComboFlags.HeightLarge)) - { - if (!_mountComboJustOpened) + if (!val) { - ImGui.SetKeyboardFocusHere(); - _mountComboJustOpened = true; + return; } - ImGui.SetNextItemWidth(-1f); - ImGui.InputTextWithHint("##MountSearch", "Search mounts...", ref _mountSearchText, 256); - ImGui.Separator(); - using (ImRaii.IEndObject endObject2 = ImRaii.Child("##MountScrollArea", new Vector2(0f, 300f), border: false)) + int currentItem = (int)base.Configuration.General.CombatModule; + if (ImGui.Combo((ImU8String)"Preferred Combat Module", ref currentItem, (ReadOnlySpan)_combatModuleNames, _combatModuleNames.Length)) { - if (endObject2) + base.Configuration.General.CombatModule = (Configuration.ECombatModule)currentItem; + Save(); + } + int num = Array.FindIndex(_mountIds, (uint x) => x == base.Configuration.General.MountId); + if (num == -1) + { + num = 0; + base.Configuration.General.MountId = _mountIds[num]; + Save(); + } + string text = ((num >= 0 && num < _mountNames.Length) ? _mountNames[num] : "Unknown"); + if (ImGui.BeginCombo("Preferred Mount", text, ImGuiComboFlags.HeightLarge)) + { + if (!_mountComboJustOpened) { - string value = _mountSearchText.ToUpperInvariant(); - for (int num2 = 0; num2 < _mountNames.Length; num2++) + ImGui.SetKeyboardFocusHere(); + _mountComboJustOpened = true; + } + ImGui.SetNextItemWidth(-1f); + ImGui.InputTextWithHint("##MountSearch", "Search mounts...", ref _mountSearchText, 256); + ImGui.Separator(); + ChildDisposable val2 = ImRaii.Child((ImU8String)"##MountScrollArea", new Vector2(0f, 300f), false); + try + { + if (ChildDisposable.op_Implicit(val2)) { - if (string.IsNullOrEmpty(_mountSearchText) || _mountNames[num2].ToUpperInvariant().Contains(value, StringComparison.Ordinal)) + string value = _mountSearchText.ToUpperInvariant(); + for (int num2 = 0; num2 < _mountNames.Length; num2++) { - bool flag = num2 == num; - if (ImGui.Selectable(_mountNames[num2], flag)) + if (string.IsNullOrEmpty(_mountSearchText) || _mountNames[num2].ToUpperInvariant().Contains(value, StringComparison.Ordinal)) { - base.Configuration.General.MountId = _mountIds[num2]; - Save(); - _mountSearchText = string.Empty; - ImGui.CloseCurrentPopup(); - } - if (flag) - { - ImGui.SetItemDefaultFocus(); + bool flag = num2 == num; + if (ImGui.Selectable(_mountNames[num2], flag)) + { + base.Configuration.General.MountId = _mountIds[num2]; + Save(); + _mountSearchText = string.Empty; + ImGui.CloseCurrentPopup(); + } + if (flag) + { + ImGui.SetItemDefaultFocus(); + } } } } } - } - ImGui.EndCombo(); - } - else - { - _mountComboJustOpened = false; - } - int currentItem2 = (int)base.Configuration.General.GrandCompany; - if (ImGui.Combo((ImU8String)"Preferred Grand Company", ref currentItem2, (ReadOnlySpan)_grandCompanyNames, _grandCompanyNames.Length)) - { - base.Configuration.General.GrandCompany = (FFXIVClientStructs.FFXIV.Client.UI.Agent.GrandCompany)currentItem2; - Save(); - } - int currentItem3 = (int)base.Configuration.General.MsqPriority; - if (ImGui.Combo((ImU8String)"MSQ Priority", ref currentItem3, (ReadOnlySpan)_msqPriorityNames, _msqPriorityNames.Length)) - { - base.Configuration.General.MsqPriority = (Configuration.EMsqPriorityMode)currentItem3; - Save(); - } - ImGui.SameLine(); - using (ImRaii.PushFont(UiBuilder.IconFont)) - { - ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); - } - if (ImGui.IsItemHovered()) - { - using (ImRaii.Tooltip()) - { - ImGui.Text("Controls when the Main Scenario Quest (MSQ) is automatically accepted:"); - ImGui.Spacing(); - ImGui.BulletText("Always: Auto-accept MSQ immediately"); - ImGui.BulletText("After Tracked: Complete accepted quests first, then pick up MSQ"); - ImGui.BulletText("Manual: Never auto-accept MSQ, only do manually accepted quests"); - } - } - int num3 = Array.IndexOf(_classJobIds, base.Configuration.General.CombatJob); - if (num3 == -1) - { - base.Configuration.General.CombatJob = EClassJob.Adventurer; - Save(); - num3 = 0; - } - string text2 = ((num3 >= 0 && num3 < _classJobNames.Length) ? _classJobNames[num3] : "Unknown"); - if (ImGui.BeginCombo("Preferred Combat Job", text2, ImGuiComboFlags.HeightLarge)) - { - if (!_classJobComboJustOpened) - { - ImGui.SetKeyboardFocusHere(); - _classJobComboJustOpened = true; - } - ImGui.SetNextItemWidth(-1f); - ImGui.InputTextWithHint("##CombatJobSearch", "Search combat jobs...", ref _classJobSearchText, 256); - ImGui.Separator(); - using (ImRaii.IEndObject endObject3 = ImRaii.Child("##CombatJobScrollArea", new Vector2(0f, 300f), border: false)) - { - if (endObject3) + finally { - string value2 = _classJobSearchText.ToUpperInvariant(); - for (int num4 = 0; num4 < _classJobNames.Length; num4++) - { - if (string.IsNullOrEmpty(_classJobSearchText) || _classJobNames[num4].ToUpperInvariant().Contains(value2, StringComparison.Ordinal)) - { - bool flag2 = num4 == num3; - if (ImGui.Selectable(_classJobNames[num4], flag2)) - { - base.Configuration.General.CombatJob = _classJobIds[num4]; - Save(); - _classJobSearchText = string.Empty; - ImGui.CloseCurrentPopup(); - } - if (flag2) - { - ImGui.SetItemDefaultFocus(); - } - } - } + ((ChildDisposable)(ref val2)).Dispose(); } + ImGui.EndCombo(); } - ImGui.EndCombo(); - } - else - { - _classJobComboJustOpened = false; - } - ImGui.Separator(); - ImGui.Text("UI"); - using (ImRaii.PushIndent()) - { - bool v = base.Configuration.General.HideInAllInstances; - if (ImGui.Checkbox("Hide quest window in all instanced duties", ref v)) + else { - base.Configuration.General.HideInAllInstances = v; + _mountComboJustOpened = false; + } + int currentItem2 = (int)base.Configuration.General.GrandCompany; + if (ImGui.Combo((ImU8String)"Preferred Grand Company", ref currentItem2, (ReadOnlySpan)_grandCompanyNames, _grandCompanyNames.Length)) + { + base.Configuration.General.GrandCompany = (FFXIVClientStructs.FFXIV.Client.UI.Agent.GrandCompany)currentItem2; Save(); } - bool v2 = base.Configuration.General.UseEscToCancelQuesting; - if (ImGui.Checkbox("Double tap ESC to cancel questing/movement", ref v2)) + int currentItem3 = (int)base.Configuration.General.MsqPriority; + if (ImGui.Combo((ImU8String)"MSQ Priority", ref currentItem3, (ReadOnlySpan)_msqPriorityNames, _msqPriorityNames.Length)) { - base.Configuration.General.UseEscToCancelQuesting = v2; - Save(); - } - bool v3 = base.Configuration.General.StopOnPlayerInput; - if (ImGui.Checkbox("Stop automation when manually moving character", ref v3)) - { - base.Configuration.General.StopOnPlayerInput = v3; - Save(); - } - bool v4 = base.Configuration.General.ShowIncompleteSeasonalEvents; - if (ImGui.Checkbox("Show details for incomplete seasonal events", ref v4)) - { - base.Configuration.General.ShowIncompleteSeasonalEvents = v4; - Save(); - } - bool v5 = base.Configuration.General.HideSeasonalEventsFromJournalProgress; - if (ImGui.Checkbox("Hide Seasonal Events from Journal Progress", ref v5)) - { - base.Configuration.General.HideSeasonalEventsFromJournalProgress = v5; - Save(); - } - bool v6 = base.Configuration.General.ShowChangelogOnUpdate; - if (ImGui.Checkbox("Show changelog window when plugin updates", ref v6)) - { - base.Configuration.General.ShowChangelogOnUpdate = v6; - Save(); - } - } - ImGui.Separator(); - ImGui.Text("Questing"); - using (ImRaii.PushIndent()) - { - bool v7 = base.Configuration.General.AutoSolveQte; - if (ImGui.Checkbox("Automatically solve Quick Time Events (QTEs)", ref v7)) - { - base.Configuration.General.AutoSolveQte = v7; + base.Configuration.General.MsqPriority = (Configuration.EMsqPriorityMode)currentItem3; Save(); } ImGui.SameLine(); - using (ImRaii.PushFont(UiBuilder.IconFont)) + FontDisposable val3 = ImRaii.PushFont(UiBuilder.IconFont, true); + try { ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); } - if (ImGui.IsItemHovered()) + finally { - using (ImRaii.Tooltip()) - { - ImGui.Text("Automatically mashes the button during Active Time Maneuver (ATM)"); - ImGui.Text("prompts that appear in certain duties and quest battles."); - } - } - bool v8 = base.Configuration.General.AutoSnipe; - if (ImGui.Checkbox("Automatically complete snipe quests", ref v8)) - { - base.Configuration.General.AutoSnipe = v8; - Save(); - } - ImGui.SameLine(); - using (ImRaii.PushFont(UiBuilder.IconFont)) - { - ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); + ((IDisposable)val3)?.Dispose(); } if (ImGui.IsItemHovered()) { - using (ImRaii.Tooltip()) + TooltipDisposable val4 = ImRaii.Tooltip(); + try { - ImGui.Text("Automatically completes sniping minigames introduced in Stormblood."); - ImGui.Text("When enabled, snipe targets are instantly hit without manual aiming."); - } - } - bool v9 = base.Configuration.General.CinemaMode; - if (ImGui.Checkbox("Cinema Mode (watch cutscenes)", ref v9)) - { - base.Configuration.General.CinemaMode = v9; - Save(); - } - ImGui.SameLine(); - using (ImRaii.PushFont(UiBuilder.IconFont)) - { - ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); - } - if (ImGui.IsItemHovered()) - { - using (ImRaii.Tooltip()) - { - ImGui.Text("When enabled, cutscenes will NOT be automatically skipped."); - ImGui.Text("This allows you to experience the story while Questionable"); - ImGui.Text("handles navigation, combat, and other gameplay automation."); + ImGui.Text("Controls when the Main Scenario Quest (MSQ) is automatically accepted:"); ImGui.Spacing(); - ImGui.TextColored(new Vector4(0.7f, 0.7f, 0.7f, 1f), "Recommended for first-time story playthroughs."); + ImGui.BulletText("Always: Auto-accept MSQ immediately"); + ImGui.BulletText("After Tracked: Complete accepted quests first, then pick up MSQ"); + ImGui.BulletText("Manual: Never auto-accept MSQ, only do manually accepted quests"); + } + finally + { + ((TooltipDisposable)(ref val4)).Dispose(); } } - bool v10 = base.Configuration.General.ConfigureTextAdvance; - if (ImGui.Checkbox("Automatically configure TextAdvance with the recommended settings", ref v10)) + int num3 = Array.IndexOf(_classJobIds, base.Configuration.General.CombatJob); + if (num3 == -1) { - base.Configuration.General.ConfigureTextAdvance = v10; + base.Configuration.General.CombatJob = EClassJob.Adventurer; Save(); + num3 = 0; } - bool v11 = base.Configuration.General.SkipLowPriorityDuties; - if (ImGui.Checkbox("Unlock certain optional dungeons and raids (instead of waiting for completion)", ref v11)) + string text2 = ((num3 >= 0 && num3 < _classJobNames.Length) ? _classJobNames[num3] : "Unknown"); + if (ImGui.BeginCombo("Preferred Combat Job", text2, ImGuiComboFlags.HeightLarge)) { - base.Configuration.General.SkipLowPriorityDuties = v11; - Save(); - } - ImGui.SameLine(); - using (ImRaii.PushFont(UiBuilder.IconFont)) - { - ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); - } - if (ImGui.IsItemHovered()) - { - using (ImRaii.Tooltip()) + if (!_classJobComboJustOpened) { - ImGui.Text("Questionable automatically picks up some optional quests (e.g. for aether currents, or the ARR alliance raids)."); - ImGui.Text("If this setting is enabled, Questionable will continue with other quests, instead of waiting for manual completion of the duty."); - ImGui.Separator(); - ImGui.Text("This affects the following dungeons and raids:"); - foreach (var lowPriorityContentFinderConditionQuest in _questRegistry.LowPriorityContentFinderConditionQuests) + ImGui.SetKeyboardFocusHere(); + _classJobComboJustOpened = true; + } + ImGui.SetNextItemWidth(-1f); + ImGui.InputTextWithHint("##CombatJobSearch", "Search combat jobs...", ref _classJobSearchText, 256); + ImGui.Separator(); + ChildDisposable val5 = ImRaii.Child((ImU8String)"##CombatJobScrollArea", new Vector2(0f, 300f), false); + try + { + if (ChildDisposable.op_Implicit(val5)) { - if (_territoryData.TryGetContentFinderCondition(lowPriorityContentFinderConditionQuest.ContentFinderConditionId, out TerritoryData.ContentFinderConditionData contentFinderConditionData)) + string value2 = _classJobSearchText.ToUpperInvariant(); + for (int num4 = 0; num4 < _classJobNames.Length; num4++) { - ImU8String text3 = new ImU8String(0, 1); - text3.AppendFormatted(contentFinderConditionData.Name); - ImGui.BulletText(text3); + if (string.IsNullOrEmpty(_classJobSearchText) || _classJobNames[num4].ToUpperInvariant().Contains(value2, StringComparison.Ordinal)) + { + bool flag2 = num4 == num3; + if (ImGui.Selectable(_classJobNames[num4], flag2)) + { + base.Configuration.General.CombatJob = _classJobIds[num4]; + Save(); + _classJobSearchText = string.Empty; + ImGui.CloseCurrentPopup(); + } + if (flag2) + { + ImGui.SetItemDefaultFocus(); + } + } } } } - } - ImGui.Spacing(); - bool v12 = base.Configuration.General.AutoStepRefreshEnabled; - if (ImGui.Checkbox("Automatically refresh quest steps when stuck", ref v12)) - { - base.Configuration.General.AutoStepRefreshEnabled = v12; - Save(); - } - ImGui.SameLine(); - using (ImRaii.PushFont(UiBuilder.IconFont)) - { - ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); - } - if (ImGui.IsItemHovered()) - { - using (ImRaii.Tooltip()) + finally { - ImGui.Text("Questionable will automatically refresh a quest step if it appears to be stuck after the configured delay."); - ImGui.Text("This helps resume automated quest completion when interruptions occur."); + ((ChildDisposable)(ref val5)).Dispose(); } + ImGui.EndCombo(); } - using (ImRaii.Disabled(!v12)) + else { - ImGui.Indent(); - int v13 = base.Configuration.General.AutoStepRefreshDelaySeconds; - ImGui.SetNextItemWidth(150f); - if (ImGui.SliderInt("Refresh delay (seconds)", ref v13, 10, 180)) + _classJobComboJustOpened = false; + } + ImGui.Separator(); + ImGui.Text("UI"); + IndentDisposable val6 = ImRaii.PushIndent(1, true); + try + { + bool v = base.Configuration.General.HideInAllInstances; + if (ImGui.Checkbox("Hide quest window in all instanced duties", ref v)) { - base.Configuration.General.AutoStepRefreshDelaySeconds = v13; + base.Configuration.General.HideInAllInstances = v; + Save(); + } + bool v2 = base.Configuration.General.UseEscToCancelQuesting; + if (ImGui.Checkbox("Double tap ESC to cancel questing/movement", ref v2)) + { + base.Configuration.General.UseEscToCancelQuesting = v2; + Save(); + } + bool v3 = base.Configuration.General.StopOnPlayerInput; + if (ImGui.Checkbox("Stop automation when manually moving character", ref v3)) + { + base.Configuration.General.StopOnPlayerInput = v3; + Save(); + } + bool v4 = base.Configuration.General.ShowIncompleteSeasonalEvents; + if (ImGui.Checkbox("Show details for incomplete seasonal events", ref v4)) + { + base.Configuration.General.ShowIncompleteSeasonalEvents = v4; + Save(); + } + bool v5 = base.Configuration.General.HideSeasonalEventsFromJournalProgress; + if (ImGui.Checkbox("Hide Seasonal Events from Journal Progress", ref v5)) + { + base.Configuration.General.HideSeasonalEventsFromJournalProgress = v5; + Save(); + } + bool v6 = base.Configuration.General.ShowChangelogOnUpdate; + if (ImGui.Checkbox("Show changelog window when plugin updates", ref v6)) + { + base.Configuration.General.ShowChangelogOnUpdate = v6; Save(); } - Vector4 col = new Vector4(0.7f, 0.7f, 0.7f, 1f); - ImU8String text4 = new ImU8String(77, 1); - text4.AppendLiteral("Quest steps will refresh automatically after "); - text4.AppendFormatted(v13); - text4.AppendLiteral(" seconds if no progress is made."); - ImGui.TextColored(in col, text4); - ImGui.Unindent(); } - ImGui.Spacing(); + finally + { + ((IDisposable)val6)?.Dispose(); + } ImGui.Separator(); - ImGui.Text("Priority Quest Management"); - bool v14 = base.Configuration.General.PersistPriorityQuestsBetweenSessions; - if (ImGui.Checkbox("Save priority quests between sessions", ref v14)) + ImGui.Text("Questing"); + val6 = ImRaii.PushIndent(1, true); + try { - base.Configuration.General.PersistPriorityQuestsBetweenSessions = v14; - Save(); - } - ImGui.SameLine(); - using (ImRaii.PushFont(UiBuilder.IconFont)) - { - ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); - } - if (ImGui.IsItemHovered()) - { - using (ImRaii.Tooltip()) + bool v7 = base.Configuration.General.AutoSolveQte; + if (ImGui.Checkbox("Automatically solve Quick Time Events (QTEs)", ref v7)) { - ImGui.Text("When enabled, your priority quest list will be saved and restored"); - ImGui.Text("when the plugin reloads or the game restarts."); + base.Configuration.General.AutoSolveQte = v7; + Save(); + } + ImGui.SameLine(); + val3 = ImRaii.PushFont(UiBuilder.IconFont, true); + try + { + ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); + } + finally + { + ((IDisposable)val3)?.Dispose(); + } + if (ImGui.IsItemHovered()) + { + TooltipDisposable val7 = ImRaii.Tooltip(); + try + { + ImGui.Text("Automatically mashes the button during Active Time Maneuver (ATM)"); + ImGui.Text("prompts that appear in certain duties and quest battles."); + } + finally + { + ((TooltipDisposable)(ref val7)).Dispose(); + } + } + bool v8 = base.Configuration.General.AutoSnipe; + if (ImGui.Checkbox("Automatically complete snipe quests", ref v8)) + { + base.Configuration.General.AutoSnipe = v8; + Save(); + } + ImGui.SameLine(); + val3 = ImRaii.PushFont(UiBuilder.IconFont, true); + try + { + ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); + } + finally + { + ((IDisposable)val3)?.Dispose(); + } + if (ImGui.IsItemHovered()) + { + TooltipDisposable val8 = ImRaii.Tooltip(); + try + { + ImGui.Text("Automatically completes sniping minigames introduced in Stormblood."); + ImGui.Text("When enabled, snipe targets are instantly hit without manual aiming."); + } + finally + { + ((TooltipDisposable)(ref val8)).Dispose(); + } + } + bool v9 = base.Configuration.General.CinemaMode; + if (ImGui.Checkbox("Cinema Mode (watch cutscenes)", ref v9)) + { + base.Configuration.General.CinemaMode = v9; + Save(); + } + ImGui.SameLine(); + val3 = ImRaii.PushFont(UiBuilder.IconFont, true); + try + { + ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); + } + finally + { + ((IDisposable)val3)?.Dispose(); + } + if (ImGui.IsItemHovered()) + { + TooltipDisposable val9 = ImRaii.Tooltip(); + try + { + ImGui.Text("When enabled, cutscenes will NOT be automatically skipped."); + ImGui.Text("This allows you to experience the story while Questionable"); + ImGui.Text("handles navigation, combat, and other gameplay automation."); + ImGui.Spacing(); + ImGui.TextColored(new Vector4(0.7f, 0.7f, 0.7f, 1f), "Recommended for first-time story playthroughs."); + } + finally + { + ((TooltipDisposable)(ref val9)).Dispose(); + } + } + bool v10 = base.Configuration.General.ConfigureTextAdvance; + if (ImGui.Checkbox("Automatically configure TextAdvance with the recommended settings", ref v10)) + { + base.Configuration.General.ConfigureTextAdvance = v10; + Save(); + } + bool v11 = base.Configuration.General.SkipLowPriorityDuties; + if (ImGui.Checkbox("Unlock certain optional dungeons and raids (instead of waiting for completion)", ref v11)) + { + base.Configuration.General.SkipLowPriorityDuties = v11; + Save(); + } + ImGui.SameLine(); + val3 = ImRaii.PushFont(UiBuilder.IconFont, true); + try + { + ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); + } + finally + { + ((IDisposable)val3)?.Dispose(); + } + if (ImGui.IsItemHovered()) + { + TooltipDisposable val10 = ImRaii.Tooltip(); + try + { + ImGui.Text("Questionable automatically picks up some optional quests (e.g. for aether currents, or the ARR alliance raids)."); + ImGui.Text("If this setting is enabled, Questionable will continue with other quests, instead of waiting for manual completion of the duty."); + ImGui.Separator(); + ImGui.Text("This affects the following dungeons and raids:"); + foreach (var lowPriorityContentFinderConditionQuest in _questRegistry.LowPriorityContentFinderConditionQuests) + { + if (_territoryData.TryGetContentFinderCondition(lowPriorityContentFinderConditionQuest.ContentFinderConditionId, out TerritoryData.ContentFinderConditionData contentFinderConditionData)) + { + ImU8String text3 = new ImU8String(0, 1); + text3.AppendFormatted(contentFinderConditionData.Name); + ImGui.BulletText(text3); + } + } + } + finally + { + ((TooltipDisposable)(ref val10)).Dispose(); + } + } + ImGui.Spacing(); + bool v12 = base.Configuration.General.AutoStepRefreshEnabled; + if (ImGui.Checkbox("Automatically refresh quest steps when stuck", ref v12)) + { + base.Configuration.General.AutoStepRefreshEnabled = v12; + Save(); + } + ImGui.SameLine(); + val3 = ImRaii.PushFont(UiBuilder.IconFont, true); + try + { + ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); + } + finally + { + ((IDisposable)val3)?.Dispose(); + } + if (ImGui.IsItemHovered()) + { + TooltipDisposable val11 = ImRaii.Tooltip(); + try + { + ImGui.Text("Questionable will automatically refresh a quest step if it appears to be stuck after the configured delay."); + ImGui.Text("This helps resume automated quest completion when interruptions occur."); + } + finally + { + ((TooltipDisposable)(ref val11)).Dispose(); + } + } + DisabledDisposable val12 = ImRaii.Disabled(!v12); + try + { + ImGui.Indent(); + int v13 = base.Configuration.General.AutoStepRefreshDelaySeconds; + ImGui.SetNextItemWidth(150f); + if (ImGui.SliderInt("Refresh delay (seconds)", ref v13, 10, 180)) + { + base.Configuration.General.AutoStepRefreshDelaySeconds = v13; + Save(); + } + Vector4 col = new Vector4(0.7f, 0.7f, 0.7f, 1f); + ImU8String text4 = new ImU8String(77, 1); + text4.AppendLiteral("Quest steps will refresh automatically after "); + text4.AppendFormatted(v13); + text4.AppendLiteral(" seconds if no progress is made."); + ImGui.TextColored(in col, text4); + ImGui.Unindent(); + } + finally + { + ((IDisposable)val12)?.Dispose(); + } + ImGui.Spacing(); + ImGui.Separator(); + ImGui.Text("Priority Quest Management"); + bool v14 = base.Configuration.General.PersistPriorityQuestsBetweenSessions; + if (ImGui.Checkbox("Save priority quests between sessions", ref v14)) + { + base.Configuration.General.PersistPriorityQuestsBetweenSessions = v14; + Save(); + } + ImGui.SameLine(); + val3 = ImRaii.PushFont(UiBuilder.IconFont, true); + try + { + ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); + } + finally + { + ((IDisposable)val3)?.Dispose(); + } + if (ImGui.IsItemHovered()) + { + TooltipDisposable val13 = ImRaii.Tooltip(); + try + { + ImGui.Text("When enabled, your priority quest list will be saved and restored"); + ImGui.Text("when the plugin reloads or the game restarts."); + } + finally + { + ((TooltipDisposable)(ref val13)).Dispose(); + } + } + bool v15 = base.Configuration.General.ClearPriorityQuestsOnLogout; + if (ImGui.Checkbox("Clear priority quests on character logout", ref v15)) + { + base.Configuration.General.ClearPriorityQuestsOnLogout = v15; + Save(); + } + ImGui.SameLine(); + val3 = ImRaii.PushFont(UiBuilder.IconFont, true); + try + { + ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); + } + finally + { + ((IDisposable)val3)?.Dispose(); + } + if (ImGui.IsItemHovered()) + { + TooltipDisposable val14 = ImRaii.Tooltip(); + try + { + ImGui.Text("Clears the priority queue when your character logs out."); + ImGui.Text("This also clears the saved list if persistence is enabled."); + } + finally + { + ((TooltipDisposable)(ref val14)).Dispose(); + } + } + bool v16 = base.Configuration.General.ClearPriorityQuestsOnCompletion; + if (ImGui.Checkbox("Remove priority quests when completed", ref v16)) + { + base.Configuration.General.ClearPriorityQuestsOnCompletion = v16; + Save(); + } + ImGui.SameLine(); + val3 = ImRaii.PushFont(UiBuilder.IconFont, true); + try + { + ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); + } + finally + { + ((IDisposable)val3)?.Dispose(); + } + if (ImGui.IsItemHovered()) + { + TooltipDisposable val15 = ImRaii.Tooltip(); + try + { + ImGui.Text("Automatically removes completed quests from your priority queue."); + ImGui.Text("This helps keep your priority list clean without manual intervention."); + return; + } + finally + { + ((TooltipDisposable)(ref val15)).Dispose(); + } } } - bool v15 = base.Configuration.General.ClearPriorityQuestsOnLogout; - if (ImGui.Checkbox("Clear priority quests on character logout", ref v15)) + finally { - base.Configuration.General.ClearPriorityQuestsOnLogout = v15; - Save(); - } - ImGui.SameLine(); - using (ImRaii.PushFont(UiBuilder.IconFont)) - { - ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); - } - if (ImGui.IsItemHovered()) - { - using (ImRaii.Tooltip()) - { - ImGui.Text("Clears the priority queue when your character logs out."); - ImGui.Text("This also clears the saved list if persistence is enabled."); - } - } - bool v16 = base.Configuration.General.ClearPriorityQuestsOnCompletion; - if (ImGui.Checkbox("Remove priority quests when completed", ref v16)) - { - base.Configuration.General.ClearPriorityQuestsOnCompletion = v16; - Save(); - } - ImGui.SameLine(); - using (ImRaii.PushFont(UiBuilder.IconFont)) - { - ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString()); - } - if (ImGui.IsItemHovered()) - { - using (ImRaii.Tooltip()) - { - ImGui.Text("Automatically removes completed quests from your priority queue."); - ImGui.Text("This helps keep your priority list clean without manual intervention."); - return; - } + ((IDisposable)val6)?.Dispose(); } } + finally + { + ((TabItemDisposable)(ref val)).Dispose(); + } } static GeneralConfigComponent() diff --git a/Questionable/Questionable.Windows.ConfigComponents/NotificationConfigComponent.cs b/Questionable/Questionable.Windows.ConfigComponents/NotificationConfigComponent.cs index c39f0db..13a5d68 100644 --- a/Questionable/Questionable.Windows.ConfigComponents/NotificationConfigComponent.cs +++ b/Questionable/Questionable.Windows.ConfigComponents/NotificationConfigComponent.cs @@ -30,69 +30,97 @@ internal sealed class NotificationConfigComponent : ConfigComponent public override void DrawTab() { - using ImRaii.IEndObject endObject = ImRaii.TabItem("Notifications###Notifications"); - if (!endObject) + //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) + //IL_0141: Unknown result type (might be due to invalid IL or missing references) + //IL_0146: Unknown result type (might be due to invalid IL or missing references) + //IL_0148: Unknown result type (might be due to invalid IL or missing references) + TabItemDisposable val = ImRaii.TabItem((ImU8String)"Notifications###Notifications"); + try { - return; - } - bool v = base.Configuration.Notifications.Enabled; - if (ImGui.Checkbox("Enable notifications when manual interaction is required", ref v)) - { - base.Configuration.Notifications.Enabled = v; - Save(); - } - using (ImRaii.Disabled(!base.Configuration.Notifications.Enabled)) - { - using (ImRaii.PushIndent()) + if (!val) { - int num = Array.IndexOf(_xivChatTypes, base.Configuration.Notifications.ChatType); - if (num == -1) + return; + } + bool v = base.Configuration.Notifications.Enabled; + if (ImGui.Checkbox("Enable notifications when manual interaction is required", ref v)) + { + base.Configuration.Notifications.Enabled = v; + Save(); + } + DisabledDisposable val2 = ImRaii.Disabled(!base.Configuration.Notifications.Enabled); + try + { + IndentDisposable val3 = ImRaii.PushIndent(1, true); + try { - num = 0; - } - string text = ((num >= 0 && num < _chatTypeNames.Length) ? _chatTypeNames[num] : "Unknown"); - if (ImGui.BeginCombo("Chat channel", text, ImGuiComboFlags.HeightLarge)) - { - if (!_chatChannelComboJustOpened) + int num = Array.IndexOf(_xivChatTypes, base.Configuration.Notifications.ChatType); + if (num == -1) { - ImGui.SetKeyboardFocusHere(); - _chatChannelComboJustOpened = true; + num = 0; } - ImGui.SetNextItemWidth(-1f); - ImGui.InputTextWithHint("##ChatChannelSearch", "Search chat channels...", ref _chatChannelSearchText, 256); - ImGui.Separator(); - using (ImRaii.IEndObject endObject2 = ImRaii.Child("##ChatChannelScrollArea", new Vector2(0f, 300f), border: false)) + string text = ((num >= 0 && num < _chatTypeNames.Length) ? _chatTypeNames[num] : "Unknown"); + if (ImGui.BeginCombo("Chat channel", text, ImGuiComboFlags.HeightLarge)) { - if (endObject2) + if (!_chatChannelComboJustOpened) { - string value = _chatChannelSearchText.ToUpperInvariant(); - for (int i = 0; i < _chatTypeNames.Length; i++) + ImGui.SetKeyboardFocusHere(); + _chatChannelComboJustOpened = true; + } + ImGui.SetNextItemWidth(-1f); + ImGui.InputTextWithHint("##ChatChannelSearch", "Search chat channels...", ref _chatChannelSearchText, 256); + ImGui.Separator(); + ChildDisposable val4 = ImRaii.Child((ImU8String)"##ChatChannelScrollArea", new Vector2(0f, 300f), false); + try + { + if (ChildDisposable.op_Implicit(val4)) { - if (string.IsNullOrEmpty(_chatChannelSearchText) || _chatTypeNames[i].ToUpperInvariant().Contains(value, StringComparison.Ordinal)) + string value = _chatChannelSearchText.ToUpperInvariant(); + for (int i = 0; i < _chatTypeNames.Length; i++) { - bool flag = i == num; - if (ImGui.Selectable(_chatTypeNames[i], flag)) + if (string.IsNullOrEmpty(_chatChannelSearchText) || _chatTypeNames[i].ToUpperInvariant().Contains(value, StringComparison.Ordinal)) { - base.Configuration.Notifications.ChatType = _xivChatTypes[i]; - Save(); - _chatChannelSearchText = string.Empty; - ImGui.CloseCurrentPopup(); - } - if (flag) - { - ImGui.SetItemDefaultFocus(); + bool flag = i == num; + if (ImGui.Selectable(_chatTypeNames[i], flag)) + { + base.Configuration.Notifications.ChatType = _xivChatTypes[i]; + Save(); + _chatChannelSearchText = string.Empty; + ImGui.CloseCurrentPopup(); + } + if (flag) + { + ImGui.SetItemDefaultFocus(); + } } } } } + finally + { + ((ChildDisposable)(ref val4)).Dispose(); + } + ImGui.EndCombo(); + } + else + { + _chatChannelComboJustOpened = false; } - ImGui.EndCombo(); } - else + finally { - _chatChannelComboJustOpened = false; + ((IDisposable)val3)?.Dispose(); } } + finally + { + ((IDisposable)val2)?.Dispose(); + } + } + finally + { + ((TabItemDisposable)(ref val)).Dispose(); } } } diff --git a/Questionable/Questionable.Windows.ConfigComponents/PluginConfigComponent.cs b/Questionable/Questionable.Windows.ConfigComponents/PluginConfigComponent.cs index a77aec5..ae9fd93 100644 --- a/Questionable/Questionable.Windows.ConfigComponents/PluginConfigComponent.cs +++ b/Questionable/Questionable.Windows.ConfigComponents/PluginConfigComponent.cs @@ -74,22 +74,32 @@ internal sealed class PluginConfigComponent : ConfigComponent public override void DrawTab() { - using ImRaii.IEndObject endObject = ImRaii.TabItem("Dependencies###Plugins"); - if (!(!endObject)) + //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) + TabItemDisposable val = ImRaii.TabItem((ImU8String)"Dependencies###Plugins"); + try { - Draw(out var allRequiredInstalled); - ImGui.Spacing(); - ImGui.Separator(); - ImGui.Spacing(); - if (allRequiredInstalled) + if (!(!val)) { - ImGui.TextColored(ImGuiColors.ParsedGreen, "All required plugins are installed."); - } - else - { - ImGui.TextColored(ImGuiColors.DalamudRed, "Required plugins are missing, Questionable will not work properly."); + Draw(out var allRequiredInstalled); + ImGui.Spacing(); + ImGui.Separator(); + ImGui.Spacing(); + if (allRequiredInstalled) + { + ImGui.TextColored(ImGuiColors.ParsedGreen, "All required plugins are installed."); + } + else + { + ImGui.TextColored(ImGuiColors.DalamudRed, "Required plugins are missing, Questionable will not work properly."); + } } } + finally + { + ((TabItemDisposable)(ref val)).Dispose(); + } } public void Draw(out bool allRequiredInstalled) @@ -101,20 +111,27 @@ internal sealed class PluginConfigComponent : ConfigComponent } ImGui.Text("Questionable requires the following plugins to work:"); allRequiredInstalled = true; - using (ImRaii.PushIndent()) + IndentDisposable val = ImRaii.PushIndent(1, true); + try { foreach (PluginInfo requiredPlugin in RequiredPlugins) { allRequiredInstalled &= DrawPlugin(requiredPlugin, checklistPadding); } } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.Spacing(); ImGui.Separator(); ImGui.Spacing(); ImGui.Text("Questionable supports multiple rotation/combat plugins, please pick the one\nyou want to use:"); - using (ImRaii.PushIndent()) + val = ImRaii.PushIndent(1, true); + try { - using (ImRaii.Disabled(_combatController.IsRunning)) + DisabledDisposable val2 = ImRaii.Disabled(_combatController.IsRunning); + try { if (ImGui.RadioButton("No rotation/combat plugin (combat must be done manually)", _configuration.General.CombatModule == Questionable.Configuration.ECombatModule.None)) { @@ -125,23 +142,37 @@ internal sealed class PluginConfigComponent : ConfigComponent allRequiredInstalled &= DrawCombatPlugin(Questionable.Configuration.ECombatModule.RotationSolverReborn, checklistPadding); allRequiredInstalled &= DrawCombatPlugin(Questionable.Configuration.ECombatModule.WrathCombo, checklistPadding); } + finally + { + ((IDisposable)val2)?.Dispose(); + } + } + finally + { + ((IDisposable)val)?.Dispose(); } ImGui.Spacing(); ImGui.Separator(); ImGui.Spacing(); ImGui.Text("The following plugins are recommended, but not required:"); - using (ImRaii.PushIndent()) + val = ImRaii.PushIndent(1, true); + try { foreach (PluginInfo recommendedPlugin in _recommendedPlugins) { DrawPlugin(recommendedPlugin, checklistPadding); } } + finally + { + ((IDisposable)val)?.Dispose(); + } } private bool DrawPlugin(PluginInfo plugin, float checklistPadding) { - using (ImRaii.PushId("plugin_" + plugin.DisplayName)) + IdDisposable val = ImRaii.PushId((ImU8String)("plugin_" + plugin.DisplayName), true); + try { IExposedPlugin exposedPlugin = FindInstalledPlugin(plugin); bool flag = exposedPlugin != null; @@ -154,13 +185,18 @@ internal sealed class PluginConfigComponent : ConfigComponent DrawPluginDetails(plugin, checklistPadding, flag); return flag; } + finally + { + ((IDisposable)val)?.Dispose(); + } } private bool DrawCombatPlugin(Configuration.ECombatModule combatModule, float checklistPadding) { ImGui.Spacing(); PluginInfo pluginInfo = CombatPlugins[combatModule]; - using (ImRaii.PushId("plugin_" + pluginInfo.DisplayName)) + IdDisposable val = ImRaii.PushId((ImU8String)("plugin_" + pluginInfo.DisplayName), true); + try { IExposedPlugin exposedPlugin = FindInstalledPlugin(pluginInfo); bool flag = exposedPlugin != null; @@ -185,11 +221,16 @@ internal sealed class PluginConfigComponent : ConfigComponent DrawPluginDetails(pluginInfo, checklistPadding, flag); return flag || _configuration.General.CombatModule != combatModule; } + finally + { + ((IDisposable)val)?.Dispose(); + } } private void DrawPluginDetails(PluginInfo plugin, float checklistPadding, bool isInstalled) { - using (ImRaii.PushIndent(checklistPadding)) + IndentDisposable val = ImRaii.PushIndent(checklistPadding, true, true); + try { if (!string.IsNullOrEmpty(plugin.Details)) { @@ -205,10 +246,15 @@ internal sealed class PluginConfigComponent : ConfigComponent _uiUtils.ChecklistItem(item.DisplayName, isInstalled && flag2); if (!string.IsNullOrEmpty(item.Details)) { - using (ImRaii.PushIndent(checklistPadding)) + IndentDisposable val2 = ImRaii.PushIndent(checklistPadding, true, true); + try { ImGui.TextUnformatted(item.Details); } + finally + { + ((IDisposable)val2)?.Dispose(); + } } } } @@ -239,6 +285,10 @@ internal sealed class PluginConfigComponent : ConfigComponent ImGuiComponents.HelpMarker("Available on official Dalamud Repository"); } } + finally + { + ((IDisposable)val)?.Dispose(); + } } private IExposedPlugin? FindInstalledPlugin(PluginInfo pluginInfo) diff --git a/Questionable/Questionable.Windows.ConfigComponents/SinglePlayerDutyConfigComponent.cs b/Questionable/Questionable.Windows.ConfigComponents/SinglePlayerDutyConfigComponent.cs index ff24160..65ae65a 100644 --- a/Questionable/Questionable.Windows.ConfigComponents/SinglePlayerDutyConfigComponent.cs +++ b/Questionable/Questionable.Windows.ConfigComponents/SinglePlayerDutyConfigComponent.cs @@ -289,431 +289,576 @@ internal sealed class SinglePlayerDutyConfigComponent : ConfigComponent public override void DrawTab() { - using ImRaii.IEndObject endObject = ImRaii.TabItem("Quest Battles###QuestBattles"); - if (!endObject) + //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) + //IL_0135: Unknown result type (might be due to invalid IL or missing references) + //IL_013a: Unknown result type (might be due to invalid IL or missing references) + //IL_013c: Unknown result type (might be due to invalid IL or missing references) + TabItemDisposable val = ImRaii.TabItem((ImU8String)"Quest Battles###QuestBattles"); + try { - return; - } - bool v = base.Configuration.SinglePlayerDuties.RunSoloInstancesWithBossMod; - if (ImGui.Checkbox("Run quest battles with BossMod", ref v)) - { - base.Configuration.SinglePlayerDuties.RunSoloInstancesWithBossMod = v; - Save(); - } - using (ImRaii.PushIndent(ImGui.GetFrameHeight() + ImGui.GetStyle().ItemInnerSpacing.X)) - { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed)) + if (!val) { - ImGui.TextUnformatted("Work in Progress:"); - ImGui.BulletText("Will always use BossMod for combat (ignoring the configured combat module)."); - ImGui.BulletText("Only a small subset of quest battles have been tested - most of which are in the MSQ."); - ImGui.BulletText("When retrying a failed battle, it will always start at 'Normal' difficulty."); - ImGui.BulletText("Please don't enable this option when using a BossMod fork (such as Reborn);\nwith the missing combat module configuration, it is unlikely to be compatible."); + return; + } + bool v = base.Configuration.SinglePlayerDuties.RunSoloInstancesWithBossMod; + if (ImGui.Checkbox("Run quest battles with BossMod", ref v)) + { + base.Configuration.SinglePlayerDuties.RunSoloInstancesWithBossMod = v; + Save(); + } + IndentDisposable val2 = ImRaii.PushIndent(ImGui.GetFrameHeight() + ImGui.GetStyle().ItemInnerSpacing.X, true, true); + try + { + ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true); + try + { + ImGui.TextUnformatted("Work in Progress:"); + ImGui.BulletText("Will always use BossMod for combat (ignoring the configured combat module)."); + ImGui.BulletText("Only a small subset of quest battles have been tested - most of which are in the MSQ."); + ImGui.BulletText("When retrying a failed battle, it will always start at 'Normal' difficulty."); + ImGui.BulletText("Please don't enable this option when using a BossMod fork (such as Reborn);\nwith the missing combat module configuration, it is unlikely to be compatible."); + } + finally + { + ((IDisposable)val3)?.Dispose(); + } + } + finally + { + ((IDisposable)val2)?.Dispose(); } - } - ImGui.Separator(); - using (ImRaii.Disabled(!v)) - { - ImGui.Text("Questionable includes a default list of quest battles that work if BossMod is installed."); - ImGui.Text("The included list of quest battles can change with each update."); ImGui.Separator(); - ImGui.Text("You can override the settings for each individual quest battle:"); - using ImRaii.IEndObject endObject2 = ImRaii.TabBar("QuestionableConfigTabs"); - if (endObject2) + DisabledDisposable val4 = ImRaii.Disabled(!v); + try { - DrawMainScenarioConfigTable(); - DrawJobQuestConfigTable(); - DrawRoleQuestConfigTable(); - DrawOtherQuestConfigTable(); + ImGui.Text("Questionable includes a default list of quest battles that work if BossMod is installed."); + ImGui.Text("The included list of quest battles can change with each update."); + ImGui.Separator(); + ImGui.Text("You can override the settings for each individual quest battle:"); + TabBarDisposable val5 = ImRaii.TabBar((ImU8String)"QuestionableConfigTabs"); + try + { + if (TabBarDisposable.op_Implicit(val5)) + { + DrawMainScenarioConfigTable(); + DrawJobQuestConfigTable(); + DrawRoleQuestConfigTable(); + DrawOtherQuestConfigTable(); + } + DrawEnableAllButton(); + ImGui.SameLine(); + DrawClipboardButtons(); + ImGui.SameLine(); + DrawResetButton(); + } + finally + { + ((TabBarDisposable)(ref val5)).Dispose(); + } } - DrawEnableAllButton(); - ImGui.SameLine(); - DrawClipboardButtons(); - ImGui.SameLine(); - DrawResetButton(); + finally + { + ((IDisposable)val4)?.Dispose(); + } + } + finally + { + ((TabItemDisposable)(ref val)).Dispose(); } } private void DrawMainScenarioConfigTable() { + //IL_0053: Unknown result type (might be due to invalid IL or missing references) + //IL_0058: Unknown result type (might be due to invalid IL or missing references) + //IL_0059: Unknown result type (might be due to invalid IL or missing references) + //IL_0066: Unknown result type (might be due to invalid IL or missing references) + //IL_006b: Unknown result type (might be due to invalid IL or missing references) + //IL_006c: Unknown result type (might be due to invalid IL or missing references) (int enabledCount, int totalCount) mainScenarioQuestCounts = GetMainScenarioQuestCounts(); int item = mainScenarioQuestCounts.enabledCount; int item2 = mainScenarioQuestCounts.totalCount; - ImU8String label = new ImU8String(30, 2); - label.AppendLiteral("Main Scenario Quests ("); - label.AppendFormatted(item); - label.AppendLiteral("/"); - label.AppendFormatted(item2); - label.AppendLiteral(")###MSQ"); - using ImRaii.IEndObject endObject = ImRaii.TabItem(label); - if (!endObject) + ImU8String imU8String = new ImU8String(30, 2); + imU8String.AppendLiteral("Main Scenario Quests ("); + imU8String.AppendFormatted(item); + imU8String.AppendLiteral("/"); + imU8String.AppendFormatted(item2); + imU8String.AppendLiteral(")###MSQ"); + TabItemDisposable val = ImRaii.TabItem(imU8String); + try { - return; - } - using ImRaii.IEndObject endObject2 = BeginChildArea(); - if (!endObject2) - { - return; - } - (int enabledCount, int totalCount) questBattleCounts = GetQuestBattleCounts(_startingCityBattles[EAetheryteLocation.Limsa]); - int item3 = questBattleCounts.enabledCount; - int item4 = questBattleCounts.totalCount; - string obj = $"Limsa Lominsa ({ConfigComponent.FormatLevel(5)} - {ConfigComponent.FormatLevel(14)}) ({item3}/{item4})"; - string key = "Limsa"; - ImGui.SetNextItemOpen(base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false), ImGuiCond.Always); - if (ImGui.CollapsingHeader(obj)) - { - if (!base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false)) + if (!val) { - base.Configuration.SinglePlayerDuties.HeaderStates[key] = true; - Save(); + return; } - DrawQuestTable("LimsaLominsa", _startingCityBattles[EAetheryteLocation.Limsa]); - } - else if (base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false)) - { - base.Configuration.SinglePlayerDuties.HeaderStates[key] = false; - Save(); - } - (int enabledCount, int totalCount) questBattleCounts2 = GetQuestBattleCounts(_startingCityBattles[EAetheryteLocation.Gridania]); - int item5 = questBattleCounts2.enabledCount; - int item6 = questBattleCounts2.totalCount; - string obj2 = $"Gridania ({ConfigComponent.FormatLevel(5)} - {ConfigComponent.FormatLevel(14)}) ({item5}/{item6})"; - string key2 = "Gridania"; - ImGui.SetNextItemOpen(base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key2, defaultValue: false), ImGuiCond.Always); - if (ImGui.CollapsingHeader(obj2)) - { - if (!base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key2, defaultValue: false)) + ChildDisposable val2 = BeginChildArea(); + try { - base.Configuration.SinglePlayerDuties.HeaderStates[key2] = true; - Save(); - } - DrawQuestTable("Gridania", _startingCityBattles[EAetheryteLocation.Gridania]); - } - else if (base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key2, defaultValue: false)) - { - base.Configuration.SinglePlayerDuties.HeaderStates[key2] = false; - Save(); - } - (int enabledCount, int totalCount) questBattleCounts3 = GetQuestBattleCounts(_startingCityBattles[EAetheryteLocation.Uldah]); - int item7 = questBattleCounts3.enabledCount; - int item8 = questBattleCounts3.totalCount; - string obj3 = $"Ul'dah ({ConfigComponent.FormatLevel(4)} - {ConfigComponent.FormatLevel(14)}) ({item7}/{item8})"; - string key3 = "Uldah"; - ImGui.SetNextItemOpen(base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key3, defaultValue: false), ImGuiCond.Always); - if (ImGui.CollapsingHeader(obj3)) - { - if (!base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key3, defaultValue: false)) - { - base.Configuration.SinglePlayerDuties.HeaderStates[key3] = true; - Save(); - } - DrawQuestTable("Uldah", _startingCityBattles[EAetheryteLocation.Uldah]); - } - else if (base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key3, defaultValue: false)) - { - base.Configuration.SinglePlayerDuties.HeaderStates[key3] = false; - Save(); - } - EExpansionVersion[] values = Enum.GetValues(); - for (int i = 0; i < values.Length; i++) - { - EExpansionVersion eExpansionVersion = values[i]; - if (!_mainScenarioBattles.TryGetValue(eExpansionVersion, out List value)) - { - continue; - } - (int enabledCount, int totalCount) questBattleCounts4 = GetQuestBattleCounts(value); - int item9 = questBattleCounts4.enabledCount; - int item10 = questBattleCounts4.totalCount; - string obj4 = $"{eExpansionVersion.ToFriendlyString()} ({item9}/{item10})"; - string key4 = eExpansionVersion.ToString(); - ImGui.SetNextItemOpen(base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key4, defaultValue: false), ImGuiCond.Always); - if (ImGui.CollapsingHeader(obj4)) - { - if (!base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key4, defaultValue: false)) + if (!val2) { - base.Configuration.SinglePlayerDuties.HeaderStates[key4] = true; + return; + } + (int enabledCount, int totalCount) questBattleCounts = GetQuestBattleCounts(_startingCityBattles[EAetheryteLocation.Limsa]); + int item3 = questBattleCounts.enabledCount; + int item4 = questBattleCounts.totalCount; + string obj = $"Limsa Lominsa ({ConfigComponent.FormatLevel(5)} - {ConfigComponent.FormatLevel(14)}) ({item3}/{item4})"; + string key = "Limsa"; + ImGui.SetNextItemOpen(base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false), ImGuiCond.Always); + if (ImGui.CollapsingHeader(obj)) + { + if (!base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false)) + { + base.Configuration.SinglePlayerDuties.HeaderStates[key] = true; + Save(); + } + DrawQuestTable("LimsaLominsa", _startingCityBattles[EAetheryteLocation.Limsa]); + } + else if (base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false)) + { + base.Configuration.SinglePlayerDuties.HeaderStates[key] = false; Save(); } - DrawQuestTable($"Duties{eExpansionVersion}", value); + (int enabledCount, int totalCount) questBattleCounts2 = GetQuestBattleCounts(_startingCityBattles[EAetheryteLocation.Gridania]); + int item5 = questBattleCounts2.enabledCount; + int item6 = questBattleCounts2.totalCount; + string obj2 = $"Gridania ({ConfigComponent.FormatLevel(5)} - {ConfigComponent.FormatLevel(14)}) ({item5}/{item6})"; + string key2 = "Gridania"; + ImGui.SetNextItemOpen(base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key2, defaultValue: false), ImGuiCond.Always); + if (ImGui.CollapsingHeader(obj2)) + { + if (!base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key2, defaultValue: false)) + { + base.Configuration.SinglePlayerDuties.HeaderStates[key2] = true; + Save(); + } + DrawQuestTable("Gridania", _startingCityBattles[EAetheryteLocation.Gridania]); + } + else if (base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key2, defaultValue: false)) + { + base.Configuration.SinglePlayerDuties.HeaderStates[key2] = false; + Save(); + } + (int enabledCount, int totalCount) questBattleCounts3 = GetQuestBattleCounts(_startingCityBattles[EAetheryteLocation.Uldah]); + int item7 = questBattleCounts3.enabledCount; + int item8 = questBattleCounts3.totalCount; + string obj3 = $"Ul'dah ({ConfigComponent.FormatLevel(4)} - {ConfigComponent.FormatLevel(14)}) ({item7}/{item8})"; + string key3 = "Uldah"; + ImGui.SetNextItemOpen(base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key3, defaultValue: false), ImGuiCond.Always); + if (ImGui.CollapsingHeader(obj3)) + { + if (!base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key3, defaultValue: false)) + { + base.Configuration.SinglePlayerDuties.HeaderStates[key3] = true; + Save(); + } + DrawQuestTable("Uldah", _startingCityBattles[EAetheryteLocation.Uldah]); + } + else if (base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key3, defaultValue: false)) + { + base.Configuration.SinglePlayerDuties.HeaderStates[key3] = false; + Save(); + } + EExpansionVersion[] values = Enum.GetValues(); + for (int i = 0; i < values.Length; i++) + { + EExpansionVersion eExpansionVersion = values[i]; + if (!_mainScenarioBattles.TryGetValue(eExpansionVersion, out List value)) + { + continue; + } + (int enabledCount, int totalCount) questBattleCounts4 = GetQuestBattleCounts(value); + int item9 = questBattleCounts4.enabledCount; + int item10 = questBattleCounts4.totalCount; + string obj4 = $"{eExpansionVersion.ToFriendlyString()} ({item9}/{item10})"; + string key4 = eExpansionVersion.ToString(); + ImGui.SetNextItemOpen(base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key4, defaultValue: false), ImGuiCond.Always); + if (ImGui.CollapsingHeader(obj4)) + { + if (!base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key4, defaultValue: false)) + { + base.Configuration.SinglePlayerDuties.HeaderStates[key4] = true; + Save(); + } + DrawQuestTable($"Duties{eExpansionVersion}", value); + } + else if (base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key4, defaultValue: false)) + { + base.Configuration.SinglePlayerDuties.HeaderStates[key4] = false; + Save(); + } + } } - else if (base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key4, defaultValue: false)) + finally { - base.Configuration.SinglePlayerDuties.HeaderStates[key4] = false; - Save(); + ((ChildDisposable)(ref val2)).Dispose(); } } + finally + { + ((TabItemDisposable)(ref val)).Dispose(); + } } private void DrawJobQuestConfigTable() { + //IL_0053: Unknown result type (might be due to invalid IL or missing references) + //IL_0058: Unknown result type (might be due to invalid IL or missing references) + //IL_0059: Unknown result type (might be due to invalid IL or missing references) + //IL_0066: Unknown result type (might be due to invalid IL or missing references) + //IL_006b: Unknown result type (might be due to invalid IL or missing references) + //IL_006c: Unknown result type (might be due to invalid IL or missing references) (int enabledCount, int totalCount) jobQuestCounts = GetJobQuestCounts(); int item = jobQuestCounts.enabledCount; int item2 = jobQuestCounts.totalCount; - ImU8String label = new ImU8String(32, 2); - label.AppendLiteral("Class/Job Quests ("); - label.AppendFormatted(item); - label.AppendLiteral("/"); - label.AppendFormatted(item2); - label.AppendLiteral(")###JobQuests"); - using ImRaii.IEndObject endObject = ImRaii.TabItem(label); - if (!endObject) + ImU8String imU8String = new ImU8String(32, 2); + imU8String.AppendLiteral("Class/Job Quests ("); + imU8String.AppendFormatted(item); + imU8String.AppendLiteral("/"); + imU8String.AppendFormatted(item2); + imU8String.AppendLiteral(")###JobQuests"); + TabItemDisposable val = ImRaii.TabItem(imU8String); + try { - return; - } - using ImRaii.IEndObject endObject2 = BeginChildArea(); - if (!endObject2) - { - return; - } - int num = 0; - foreach (var (eClassJob, num2) in _classJobUtils.SortedClassJobs) - { - if (eClassJob.IsCrafter() || eClassJob.IsGatherer() || !_jobQuestBattles.TryGetValue(eClassJob, out List value)) + if (!val) { - continue; + return; } - if (num2 != num) + ChildDisposable val2 = BeginChildArea(); + try { - num = num2; - ImGui.Spacing(); - ImGui.Separator(); - ImGui.Spacing(); - } - string text = eClassJob.ToFriendlyString(); - if (eClassJob.IsClass()) - { - text = text + " / " + eClassJob.AsJob().ToFriendlyString(); - } - (int enabledCount, int totalCount) questBattleCounts = GetQuestBattleCounts(value); - int item3 = questBattleCounts.enabledCount; - int item4 = questBattleCounts.totalCount; - string obj = $"{text} ({item3}/{item4})"; - string key = eClassJob.ToString(); - ImGui.SetNextItemOpen(base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false), ImGuiCond.Always); - if (ImGui.CollapsingHeader(obj)) - { - if (!base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false)) + if (!val2) { - base.Configuration.SinglePlayerDuties.HeaderStates[key] = true; - Save(); + return; + } + int num = 0; + foreach (var (eClassJob, num2) in _classJobUtils.SortedClassJobs) + { + if (eClassJob.IsCrafter() || eClassJob.IsGatherer() || !_jobQuestBattles.TryGetValue(eClassJob, out List value)) + { + continue; + } + if (num2 != num) + { + num = num2; + ImGui.Spacing(); + ImGui.Separator(); + ImGui.Spacing(); + } + string text = eClassJob.ToFriendlyString(); + if (eClassJob.IsClass()) + { + text = text + " / " + eClassJob.AsJob().ToFriendlyString(); + } + (int enabledCount, int totalCount) questBattleCounts = GetQuestBattleCounts(value); + int item3 = questBattleCounts.enabledCount; + int item4 = questBattleCounts.totalCount; + string obj = $"{text} ({item3}/{item4})"; + string key = eClassJob.ToString(); + ImGui.SetNextItemOpen(base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false), ImGuiCond.Always); + if (ImGui.CollapsingHeader(obj)) + { + if (!base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false)) + { + base.Configuration.SinglePlayerDuties.HeaderStates[key] = true; + Save(); + } + DrawQuestTable($"JobQuests{eClassJob}", value); + } + else if (base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false)) + { + base.Configuration.SinglePlayerDuties.HeaderStates[key] = false; + Save(); + } } - DrawQuestTable($"JobQuests{eClassJob}", value); } - else if (base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false)) + finally { - base.Configuration.SinglePlayerDuties.HeaderStates[key] = false; - Save(); + ((ChildDisposable)(ref val2)).Dispose(); } } + finally + { + ((TabItemDisposable)(ref val)).Dispose(); + } } private void DrawRoleQuestConfigTable() { + //IL_0053: Unknown result type (might be due to invalid IL or missing references) + //IL_0058: Unknown result type (might be due to invalid IL or missing references) + //IL_0059: Unknown result type (might be due to invalid IL or missing references) + //IL_0066: Unknown result type (might be due to invalid IL or missing references) + //IL_006b: Unknown result type (might be due to invalid IL or missing references) + //IL_006c: Unknown result type (might be due to invalid IL or missing references) (int enabledCount, int totalCount) roleQuestCounts = GetRoleQuestCounts(); int item = roleQuestCounts.enabledCount; int item2 = roleQuestCounts.totalCount; - ImU8String label = new ImU8String(28, 2); - label.AppendLiteral("Role Quests ("); - label.AppendFormatted(item); - label.AppendLiteral("/"); - label.AppendFormatted(item2); - label.AppendLiteral(")###RoleQuests"); - using ImRaii.IEndObject endObject = ImRaii.TabItem(label); - if (!endObject) + ImU8String imU8String = new ImU8String(28, 2); + imU8String.AppendLiteral("Role Quests ("); + imU8String.AppendFormatted(item); + imU8String.AppendLiteral("/"); + imU8String.AppendFormatted(item2); + imU8String.AppendLiteral(")###RoleQuests"); + TabItemDisposable val = ImRaii.TabItem(imU8String); + try { - return; - } - using ImRaii.IEndObject endObject2 = BeginChildArea(); - if (!endObject2) - { - return; - } - foreach (var (eClassJob, value) in RoleQuestCategories) - { - if (!_roleQuestBattles.TryGetValue(eClassJob, out List value2)) + if (!val) { - continue; + return; } - (int enabledCount, int totalCount) questBattleCounts = GetQuestBattleCounts(value2); - int item3 = questBattleCounts.enabledCount; - int item4 = questBattleCounts.totalCount; - string obj = $"{value} ({item3}/{item4})"; - string key = $"Role_{eClassJob}"; - ImGui.SetNextItemOpen(base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false), ImGuiCond.Always); - if (ImGui.CollapsingHeader(obj)) + ChildDisposable val2 = BeginChildArea(); + try { - if (!base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false)) + if (!val2) { - base.Configuration.SinglePlayerDuties.HeaderStates[key] = true; + return; + } + foreach (var (eClassJob, value) in RoleQuestCategories) + { + if (!_roleQuestBattles.TryGetValue(eClassJob, out List value2)) + { + continue; + } + (int enabledCount, int totalCount) questBattleCounts = GetQuestBattleCounts(value2); + int item3 = questBattleCounts.enabledCount; + int item4 = questBattleCounts.totalCount; + string obj = $"{value} ({item3}/{item4})"; + string key = $"Role_{eClassJob}"; + ImGui.SetNextItemOpen(base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false), ImGuiCond.Always); + if (ImGui.CollapsingHeader(obj)) + { + if (!base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false)) + { + base.Configuration.SinglePlayerDuties.HeaderStates[key] = true; + Save(); + } + DrawQuestTable($"RoleQuests{eClassJob}", value2); + } + else if (base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false)) + { + base.Configuration.SinglePlayerDuties.HeaderStates[key] = false; + Save(); + } + } + (int enabledCount, int totalCount) questBattleCounts2 = GetQuestBattleCounts(_otherRoleQuestBattles); + int item5 = questBattleCounts2.enabledCount; + int item6 = questBattleCounts2.totalCount; + string obj2 = $"General Role Quests ({item5}/{item6})"; + string key2 = "Role_General"; + ImGui.SetNextItemOpen(base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key2, defaultValue: false), ImGuiCond.Always); + if (ImGui.CollapsingHeader(obj2)) + { + if (!base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key2, defaultValue: false)) + { + base.Configuration.SinglePlayerDuties.HeaderStates[key2] = true; + Save(); + } + DrawQuestTable("RoleQuestsGeneral", _otherRoleQuestBattles); + } + else if (base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key2, defaultValue: false)) + { + base.Configuration.SinglePlayerDuties.HeaderStates[key2] = false; Save(); } - DrawQuestTable($"RoleQuests{eClassJob}", value2); } - else if (base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false)) + finally { - base.Configuration.SinglePlayerDuties.HeaderStates[key] = false; - Save(); + ((ChildDisposable)(ref val2)).Dispose(); } } - (int enabledCount, int totalCount) questBattleCounts2 = GetQuestBattleCounts(_otherRoleQuestBattles); - int item5 = questBattleCounts2.enabledCount; - int item6 = questBattleCounts2.totalCount; - string obj2 = $"General Role Quests ({item5}/{item6})"; - string key2 = "Role_General"; - ImGui.SetNextItemOpen(base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key2, defaultValue: false), ImGuiCond.Always); - if (ImGui.CollapsingHeader(obj2)) + finally { - if (!base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key2, defaultValue: false)) - { - base.Configuration.SinglePlayerDuties.HeaderStates[key2] = true; - Save(); - } - DrawQuestTable("RoleQuestsGeneral", _otherRoleQuestBattles); - } - else if (base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key2, defaultValue: false)) - { - base.Configuration.SinglePlayerDuties.HeaderStates[key2] = false; - Save(); + ((TabItemDisposable)(ref val)).Dispose(); } } private void DrawOtherQuestConfigTable() { + //IL_0053: Unknown result type (might be due to invalid IL or missing references) + //IL_0058: Unknown result type (might be due to invalid IL or missing references) + //IL_0059: Unknown result type (might be due to invalid IL or missing references) + //IL_0066: Unknown result type (might be due to invalid IL or missing references) + //IL_006b: Unknown result type (might be due to invalid IL or missing references) + //IL_006c: Unknown result type (might be due to invalid IL or missing references) (int enabledCount, int totalCount) otherQuestCounts = GetOtherQuestCounts(); int item = otherQuestCounts.enabledCount; int item2 = otherQuestCounts.totalCount; - ImU8String label = new ImU8String(29, 2); - label.AppendLiteral("Other Quests ("); - label.AppendFormatted(item); - label.AppendLiteral("/"); - label.AppendFormatted(item2); - label.AppendLiteral(")###MiscQuests"); - using ImRaii.IEndObject endObject = ImRaii.TabItem(label); - if (!endObject) + ImU8String imU8String = new ImU8String(29, 2); + imU8String.AppendLiteral("Other Quests ("); + imU8String.AppendFormatted(item); + imU8String.AppendLiteral("/"); + imU8String.AppendFormatted(item2); + imU8String.AppendLiteral(")###MiscQuests"); + TabItemDisposable val = ImRaii.TabItem(imU8String); + try { - return; - } - using ImRaii.IEndObject endObject2 = BeginChildArea(); - if (!endObject2) - { - return; - } - foreach (var otherQuestBattle in _otherQuestBattles) - { - string item3 = otherQuestBattle.Label; - List item4 = otherQuestBattle.Item2; - (int enabledCount, int totalCount) questBattleCounts = GetQuestBattleCounts(item4); - int item5 = questBattleCounts.enabledCount; - int item6 = questBattleCounts.totalCount; - string obj = $"{item3} ({item5}/{item6})"; - string key = "Other_" + item3; - ImGui.SetNextItemOpen(base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false), ImGuiCond.Always); - if (ImGui.CollapsingHeader(obj)) + if (!val) { - if (!base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false)) + return; + } + ChildDisposable val2 = BeginChildArea(); + try + { + if (!val2) { - base.Configuration.SinglePlayerDuties.HeaderStates[key] = true; - Save(); + return; + } + foreach (var otherQuestBattle in _otherQuestBattles) + { + string item3 = otherQuestBattle.Label; + List item4 = otherQuestBattle.Item2; + (int enabledCount, int totalCount) questBattleCounts = GetQuestBattleCounts(item4); + int item5 = questBattleCounts.enabledCount; + int item6 = questBattleCounts.totalCount; + string obj = $"{item3} ({item5}/{item6})"; + string key = "Other_" + item3; + ImGui.SetNextItemOpen(base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false), ImGuiCond.Always); + if (ImGui.CollapsingHeader(obj)) + { + if (!base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false)) + { + base.Configuration.SinglePlayerDuties.HeaderStates[key] = true; + Save(); + } + DrawQuestTable("Other" + item3, item4); + } + else if (base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false)) + { + base.Configuration.SinglePlayerDuties.HeaderStates[key] = false; + Save(); + } } - DrawQuestTable("Other" + item3, item4); } - else if (base.Configuration.SinglePlayerDuties.HeaderStates.GetValueOrDefault(key, defaultValue: false)) + finally { - base.Configuration.SinglePlayerDuties.HeaderStates[key] = false; - Save(); + ((ChildDisposable)(ref val2)).Dispose(); } } + finally + { + ((TabItemDisposable)(ref val)).Dispose(); + } } private void DrawQuestTable(string label, IReadOnlyList dutyInfos) { - using ImRaii.IEndObject endObject = ImRaii.Table(label, 2, ImGuiTableFlags.SizingFixedFit); - if (!ImRaii.IEndObject.op_True(endObject)) + //IL_000c: Unknown result type (might be due to invalid IL or missing references) + //IL_0011: Unknown result type (might be due to invalid IL or missing references) + //IL_0012: 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_00fe: Unknown result type (might be due to invalid IL or missing references) + TableDisposable val = ImRaii.Table((ImU8String)label, 2, ImGuiTableFlags.SizingFixedFit); + try { - return; - } - ImGui.TableSetupColumn("Quest", ImGuiTableColumnFlags.WidthStretch); - ImGui.TableSetupColumn("Options", ImGuiTableColumnFlags.WidthFixed, 200f); - foreach (SinglePlayerDutyInfo dutyInfo in dutyInfos) - { - ImGui.TableNextRow(); - string[] array = (dutyInfo.EnabledByDefault ? SupportedCfcOptions : UnsupportedCfcOptions); - int currentItem = 0; - if (base.Configuration.SinglePlayerDuties.WhitelistedSinglePlayerDutyCfcIds.Contains(dutyInfo.ContentFinderConditionId)) + if (!TableDisposable.op_Implicit(val)) { - currentItem = 1; + return; } - if (base.Configuration.SinglePlayerDuties.BlacklistedSinglePlayerDutyCfcIds.Contains(dutyInfo.ContentFinderConditionId)) + ImGui.TableSetupColumn("Quest", ImGuiTableColumnFlags.WidthStretch); + ImGui.TableSetupColumn("Options", ImGuiTableColumnFlags.WidthFixed, 200f); + foreach (SinglePlayerDutyInfo dutyInfo in dutyInfos) { - currentItem = 2; - } - if (ImGui.TableNextColumn()) - { - ImGui.AlignTextToFramePadding(); - ImGui.TextUnformatted(dutyInfo.Name); - if (ImGui.IsItemHovered() && base.Configuration.Advanced.AdditionalStatusInformation) + ImGui.TableNextRow(); + string[] array = (dutyInfo.EnabledByDefault ? SupportedCfcOptions : UnsupportedCfcOptions); + int currentItem = 0; + if (base.Configuration.SinglePlayerDuties.WhitelistedSinglePlayerDutyCfcIds.Contains(dutyInfo.ContentFinderConditionId)) { - using ImRaii.IEndObject endObject2 = ImRaii.Tooltip(); - if (endObject2) + currentItem = 1; + } + if (base.Configuration.SinglePlayerDuties.BlacklistedSinglePlayerDutyCfcIds.Contains(dutyInfo.ContentFinderConditionId)) + { + currentItem = 2; + } + if (ImGui.TableNextColumn()) + { + ImGui.AlignTextToFramePadding(); + ImGui.TextUnformatted(dutyInfo.Name); + if (ImGui.IsItemHovered() && base.Configuration.Advanced.AdditionalStatusInformation) { - ImGui.TextUnformatted(dutyInfo.Name); - ImGui.Separator(); - ImU8String text = new ImU8String(13, 1); - text.AppendLiteral("TerritoryId: "); - text.AppendFormatted(dutyInfo.TerritoryId); - ImGui.BulletText(text); - ImU8String text2 = new ImU8String(26, 1); - text2.AppendLiteral("ContentFinderConditionId: "); - text2.AppendFormatted(dutyInfo.ContentFinderConditionId); - ImGui.BulletText(text2); - } - } - if (!dutyInfo.Enabled) - { - ImGuiComponents.HelpMarker("Questionable doesn't include support for this quest.", FontAwesomeIcon.Times, ImGuiColors.DalamudRed); - } - else if (dutyInfo.Notes.Count > 0) - { - ConfigComponent.DrawNotes(dutyInfo.EnabledByDefault, dutyInfo.Notes); - } - } - if (!ImGui.TableNextColumn()) - { - continue; - } - ImU8String id = new ImU8String(6, 1); - id.AppendLiteral("##Duty"); - id.AppendFormatted(dutyInfo.ContentFinderConditionId); - using (ImRaii.PushId(id)) - { - using (ImRaii.Disabled(!dutyInfo.Enabled)) - { - ImGui.SetNextItemWidth(200f); - if (ImGui.Combo((ImU8String)string.Empty, ref currentItem, (ReadOnlySpan)array, array.Length)) - { - base.Configuration.SinglePlayerDuties.WhitelistedSinglePlayerDutyCfcIds.Remove(dutyInfo.ContentFinderConditionId); - base.Configuration.SinglePlayerDuties.BlacklistedSinglePlayerDutyCfcIds.Remove(dutyInfo.ContentFinderConditionId); - switch (currentItem) + TooltipDisposable val2 = ImRaii.Tooltip(); + try { - case 1: - base.Configuration.SinglePlayerDuties.WhitelistedSinglePlayerDutyCfcIds.Add(dutyInfo.ContentFinderConditionId); - break; - case 2: - base.Configuration.SinglePlayerDuties.BlacklistedSinglePlayerDutyCfcIds.Add(dutyInfo.ContentFinderConditionId); - break; + if (((TooltipDisposable)(ref val2)).Alive) + { + ImGui.TextUnformatted(dutyInfo.Name); + ImGui.Separator(); + ImU8String text = new ImU8String(13, 1); + text.AppendLiteral("TerritoryId: "); + text.AppendFormatted(dutyInfo.TerritoryId); + ImGui.BulletText(text); + ImU8String text2 = new ImU8String(26, 1); + text2.AppendLiteral("ContentFinderConditionId: "); + text2.AppendFormatted(dutyInfo.ContentFinderConditionId); + ImGui.BulletText(text2); + } } - Save(); + finally + { + ((TooltipDisposable)(ref val2)).Dispose(); + } + } + if (!dutyInfo.Enabled) + { + ImGuiComponents.HelpMarker("Questionable doesn't include support for this quest.", FontAwesomeIcon.Times, (Vector4?)ImGuiColors.DalamudRed); + } + else if (dutyInfo.Notes.Count > 0) + { + ConfigComponent.DrawNotes(dutyInfo.EnabledByDefault, dutyInfo.Notes); } } + if (!ImGui.TableNextColumn()) + { + continue; + } + ImU8String imU8String = new ImU8String(6, 1); + imU8String.AppendLiteral("##Duty"); + imU8String.AppendFormatted(dutyInfo.ContentFinderConditionId); + IdDisposable val3 = ImRaii.PushId(imU8String, true); + try + { + DisabledDisposable val4 = ImRaii.Disabled(!dutyInfo.Enabled); + try + { + ImGui.SetNextItemWidth(200f); + if (ImGui.Combo((ImU8String)string.Empty, ref currentItem, (ReadOnlySpan)array, array.Length)) + { + base.Configuration.SinglePlayerDuties.WhitelistedSinglePlayerDutyCfcIds.Remove(dutyInfo.ContentFinderConditionId); + base.Configuration.SinglePlayerDuties.BlacklistedSinglePlayerDutyCfcIds.Remove(dutyInfo.ContentFinderConditionId); + switch (currentItem) + { + case 1: + base.Configuration.SinglePlayerDuties.WhitelistedSinglePlayerDutyCfcIds.Add(dutyInfo.ContentFinderConditionId); + break; + case 2: + base.Configuration.SinglePlayerDuties.BlacklistedSinglePlayerDutyCfcIds.Add(dutyInfo.ContentFinderConditionId); + break; + } + Save(); + } + } + finally + { + ((IDisposable)val4)?.Dispose(); + } + } + finally + { + ((IDisposable)val3)?.Dispose(); + } } } + finally + { + ((TableDisposable)(ref val)).Dispose(); + } } - private static ImRaii.IEndObject BeginChildArea() + private static ChildDisposable BeginChildArea() { - return ImRaii.Child("DutyConfiguration", new Vector2(725f, 400f), border: true); + //IL_001a: Unknown result type (might be due to invalid IL or missing references) + return ImRaii.Child((ImU8String)"DutyConfiguration", new Vector2(725f, 400f), true); } private void DrawEnableAllButton() @@ -736,7 +881,8 @@ internal sealed class SinglePlayerDutyConfigComponent : ConfigComponent private void DrawClipboardButtons() { - using (ImRaii.Disabled(base.Configuration.SinglePlayerDuties.WhitelistedSinglePlayerDutyCfcIds.Count + base.Configuration.SinglePlayerDuties.BlacklistedSinglePlayerDutyCfcIds.Count == 0)) + DisabledDisposable val = ImRaii.Disabled(base.Configuration.SinglePlayerDuties.WhitelistedSinglePlayerDutyCfcIds.Count + base.Configuration.SinglePlayerDuties.BlacklistedSinglePlayerDutyCfcIds.Count == 0); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Copy, "Export to clipboard")) { @@ -745,9 +891,14 @@ internal sealed class SinglePlayerDutyConfigComponent : ConfigComponent ImGui.SetClipboardText("qst:single:" + Convert.ToBase64String(Encoding.UTF8.GetBytes(string.Join(";", first.Concat(second))))); } } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.SameLine(); string text = ImGui.GetClipboardText().Trim(); - using (ImRaii.Disabled(string.IsNullOrEmpty(text) || !text.StartsWith("qst:single:", StringComparison.InvariantCulture))) + val = ImRaii.Disabled(string.IsNullOrEmpty(text) || !text.StartsWith("qst:single:", StringComparison.InvariantCulture)); + try { if (!ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Paste, "Import from Clipboard")) { @@ -771,11 +922,16 @@ internal sealed class SinglePlayerDutyConfigComponent : ConfigComponent } Save(); } + finally + { + ((IDisposable)val)?.Dispose(); + } } private void DrawResetButton() { - using (ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl))) + DisabledDisposable val = ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl)); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Undo, "Reset to default")) { @@ -784,6 +940,10 @@ internal sealed class SinglePlayerDutyConfigComponent : ConfigComponent Save(); } } + finally + { + ((IDisposable)val)?.Dispose(); + } if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { ImGui.SetTooltip("Hold CTRL to enable this button."); diff --git a/Questionable/Questionable.Windows.ConfigComponents/StopConditionComponent.cs b/Questionable/Questionable.Windows.ConfigComponents/StopConditionComponent.cs index cf173f4..1d618ef 100644 --- a/Questionable/Questionable.Windows.ConfigComponents/StopConditionComponent.cs +++ b/Questionable/Questionable.Windows.ConfigComponents/StopConditionComponent.cs @@ -67,112 +67,142 @@ internal sealed class StopConditionComponent : ConfigComponent public override void DrawTab() { - using ImRaii.IEndObject endObject = ImRaii.TabItem("Stop###StopConditionns"); - if (!endObject) + //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) + TabItemDisposable val = ImRaii.TabItem((ImU8String)"Stop###StopConditionns"); + try { - return; - } - bool v = base.Configuration.Stop.Enabled; - if (ImGui.Checkbox("Enable stop conditions", ref v)) - { - base.Configuration.Stop.Enabled = v; - Save(); - } - ImGui.SameLine(); - ImGuiComponents.HelpMarker("Pause: Stops automation when condition is met, but allows resuming past it.\nStop: True stop, blocks automation from starting/resuming if condition is already met."); - ImGui.Separator(); - using (ImRaii.Disabled(!v)) - { - ImGui.Text("Stop when character level reaches:"); - int currentItem = (int)base.Configuration.Stop.LevelStopMode; - ImGui.SetNextItemWidth(100f); - if (ImGui.Combo((ImU8String)"##LevelMode", ref currentItem, (ReadOnlySpan)StopModeNames, StopModeNames.Length)) + if (!val) { - base.Configuration.Stop.LevelStopMode = (Configuration.EStopConditionMode)currentItem; + return; + } + bool v = base.Configuration.Stop.Enabled; + if (ImGui.Checkbox("Enable stop conditions", ref v)) + { + base.Configuration.Stop.Enabled = v; Save(); } ImGui.SameLine(); - using (ImRaii.Disabled(base.Configuration.Stop.LevelStopMode == Questionable.Configuration.EStopConditionMode.Off)) + ImGuiComponents.HelpMarker("Pause: Stops automation when condition is met, but allows resuming past it.\nStop: True stop, blocks automation from starting/resuming if condition is already met."); + ImGui.Separator(); + DisabledDisposable val2 = ImRaii.Disabled(!v); + try { - int data = base.Configuration.Stop.TargetLevel; + ImGui.Text("Stop when character level reaches:"); + int currentItem = (int)base.Configuration.Stop.LevelStopMode; ImGui.SetNextItemWidth(100f); - if (ImGui.InputInt("Target level", ref data, 1, 5)) + if (ImGui.Combo((ImU8String)"##LevelMode", ref currentItem, (ReadOnlySpan)StopModeNames, StopModeNames.Length)) { - base.Configuration.Stop.TargetLevel = Math.Max(1, Math.Min(100, data)); + base.Configuration.Stop.LevelStopMode = (Configuration.EStopConditionMode)currentItem; Save(); } - int num = _objectTable.LocalPlayer?.Level ?? 0; - if (num > 0) + ImGui.SameLine(); + DisabledDisposable val3 = ImRaii.Disabled(base.Configuration.Stop.LevelStopMode == Questionable.Configuration.EStopConditionMode.Off); + try { - ImGui.SameLine(); - ImU8String text = new ImU8String(11, 1); - text.AppendLiteral("(Current: "); - text.AppendFormatted(num); - text.AppendLiteral(")"); - ImGui.TextDisabled(text); - } - } - ImGui.Separator(); - ImGui.Text("Stop on quest sequence (global):"); - int currentItem2 = (int)base.Configuration.Stop.SequenceStopMode; - ImGui.SetNextItemWidth(100f); - if (ImGui.Combo((ImU8String)"##SequenceMode", ref currentItem2, (ReadOnlySpan)StopModeNames, StopModeNames.Length)) - { - base.Configuration.Stop.SequenceStopMode = (Configuration.EStopConditionMode)currentItem2; - Save(); - } - ImGui.SameLine(); - using (ImRaii.Disabled(base.Configuration.Stop.SequenceStopMode == Questionable.Configuration.EStopConditionMode.Off)) - { - int data2 = base.Configuration.Stop.TargetSequence; - ImGui.SetNextItemWidth(100f); - if (ImGui.InputInt("Target sequence", ref data2, 1, 1)) - { - base.Configuration.Stop.TargetSequence = Math.Max(0, Math.Min(255, data2)); - Save(); - } - QuestController.QuestProgress currentQuest = _questController.CurrentQuest; - if (currentQuest != null) - { - int sequence = currentQuest.Sequence; - ImGui.SameLine(); - ImU8String text2 = new ImU8String(11, 1); - text2.AppendLiteral("(Current: "); - text2.AppendFormatted(sequence); - text2.AppendLiteral(")"); - ImGui.TextDisabled(text2); - } - } - ImGui.TextWrapped("Note: Individual quest sequences below override this global setting."); - ImGui.Separator(); - ImGui.Text("Stop when completing quests (or reaching specific sequences):"); - DrawCurrentlyAcceptedQuests(); - _questSelector.DrawSelection(); - List questsToStopAfter = base.Configuration.Stop.QuestsToStopAfter; - if (questsToStopAfter.Count > 0) - { - using (ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl))) - { - if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All")) + int data = base.Configuration.Stop.TargetLevel; + ImGui.SetNextItemWidth(100f); + if (ImGui.InputInt("Target level", ref data, 1, 5)) { - foreach (ElementId item in questsToStopAfter) - { - string key = item.ToString(); - base.Configuration.Stop.QuestSequences.Remove(key); - base.Configuration.Stop.QuestStopModes.Remove(key); - } - base.Configuration.Stop.QuestsToStopAfter.Clear(); + base.Configuration.Stop.TargetLevel = Math.Max(1, Math.Min(100, data)); Save(); } + int num = _objectTable.LocalPlayer?.Level ?? 0; + if (num > 0) + { + ImGui.SameLine(); + ImU8String text = new ImU8String(11, 1); + text.AppendLiteral("(Current: "); + text.AppendFormatted(num); + text.AppendLiteral(")"); + ImGui.TextDisabled(text); + } } - if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) + finally { - ImGui.SetTooltip("Hold CTRL to enable this button."); + ((IDisposable)val3)?.Dispose(); } ImGui.Separator(); - ImGui.Text("(Drag arrow buttons to reorder)"); + ImGui.Text("Stop on quest sequence (global):"); + int currentItem2 = (int)base.Configuration.Stop.SequenceStopMode; + ImGui.SetNextItemWidth(100f); + if (ImGui.Combo((ImU8String)"##SequenceMode", ref currentItem2, (ReadOnlySpan)StopModeNames, StopModeNames.Length)) + { + base.Configuration.Stop.SequenceStopMode = (Configuration.EStopConditionMode)currentItem2; + Save(); + } + ImGui.SameLine(); + val3 = ImRaii.Disabled(base.Configuration.Stop.SequenceStopMode == Questionable.Configuration.EStopConditionMode.Off); + try + { + int data2 = base.Configuration.Stop.TargetSequence; + ImGui.SetNextItemWidth(100f); + if (ImGui.InputInt("Target sequence", ref data2, 1, 1)) + { + base.Configuration.Stop.TargetSequence = Math.Max(0, Math.Min(255, data2)); + Save(); + } + QuestController.QuestProgress currentQuest = _questController.CurrentQuest; + if (currentQuest != null) + { + int sequence = currentQuest.Sequence; + ImGui.SameLine(); + ImU8String text2 = new ImU8String(11, 1); + text2.AppendLiteral("(Current: "); + text2.AppendFormatted(sequence); + text2.AppendLiteral(")"); + ImGui.TextDisabled(text2); + } + } + finally + { + ((IDisposable)val3)?.Dispose(); + } + ImGui.TextWrapped("Note: Individual quest sequences below override this global setting."); + ImGui.Separator(); + ImGui.Text("Stop when completing quests (or reaching specific sequences):"); + DrawCurrentlyAcceptedQuests(); + _questSelector.DrawSelection(); + List questsToStopAfter = base.Configuration.Stop.QuestsToStopAfter; + if (questsToStopAfter.Count > 0) + { + val3 = ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl)); + try + { + if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All")) + { + foreach (ElementId item in questsToStopAfter) + { + string key = item.ToString(); + base.Configuration.Stop.QuestSequences.Remove(key); + base.Configuration.Stop.QuestStopModes.Remove(key); + } + base.Configuration.Stop.QuestsToStopAfter.Clear(); + Save(); + } + } + finally + { + ((IDisposable)val3)?.Dispose(); + } + if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) + { + ImGui.SetTooltip("Hold CTRL to enable this button."); + } + ImGui.Separator(); + ImGui.Text("(Drag arrow buttons to reorder)"); + } + DrawStopQuestList(questsToStopAfter); } - DrawStopQuestList(questsToStopAfter); + finally + { + ((IDisposable)val2)?.Dispose(); + } + } + finally + { + ((TabItemDisposable)(ref val)).Dispose(); } } @@ -191,10 +221,11 @@ internal sealed class StopConditionComponent : ConfigComponent { continue; } - ImU8String id = new ImU8String(5, 1); - id.AppendLiteral("Quest"); - id.AppendFormatted(elementId); - using (ImRaii.PushId(id)) + ImU8String imU8String = new ImU8String(5, 1); + imU8String.AppendLiteral("Quest"); + imU8String.AppendFormatted(elementId); + IdDisposable val = ImRaii.PushId(imU8String, true); + try { ImGui.AlignTextToFramePadding(); ImU8String text = new ImU8String(1, 1); @@ -252,7 +283,8 @@ internal sealed class StopConditionComponent : ConfigComponent { ImGui.SetTooltip("Stop at specific sequence (unchecked = stop on quest completion)"); } - using (ImRaii.Disabled(!v)) + DisabledDisposable val2 = ImRaii.Disabled(!v); + try { ImGui.SameLine(); ImGui.Text("Seq:"); @@ -268,12 +300,21 @@ internal sealed class StopConditionComponent : ConfigComponent Save(); } } + finally + { + ((IDisposable)val2)?.Dispose(); + } if (questsToStopAfter.Count > 1) { - using (ImRaii.PushFont(UiBuilder.IconFont)) + FontDisposable val3 = ImRaii.PushFont(UiBuilder.IconFont, true); + try { ImGui.SameLine(ImGui.GetContentRegionAvail().X + ImGui.GetStyle().WindowPadding.X - ImGui.CalcTextSize(FontAwesomeIcon.ArrowsUpDown.ToIconString()).X - ImGui.CalcTextSize(FontAwesomeIcon.Times.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 4f - ImGui.GetStyle().ItemSpacing.X); } + finally + { + ((IDisposable)val3)?.Dispose(); + } if (_draggedItem == elementId) { ImGuiComponents.IconButton("##Move", FontAwesomeIcon.ArrowsUpDown, ImGui.ColorConvertU32ToFloat4(ImGui.GetColorU32(ImGuiCol.ButtonActive))); @@ -290,16 +331,25 @@ internal sealed class StopConditionComponent : ConfigComponent } else { - using (ImRaii.PushFont(UiBuilder.IconFont)) + FontDisposable val3 = ImRaii.PushFont(UiBuilder.IconFont, true); + try { ImGui.SameLine(ImGui.GetContentRegionAvail().X + ImGui.GetStyle().WindowPadding.X - ImGui.CalcTextSize(FontAwesomeIcon.Times.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 2f); } + finally + { + ((IDisposable)val3)?.Dispose(); + } } if (ImGuiComponents.IconButton($"##Remove{i}", FontAwesomeIcon.Times)) { quest = quest3; } } + finally + { + ((IDisposable)val)?.Dispose(); + } Vector2 item2 = new Vector2(item.X + x, ImGui.GetCursorScreenPos().Y - ImGui.GetStyle().ItemSpacing.Y + 2f); list.Add((item, item2)); } @@ -340,20 +390,25 @@ internal sealed class StopConditionComponent : ConfigComponent private void DrawCurrentlyAcceptedQuests() { + //IL_0030: Unknown result type (might be due to invalid IL or missing references) + //IL_0035: Unknown result type (might be due to invalid IL or missing references) + //IL_0036: Unknown result type (might be due to invalid IL or missing references) List currentlyAcceptedQuests = GetCurrentlyAcceptedQuests(); ImGui.Text("Currently Accepted Quests:"); - using (ImRaii.IEndObject endObject = ImRaii.Child("AcceptedQuestsList", new Vector2(-1f, 120f), border: true)) + ChildDisposable val = ImRaii.Child((ImU8String)"AcceptedQuestsList", new Vector2(-1f, 120f), true); + try { - if (endObject) + if (ChildDisposable.op_Implicit(val)) { if (currentlyAcceptedQuests.Count > 0) { foreach (Quest item in currentlyAcceptedQuests) { - ImU8String id = new ImU8String(13, 1); - id.AppendLiteral("AcceptedQuest"); - id.AppendFormatted(item.Id); - using (ImRaii.PushId(id)) + ImU8String imU8String = new ImU8String(13, 1); + imU8String.AppendLiteral("AcceptedQuest"); + imU8String.AppendFormatted(item.Id); + IdDisposable val2 = ImRaii.PushId(imU8String, true); + try { (Vector4, FontAwesomeIcon, string) questStyle = _uiUtils.GetQuestStyle(item.Id); bool flag = false; @@ -371,11 +426,17 @@ internal sealed class StopConditionComponent : ConfigComponent { _questTooltipComponent.Draw(item.Info); } - using (ImRaii.PushFont(UiBuilder.IconFont)) + FontDisposable val3 = ImRaii.PushFont(UiBuilder.IconFont, true); + try { ImGui.SameLine(ImGui.GetContentRegionAvail().X + ImGui.GetStyle().WindowPadding.X - ImGui.CalcTextSize(FontAwesomeIcon.Plus.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 2f); } - using (ImRaii.Disabled(flag2)) + finally + { + ((IDisposable)val3)?.Dispose(); + } + DisabledDisposable val4 = ImRaii.Disabled(flag2); + try { if (ImGuiComponents.IconButton($"##Add{item.Id}", FontAwesomeIcon.Plus)) { @@ -384,11 +445,19 @@ internal sealed class StopConditionComponent : ConfigComponent Save(); } } + finally + { + ((IDisposable)val4)?.Dispose(); + } if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { ImGui.SetTooltip(flag2 ? "Quest already added to stop conditions" : "Add this quest to stop conditions"); } } + finally + { + ((IDisposable)val2)?.Dispose(); + } } } else @@ -399,6 +468,10 @@ internal sealed class StopConditionComponent : ConfigComponent } } } + finally + { + ((ChildDisposable)(ref val)).Dispose(); + } ImGui.Spacing(); } diff --git a/Questionable/Questionable.Windows.JournalComponents/AlliedSocietyJournalComponent.cs b/Questionable/Questionable.Windows.JournalComponents/AlliedSocietyJournalComponent.cs index 63e18ce..9a5ec75 100644 --- a/Questionable/Questionable.Windows.JournalComponents/AlliedSocietyJournalComponent.cs +++ b/Questionable/Questionable.Windows.JournalComponents/AlliedSocietyJournalComponent.cs @@ -61,30 +61,45 @@ internal sealed class AlliedSocietyJournalComponent public void DrawAlliedSocietyQuests() { - using ImRaii.IEndObject endObject = ImRaii.TabItem("Allied Societies"); - if (!endObject) + //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) + TabItemDisposable val = ImRaii.TabItem((ImU8String)"Allied Societies"); + try { - return; - } - DrawDailyAllowanceHeader(); - foreach (EAlliedSociety item in from x in Enum.GetValues() - where x != EAlliedSociety.None - select x) - { - List list = (from x in _alliedSocietyQuestFunctions.GetAvailableAlliedSocietyQuests(item) - select (QuestInfo)_questData.GetQuestInfo(x)).ToList(); - if (list.Count != 0 && DrawAlliedSocietyHeader(item, list)) + if (!val) { - using (ImRaii.PushIndent()) + return; + } + DrawDailyAllowanceHeader(); + foreach (EAlliedSociety item in from x in Enum.GetValues() + where x != EAlliedSociety.None + select x) + { + List list = (from x in _alliedSocietyQuestFunctions.GetAvailableAlliedSocietyQuests(item) + select (QuestInfo)_questData.GetQuestInfo(x)).ToList(); + if (list.Count != 0 && DrawAlliedSocietyHeader(item, list)) { - DrawAddToPriorityButtons(item, list); - ImGui.Spacing(); - ImGui.Separator(); - ImGui.Spacing(); - DrawQuestList(item, list); + IndentDisposable val2 = ImRaii.PushIndent(1, true); + try + { + DrawAddToPriorityButtons(item, list); + ImGui.Spacing(); + ImGui.Separator(); + ImGui.Spacing(); + DrawQuestList(item, list); + } + finally + { + ((IDisposable)val2)?.Dispose(); + } } } } + finally + { + ((TabItemDisposable)(ref val)).Dispose(); + } } private unsafe void DrawDailyAllowanceHeader() @@ -271,10 +286,15 @@ internal sealed class AlliedSocietyJournalComponent private static void DrawDisabledAddButton() { - using (ImRaii.Disabled(disabled: true)) + DisabledDisposable val = ImRaii.Disabled(true); + try { ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, "Add to Priority"); } + finally + { + ((IDisposable)val)?.Dispose(); + } if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { ImGui.SetTooltip("No quests available to add (may be disabled, already in priority, or not available)"); @@ -284,7 +304,8 @@ internal sealed class AlliedSocietyJournalComponent private void DrawArrSocietyButtons(EAlliedSociety alliedSociety, List availableQuests, int dailyLimit, int remainingAllowances) { int num = Math.Min(Math.Min(dailyLimit, remainingAllowances), availableQuests.Count); - using (ImRaii.Disabled(remainingAllowances == 0)) + DisabledDisposable val = ImRaii.Disabled(remainingAllowances == 0); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, num switch { @@ -297,6 +318,10 @@ internal sealed class AlliedSocietyJournalComponent AddQuestsToPriority(alliedSociety, availableQuests.Take(num).ToList()); } } + finally + { + ((IDisposable)val)?.Dispose(); + } if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { DrawRecommendedButtonTooltip(num, remainingAllowances, dailyLimit, alliedSociety, availableQuests.Count); @@ -317,7 +342,8 @@ internal sealed class AlliedSocietyJournalComponent ImGui.BeginTooltip(); if (remainingAllowances == 0) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true); + try { ImU8String text = new ImU8String(0, 1); text.AppendFormatted(SeIconChar.Cross.ToIconString()); @@ -325,6 +351,10 @@ internal sealed class AlliedSocietyJournalComponent ImGui.SameLine(); ImGui.TextUnformatted("No daily allowances remaining"); } + finally + { + ((IDisposable)val)?.Dispose(); + } Vector4 col = ImGuiColors.DalamudGrey3; ImU8String text2 = new ImU8String(44, 1); text2.AppendLiteral("You've used all "); @@ -334,7 +364,8 @@ internal sealed class AlliedSocietyJournalComponent } else if (questsToAddCount == remainingAllowances && questsToAddCount < availableCount) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen, true); + try { ImU8String text3 = new ImU8String(0, 1); text3.AppendFormatted(SeIconChar.QuestSync.ToIconString()); @@ -347,6 +378,10 @@ internal sealed class AlliedSocietyJournalComponent text4.AppendFormatted((questsToAddCount == 1) ? "quest" : "quests"); ImGui.TextUnformatted(text4); } + finally + { + ((IDisposable)val)?.Dispose(); + } Vector4 col = ImGuiColors.DalamudGrey3; ImU8String text5 = new ImU8String(44, 2); text5.AppendLiteral("You can complete "); @@ -360,7 +395,8 @@ internal sealed class AlliedSocietyJournalComponent } else if (questsToAddCount == dailyLimit) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen, true); + try { ImU8String text6 = new ImU8String(0, 1); text6.AppendFormatted(SeIconChar.QuestSync.ToIconString()); @@ -372,6 +408,10 @@ internal sealed class AlliedSocietyJournalComponent text7.AppendLiteral(" quests"); ImGui.TextUnformatted(text7); } + finally + { + ((IDisposable)val)?.Dispose(); + } Vector4 col = ImGuiColors.DalamudGrey3; ImU8String text8 = new ImU8String(51, 2); text8.AppendLiteral("This will use "); @@ -385,7 +425,8 @@ internal sealed class AlliedSocietyJournalComponent } else if (questsToAddCount == availableCount) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen, true); + try { ImU8String text9 = new ImU8String(0, 1); text9.AppendFormatted(SeIconChar.QuestSync.ToIconString()); @@ -400,6 +441,10 @@ internal sealed class AlliedSocietyJournalComponent text10.AppendFormatted((questsToAddCount == 1) ? "quest" : "quests"); ImGui.TextUnformatted(text10); } + finally + { + ((IDisposable)val)?.Dispose(); + } Vector4 col = ImGuiColors.DalamudGrey3; ImU8String text11 = new ImU8String(37, 2); text11.AppendLiteral("Uses "); @@ -413,7 +458,8 @@ internal sealed class AlliedSocietyJournalComponent } else { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow, true); + try { ImU8String text12 = new ImU8String(0, 1); text12.AppendFormatted(SeIconChar.BoxedLetterQ.ToIconString()); @@ -428,6 +474,10 @@ internal sealed class AlliedSocietyJournalComponent text13.AppendFormatted((questsToAddCount == 1) ? "quest" : "quests"); ImGui.TextUnformatted(text13); } + finally + { + ((IDisposable)val)?.Dispose(); + } Vector4 col = ImGuiColors.DalamudGrey3; ImU8String text14 = new ImU8String(55, 2); text14.AppendLiteral("Limited by available quests ("); @@ -447,7 +497,8 @@ internal sealed class AlliedSocietyJournalComponent ImGui.BeginTooltip(); if (availableCount > remainingAllowances) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange, true); + try { ImU8String text = new ImU8String(0, 1); text.AppendFormatted(SeIconChar.Cross.ToIconString()); @@ -455,6 +506,10 @@ internal sealed class AlliedSocietyJournalComponent ImGui.SameLine(); ImGui.TextUnformatted("Warning: Exceeds remaining allowances"); } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.Spacing(); ImU8String text2 = new ImU8String(54, 1); text2.AppendLiteral("This adds all "); @@ -473,7 +528,8 @@ internal sealed class AlliedSocietyJournalComponent } else if (availableCount > dailyLimit) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange, true); + try { ImU8String text4 = new ImU8String(0, 1); text4.AppendFormatted(SeIconChar.Cross.ToIconString()); @@ -481,6 +537,10 @@ internal sealed class AlliedSocietyJournalComponent ImGui.SameLine(); ImGui.TextUnformatted("Warning: Exceeds daily optimal amount"); } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.Spacing(); ImU8String text5 = new ImU8String(32, 1); text5.AppendLiteral("This adds all "); @@ -503,7 +563,8 @@ internal sealed class AlliedSocietyJournalComponent } else { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen, true); + try { ImU8String text8 = new ImU8String(0, 1); text8.AppendFormatted(SeIconChar.QuestSync.ToIconString()); @@ -518,6 +579,10 @@ internal sealed class AlliedSocietyJournalComponent text9.AppendFormatted((availableCount == 1) ? "quest" : "quests"); ImGui.TextUnformatted(text9); } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.Spacing(); Vector4 col = ImGuiColors.DalamudGrey3; ImU8String text10 = new ImU8String(27, 2); @@ -561,7 +626,8 @@ internal sealed class AlliedSocietyJournalComponent ImGui.Spacing(); if (availableQuests.Count <= remainingAllowances) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen, true); + try { ImU8String text2 = new ImU8String(0, 1); text2.AppendFormatted(SeIconChar.QuestSync.ToIconString()); @@ -576,11 +642,16 @@ internal sealed class AlliedSocietyJournalComponent text3.AppendFormatted((remainingAllowances == 1) ? "allowance" : "allowances"); ImGui.TextUnformatted(text3); } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.TextColored(ImGuiColors.DalamudGrey3, "All can be completed today"); } else { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange, true); + try { ImU8String text4 = new ImU8String(0, 1); text4.AppendFormatted(SeIconChar.Cross.ToIconString()); @@ -592,6 +663,10 @@ internal sealed class AlliedSocietyJournalComponent text5.AppendLiteral(")"); ImGui.TextUnformatted(text5); } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.TextColored(ImGuiColors.DalamudGrey3, "Some quests won't be completable until tomorrow"); } ImGui.EndTooltip(); diff --git a/Questionable/Questionable.Windows.JournalComponents/DutyJournalComponent.cs b/Questionable/Questionable.Windows.JournalComponents/DutyJournalComponent.cs index b21e4e1..f6aa84e 100644 --- a/Questionable/Questionable.Windows.JournalComponents/DutyJournalComponent.cs +++ b/Questionable/Questionable.Windows.JournalComponents/DutyJournalComponent.cs @@ -62,42 +62,60 @@ internal sealed class DutyJournalComponent public void DrawDuties() { - using ImRaii.IEndObject endObject = ImRaii.TabItem("Duties"); - if (!endObject) + //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) + //IL_009f: Unknown result type (might be due to invalid IL or missing references) + //IL_00a4: Unknown result type (might be due to invalid IL or missing references) + //IL_00a5: Unknown result type (might be due to invalid IL or missing references) + TabItemDisposable val = ImRaii.TabItem((ImU8String)"Duties"); + try { - return; - } - if (ImGui.CollapsingHeader("Explanation", ImGuiTreeNodeFlags.DefaultOpen)) - { - ImGui.Text("The list below shows all duties and their unlock status."); - ImGui.BulletText("'Unlocked' shows duties you have access to."); - ImGui.BulletText("'Completed' shows duties you have finished at least once."); - ImGui.BulletText("Click on a duty to see which quest unlocks it."); - ImGui.Spacing(); - ImGui.Separator(); - ImGui.Spacing(); - } - DrawFilterControls(); - if (_filteredCategories.Count > 0) - { - using (ImRaii.IEndObject endObject2 = ImRaii.Table("Duties", 3, ImGuiTableFlags.NoSavedSettings)) + if (!val) { - if (!endObject2) - { - return; - } - ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.NoHide); - ImGui.TableSetupColumn("Unlocked", ImGuiTableColumnFlags.WidthFixed, 120f * ImGui.GetIO().FontGlobalScale); - ImGui.TableSetupColumn("Completed", ImGuiTableColumnFlags.WidthFixed, 120f * ImGui.GetIO().FontGlobalScale); - ImGui.TableHeadersRow(); - foreach (DutyCategory filteredCategory in _filteredCategories) - { - DrawCategory(filteredCategory); - } return; } + if (ImGui.CollapsingHeader("Explanation", ImGuiTreeNodeFlags.DefaultOpen)) + { + ImGui.Text("The list below shows all duties and their unlock status."); + ImGui.BulletText("'Unlocked' shows duties you have access to."); + ImGui.BulletText("'Completed' shows duties you have finished at least once."); + ImGui.BulletText("Click on a duty to see which quest unlocks it."); + ImGui.Spacing(); + ImGui.Separator(); + ImGui.Spacing(); + } + DrawFilterControls(); + if (_filteredCategories.Count > 0) + { + TableDisposable val2 = ImRaii.Table((ImU8String)"Duties", 3, ImGuiTableFlags.NoSavedSettings); + try + { + if (!val2) + { + return; + } + ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.NoHide); + ImGui.TableSetupColumn("Unlocked", ImGuiTableColumnFlags.WidthFixed, 120f * ImGui.GetIO().FontGlobalScale); + ImGui.TableSetupColumn("Completed", ImGuiTableColumnFlags.WidthFixed, 120f * ImGui.GetIO().FontGlobalScale); + ImGui.TableHeadersRow(); + foreach (DutyCategory filteredCategory in _filteredCategories) + { + DrawCategory(filteredCategory); + } + return; + } + finally + { + ((TableDisposable)(ref val2)).Dispose(); + } + } + ImGui.Text("No duties match your search."); + } + finally + { + ((TabItemDisposable)(ref val)).Dispose(); } - ImGui.Text("No duties match your search."); } private void DrawFilterControls() @@ -174,69 +192,78 @@ internal sealed class DutyJournalComponent private void DrawDutyTooltip(DutyInfo duty) { - using ImRaii.IEndObject endObject = ImRaii.Tooltip(); - if (!endObject) + //IL_0000: Unknown result type (might be due to invalid IL or missing references) + //IL_0005: Unknown result type (might be due to invalid IL or missing references) + TooltipDisposable val = ImRaii.Tooltip(); + try { - return; - } - ImGui.TextColored(ImGuiColors.DalamudWhite, duty.Name); - Vector4 col = ImGuiColors.DalamudGrey; - ImU8String text = new ImU8String(12, 1); - text.AppendLiteral("Content ID: "); - text.AppendFormatted(duty.ContentFinderConditionId); - ImGui.TextColored(in col, text); - ImGui.Separator(); - ImU8String text2 = new ImU8String(16, 1); - text2.AppendLiteral("Level Required: "); - text2.AppendFormatted(duty.Level); - ImGui.Text(text2); - if (duty.ItemLevel > 0) - { - ImU8String text3 = new ImU8String(21, 1); - text3.AppendLiteral("Item Level Required: "); - text3.AppendFormatted(duty.ItemLevel); - ImGui.Text(text3); - } - ImU8String text4 = new ImU8String(6, 1); - text4.AppendLiteral("Type: "); - text4.AppendFormatted(duty.ContentTypeName); - ImGui.Text(text4); - if (duty.IsHighEndDuty) - { - ImGui.SameLine(); - ImGui.TextColored(ImGuiColors.DalamudOrange, "(High-End)"); - } - ImGui.Separator(); - if (duty.IsUnlocked) - { - ImGui.TextColored(ImGuiColors.ParsedGreen, "Status: Unlocked"); - } - else - { - ImGui.TextColored(ImGuiColors.DalamudRed, "Status: Locked"); - } - if (duty.UnlockQuests.Count > 0) - { - ImGui.Separator(); - ImGui.Text("Unlock Quest(s):"); + if (!((TooltipDisposable)(ref val)).Alive) { - foreach (QuestId unlockQuest in duty.UnlockQuests) - { - if (_questData.TryGetQuestInfo(unlockQuest, out IQuestInfo questInfo)) - { - var (color, icon, _) = _uiUtils.GetQuestStyle(unlockQuest); - _uiUtils.ChecklistItem($"{questInfo.Name} ({unlockQuest})", color, icon); - } - else - { - _uiUtils.ChecklistItem($"Unknown Quest ({unlockQuest})", ImGuiColors.DalamudGrey, FontAwesomeIcon.Question); - } - } return; } + ImGui.TextColored(ImGuiColors.DalamudWhite, duty.Name); + Vector4 col = ImGuiColors.DalamudGrey; + ImU8String text = new ImU8String(12, 1); + text.AppendLiteral("Content ID: "); + text.AppendFormatted(duty.ContentFinderConditionId); + ImGui.TextColored(in col, text); + ImGui.Separator(); + ImU8String text2 = new ImU8String(16, 1); + text2.AppendLiteral("Level Required: "); + text2.AppendFormatted(duty.Level); + ImGui.Text(text2); + if (duty.ItemLevel > 0) + { + ImU8String text3 = new ImU8String(21, 1); + text3.AppendLiteral("Item Level Required: "); + text3.AppendFormatted(duty.ItemLevel); + ImGui.Text(text3); + } + ImU8String text4 = new ImU8String(6, 1); + text4.AppendLiteral("Type: "); + text4.AppendFormatted(duty.ContentTypeName); + ImGui.Text(text4); + if (duty.IsHighEndDuty) + { + ImGui.SameLine(); + ImGui.TextColored(ImGuiColors.DalamudOrange, "(High-End)"); + } + ImGui.Separator(); + if (duty.IsUnlocked) + { + ImGui.TextColored(ImGuiColors.ParsedGreen, "Status: Unlocked"); + } + else + { + ImGui.TextColored(ImGuiColors.DalamudRed, "Status: Locked"); + } + if (duty.UnlockQuests.Count > 0) + { + ImGui.Separator(); + ImGui.Text("Unlock Quest(s):"); + { + foreach (QuestId unlockQuest in duty.UnlockQuests) + { + if (_questData.TryGetQuestInfo(unlockQuest, out IQuestInfo questInfo)) + { + var (color, icon, _) = _uiUtils.GetQuestStyle(unlockQuest); + _uiUtils.ChecklistItem($"{questInfo.Name} ({unlockQuest})", color, icon); + } + else + { + _uiUtils.ChecklistItem($"Unknown Quest ({unlockQuest})", ImGuiColors.DalamudGrey, FontAwesomeIcon.Question); + } + } + return; + } + } + ImGui.Separator(); + ImGui.TextColored(ImGuiColors.DalamudGrey, "No unlock quest data available."); + } + finally + { + ((TooltipDisposable)(ref val)).Dispose(); } - ImGui.Separator(); - ImGui.TextColored(ImGuiColors.DalamudGrey, "No unlock quest data available."); } private void DrawDutyStatus(bool? status) diff --git a/Questionable/Questionable.Windows.JournalComponents/GatheringJournalComponent.cs b/Questionable/Questionable.Windows.JournalComponents/GatheringJournalComponent.cs index f9bba1f..1094ecc 100644 --- a/Questionable/Questionable.Windows.JournalComponents/GatheringJournalComponent.cs +++ b/Questionable/Questionable.Windows.JournalComponents/GatheringJournalComponent.cs @@ -202,36 +202,54 @@ internal sealed class GatheringJournalComponent public void DrawGatheringItems() { - using ImRaii.IEndObject endObject = ImRaii.TabItem("Gathering Points"); - if (!endObject) + //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) + //IL_0078: Unknown result type (might be due to invalid IL or missing references) + //IL_007d: Unknown result type (might be due to invalid IL or missing references) + //IL_007e: Unknown result type (might be due to invalid IL or missing references) + TabItemDisposable val = ImRaii.TabItem((ImU8String)"Gathering Points"); + try { - return; - } - ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X); - if (ImGui.InputTextWithHint(string.Empty, "Search areas, gathering points and items", ref _searchText, 256)) - { - UpdateFilter(); - } - if (_filteredExpansions.Count > 0) - { - using (ImRaii.IEndObject endObject2 = ImRaii.Table("GatheringPoints", 3, ImGuiTableFlags.NoSavedSettings)) + if (!val) { - if (!endObject2) - { - return; - } - ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.NoHide); - ImGui.TableSetupColumn("Supported", ImGuiTableColumnFlags.WidthFixed, 100f * ImGui.GetIO().FontGlobalScale); - ImGui.TableSetupColumn("Collected", ImGuiTableColumnFlags.WidthFixed, 100f * ImGui.GetIO().FontGlobalScale); - ImGui.TableHeadersRow(); - foreach (FilteredExpansion filteredExpansion in _filteredExpansions) - { - DrawExpansion(filteredExpansion); - } return; } + ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X); + if (ImGui.InputTextWithHint(string.Empty, "Search areas, gathering points and items", ref _searchText, 256)) + { + UpdateFilter(); + } + if (_filteredExpansions.Count > 0) + { + TableDisposable val2 = ImRaii.Table((ImU8String)"GatheringPoints", 3, ImGuiTableFlags.NoSavedSettings); + try + { + if (!val2) + { + return; + } + ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.NoHide); + ImGui.TableSetupColumn("Supported", ImGuiTableColumnFlags.WidthFixed, 100f * ImGui.GetIO().FontGlobalScale); + ImGui.TableSetupColumn("Collected", ImGuiTableColumnFlags.WidthFixed, 100f * ImGui.GetIO().FontGlobalScale); + ImGui.TableHeadersRow(); + foreach (FilteredExpansion filteredExpansion in _filteredExpansions) + { + DrawExpansion(filteredExpansion); + } + return; + } + finally + { + ((TableDisposable)(ref val2)).Dispose(); + } + } + ImGui.Text("No area, gathering point or item matches your search text."); + } + finally + { + ((TabItemDisposable)(ref val)).Dispose(); } - ImGui.Text("No area, gathering point or item matches your search text."); } private void DrawExpansion(FilteredExpansion expansion) diff --git a/Questionable/Questionable.Windows.JournalComponents/QuestJournalComponent.cs b/Questionable/Questionable.Windows.JournalComponents/QuestJournalComponent.cs index c921dc9..f82f238 100644 --- a/Questionable/Questionable.Windows.JournalComponents/QuestJournalComponent.cs +++ b/Questionable/Questionable.Windows.JournalComponents/QuestJournalComponent.cs @@ -119,66 +119,84 @@ internal sealed class QuestJournalComponent public void DrawQuests() { - using ImRaii.IEndObject endObject = ImRaii.TabItem("Quests"); - if (!endObject) + //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) + //IL_016d: Unknown result type (might be due to invalid IL or missing references) + //IL_0172: Unknown result type (might be due to invalid IL or missing references) + //IL_0173: Unknown result type (might be due to invalid IL or missing references) + TabItemDisposable val = ImRaii.TabItem((ImU8String)"Quests"); + try { - return; - } - bool hideSeasonalEventsFromJournalProgress = _configuration.General.HideSeasonalEventsFromJournalProgress; - if (hideSeasonalEventsFromJournalProgress != _lastHideSeasonalGlobally) - { - _lastHideSeasonalGlobally = hideSeasonalEventsFromJournalProgress; - _logger.LogDebug("Configuration change detected: HideSeasonalEventsFromJournalProgress={Hide} - refreshing journal", hideSeasonalEventsFromJournalProgress); - UpdateFilter(); - } - if (ImGui.CollapsingHeader("Explanation", ImGuiTreeNodeFlags.DefaultOpen)) - { - ImGui.Text("The list below contains all quests that appear in your journal."); - ImGui.BulletText("'Supported' lists quests that Questionable can do for you"); - ImGui.BulletText("'Completed' lists quests your current character has completed."); - ImGui.BulletText("Not all quests can be completed even if they're listed as available, e.g. starting city quest chains or past seasonal events."); - ImGui.Spacing(); - ImGui.Separator(); - ImGui.Spacing(); - } - QuestJournalUtils.ShowFilterContextMenu(this); - ImGui.SameLine(); - _questJournalUtils.AddAllAvailableQuests(); - ImGui.SameLine(); - if (ImGuiComponents.IconButton(FontAwesomeIcon.GlobeEurope)) - { - Util.OpenLink("https://wigglymuffin.github.io/FFXIV-Tools/"); - } - if (ImGui.IsItemHovered()) - { - ImGui.SetTooltip("View All Quest Paths Online"); - } - ImGui.SameLine(); - ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X); - if (ImGui.InputTextWithHint(string.Empty, "Search quests and categories", ref Filter.SearchText, 256)) - { - UpdateFilter(); - } - if (_filteredSections.Count > 0) - { - using (ImRaii.IEndObject endObject2 = ImRaii.Table("Quests", 3, ImGuiTableFlags.NoSavedSettings)) + if (!val) { - if (!endObject2) - { - return; - } - ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.NoHide); - ImGui.TableSetupColumn("Supported", ImGuiTableColumnFlags.WidthFixed, 120f * ImGui.GetIO().FontGlobalScale); - ImGui.TableSetupColumn("Completed", ImGuiTableColumnFlags.WidthFixed, 120f * ImGui.GetIO().FontGlobalScale); - ImGui.TableHeadersRow(); - foreach (FilteredSection filteredSection in _filteredSections) - { - DrawSection(filteredSection); - } return; } + bool hideSeasonalEventsFromJournalProgress = _configuration.General.HideSeasonalEventsFromJournalProgress; + if (hideSeasonalEventsFromJournalProgress != _lastHideSeasonalGlobally) + { + _lastHideSeasonalGlobally = hideSeasonalEventsFromJournalProgress; + _logger.LogDebug("Configuration change detected: HideSeasonalEventsFromJournalProgress={Hide} - refreshing journal", hideSeasonalEventsFromJournalProgress); + UpdateFilter(); + } + if (ImGui.CollapsingHeader("Explanation", ImGuiTreeNodeFlags.DefaultOpen)) + { + ImGui.Text("The list below contains all quests that appear in your journal."); + ImGui.BulletText("'Supported' lists quests that Questionable can do for you"); + ImGui.BulletText("'Completed' lists quests your current character has completed."); + ImGui.BulletText("Not all quests can be completed even if they're listed as available, e.g. starting city quest chains or past seasonal events."); + ImGui.Spacing(); + ImGui.Separator(); + ImGui.Spacing(); + } + QuestJournalUtils.ShowFilterContextMenu(this); + ImGui.SameLine(); + _questJournalUtils.AddAllAvailableQuests(); + ImGui.SameLine(); + if (ImGuiComponents.IconButton(FontAwesomeIcon.GlobeEurope)) + { + Util.OpenLink("https://wigglymuffin.github.io/FFXIV-Tools/"); + } + if (ImGui.IsItemHovered()) + { + ImGui.SetTooltip("View All Quest Paths Online"); + } + ImGui.SameLine(); + ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X); + if (ImGui.InputTextWithHint(string.Empty, "Search quests and categories", ref Filter.SearchText, 256)) + { + UpdateFilter(); + } + if (_filteredSections.Count > 0) + { + TableDisposable val2 = ImRaii.Table((ImU8String)"Quests", 3, ImGuiTableFlags.NoSavedSettings); + try + { + if (!val2) + { + return; + } + ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.NoHide); + ImGui.TableSetupColumn("Supported", ImGuiTableColumnFlags.WidthFixed, 120f * ImGui.GetIO().FontGlobalScale); + ImGui.TableSetupColumn("Completed", ImGuiTableColumnFlags.WidthFixed, 120f * ImGui.GetIO().FontGlobalScale); + ImGui.TableHeadersRow(); + foreach (FilteredSection filteredSection in _filteredSections) + { + DrawSection(filteredSection); + } + return; + } + finally + { + ((TableDisposable)(ref val2)).Dispose(); + } + } + ImGui.Text("No quest or category matches your search."); + } + finally + { + ((TabItemDisposable)(ref val)).Dispose(); } - ImGui.Text("No quest or category matches your search."); } private void DrawSection(FilteredSection filter) diff --git a/Questionable/Questionable.Windows.JournalComponents/QuestJournalUtils.cs b/Questionable/Questionable.Windows.JournalComponents/QuestJournalUtils.cs index 6db7508..721f7a3 100644 --- a/Questionable/Questionable.Windows.JournalComponents/QuestJournalUtils.cs +++ b/Questionable/Questionable.Windows.JournalComponents/QuestJournalUtils.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using Dalamud.Bindings.ImGui; @@ -44,6 +45,9 @@ internal sealed class QuestJournalUtils public void ShowContextMenu(IQuestInfo questInfo, Quest? quest, string label) { + //IL_0057: Unknown result type (might be due to invalid IL or missing references) + //IL_005c: Unknown result type (might be due to invalid IL or missing references) + //IL_005d: Unknown result type (might be due to invalid IL or missing references) if (ImGui.IsItemClicked(ImGuiMouseButton.Right)) { ImU8String strId = new ImU8String(12, 1); @@ -51,68 +55,90 @@ internal sealed class QuestJournalUtils strId.AppendFormatted(questInfo.QuestId); ImGui.OpenPopup(strId); } - ImU8String id = new ImU8String(12, 1); - id.AppendLiteral("##QuestPopup"); - id.AppendFormatted(questInfo.QuestId); - using ImRaii.IEndObject endObject = ImRaii.Popup(id); - if (!endObject) + ImU8String imU8String = new ImU8String(12, 1); + imU8String.AppendLiteral("##QuestPopup"); + imU8String.AppendFormatted(questInfo.QuestId); + PopupDisposable val = ImRaii.Popup(imU8String); + try { - return; - } - using (ImRaii.Disabled(!_questFunctions.IsReadyToAcceptQuest(questInfo.QuestId) || quest == null || quest.Root.Disabled)) - { - if (ImGui.MenuItem("Start as next quest")) + if (!val) { - _questController.SetNextQuest(quest); - _questController.Start(label); + return; + } + DisabledDisposable val2 = ImRaii.Disabled(!_questFunctions.IsReadyToAcceptQuest(questInfo.QuestId) || quest == null || quest.Root.Disabled); + try + { + if (ImGui.MenuItem("Start as next quest")) + { + _questController.SetNextQuest(quest); + _questController.Start(label); + } + } + finally + { + ((IDisposable)val2)?.Dispose(); + } + if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) + { + if (!_questFunctions.IsReadyToAcceptQuest(questInfo.QuestId)) + { + ImGui.SetTooltip("Quest is not ready to accept"); + } + else if (quest == null) + { + ImGui.SetTooltip("Quest has no path available"); + } + else if (quest.Root.Disabled) + { + ImGui.SetTooltip("Quest path is disabled"); + } + } + List incompletePrerequisiteQuests = GetIncompletePrerequisiteQuests(questInfo); + val2 = ImRaii.Disabled(incompletePrerequisiteQuests.Count == 0); + try + { + if (ImGui.MenuItem(incompletePrerequisiteQuests.Count switch + { + 0 => "Add quest and requirements to priority", + 1 => "Add 1 quest to priority", + _ => $"Add {incompletePrerequisiteQuests.Count} quests to priority", + })) + { + AddRequiredQuestsToPriority(questInfo, incompletePrerequisiteQuests); + } + } + finally + { + ((IDisposable)val2)?.Dispose(); + } + if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) + { + if (incompletePrerequisiteQuests.Count == 0) + { + ImGui.SetTooltip("No quests to add (quest may be complete, disabled, locked with no unlock path, or already in priority)"); + } + else + { + ImGui.SetTooltip((incompletePrerequisiteQuests.Count == 1) ? "Add this quest to the priority list" : $"Add this quest and {incompletePrerequisiteQuests.Count - 1} required {((incompletePrerequisiteQuests.Count - 1 == 1) ? "quest" : "quests")} to the priority list in completion order"); + } + } + bool flag = _commandManager.Commands.ContainsKey("/questinfo"); + val2 = ImRaii.Disabled(!(questInfo.QuestId is QuestId) || !flag); + try + { + if (ImGui.MenuItem("View in Quest Map")) + { + _commandManager.ProcessCommand($"/questinfo {questInfo.QuestId}"); + } + } + finally + { + ((IDisposable)val2)?.Dispose(); } } - if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) + finally { - if (!_questFunctions.IsReadyToAcceptQuest(questInfo.QuestId)) - { - ImGui.SetTooltip("Quest is not ready to accept"); - } - else if (quest == null) - { - ImGui.SetTooltip("Quest has no path available"); - } - else if (quest.Root.Disabled) - { - ImGui.SetTooltip("Quest path is disabled"); - } - } - List incompletePrerequisiteQuests = GetIncompletePrerequisiteQuests(questInfo); - using (ImRaii.Disabled(incompletePrerequisiteQuests.Count == 0)) - { - if (ImGui.MenuItem(incompletePrerequisiteQuests.Count switch - { - 0 => "Add quest and requirements to priority", - 1 => "Add 1 quest to priority", - _ => $"Add {incompletePrerequisiteQuests.Count} quests to priority", - })) - { - AddRequiredQuestsToPriority(questInfo, incompletePrerequisiteQuests); - } - } - if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) - { - if (incompletePrerequisiteQuests.Count == 0) - { - ImGui.SetTooltip("No quests to add (quest may be complete, disabled, locked with no unlock path, or already in priority)"); - } - else - { - ImGui.SetTooltip((incompletePrerequisiteQuests.Count == 1) ? "Add this quest to the priority list" : $"Add this quest and {incompletePrerequisiteQuests.Count - 1} required {((incompletePrerequisiteQuests.Count - 1 == 1) ? "quest" : "quests")} to the priority list in completion order"); - } - } - bool flag = _commandManager.Commands.ContainsKey("/questinfo"); - using (ImRaii.Disabled(!(questInfo.QuestId is QuestId) || !flag)) - { - if (ImGui.MenuItem("View in Quest Map")) - { - _commandManager.ProcessCommand($"/questinfo {questInfo.QuestId}"); - } + ((PopupDisposable)(ref val)).Dispose(); } } @@ -233,6 +259,9 @@ internal sealed class QuestJournalUtils internal static void ShowFilterContextMenu(QuestJournalComponent journalUi) { + //IL_003c: Unknown result type (might be due to invalid IL or missing references) + //IL_0041: Unknown result type (might be due to invalid IL or missing references) + //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (ImGuiComponents.IconButton(FontAwesomeIcon.Filter)) { ImGui.OpenPopup("QuestFilters"); @@ -241,32 +270,40 @@ internal sealed class QuestJournalUtils { ImGui.SetTooltip("Filter Options"); } - using ImRaii.IEndObject endObject = ImRaii.Popup("QuestFilters"); - if (!ImRaii.IEndObject.op_True(endObject)) + PopupDisposable val = ImRaii.Popup((ImU8String)"QuestFilters"); + try { - return; - } - if ((0u | (ImGui.Checkbox("Available Only", ref journalUi.Filter.AvailableOnly) ? 1u : 0u) | (ImGui.Checkbox("Hide Without Quest Paths", ref journalUi.Filter.HideNoPaths) ? 1u : 0u) | (ImGui.Checkbox("Hide Unobtainable", ref journalUi.Filter.HideUnobtainable) ? 1u : 0u)) != 0) - { - journalUi.UpdateFilter(); - } - if (journalUi.Filter.AdvancedFiltersActive) - { - ImGui.Separator(); - if (ImGui.Button("Clear Filters")) + if (!PopupDisposable.op_Implicit(val)) + { + return; + } + if ((0u | (ImGui.Checkbox("Available Only", ref journalUi.Filter.AvailableOnly) ? 1u : 0u) | (ImGui.Checkbox("Hide Without Quest Paths", ref journalUi.Filter.HideNoPaths) ? 1u : 0u) | (ImGui.Checkbox("Hide Unobtainable", ref journalUi.Filter.HideUnobtainable) ? 1u : 0u)) != 0) { - journalUi.Filter.AvailableOnly = false; - journalUi.Filter.HideNoPaths = false; - journalUi.Filter.HideUnobtainable = false; journalUi.UpdateFilter(); } + if (journalUi.Filter.AdvancedFiltersActive) + { + ImGui.Separator(); + if (ImGui.Button("Clear Filters")) + { + journalUi.Filter.AvailableOnly = false; + journalUi.Filter.HideNoPaths = false; + journalUi.Filter.HideUnobtainable = false; + journalUi.UpdateFilter(); + } + } + } + finally + { + ((PopupDisposable)(ref val)).Dispose(); } } public void AddAllAvailableQuests() { int num = _questRegistry.AllQuests.Count((Quest quest) => !quest.Root.Disabled && !_questFunctions.IsQuestRemoved(quest.Id) && _questFunctions.IsReadyToAcceptQuest(quest.Id) && !_questFunctions.IsQuestComplete(quest.Id) && !_questFunctions.IsQuestAccepted(quest.Id) && !quest.Info.IsRepeatable && quest.Info.AlliedSociety == EAlliedSociety.None && !(quest.Info is QuestInfo { MoogleDeliveryLevel: >0 }) && !_questController.ManualPriorityQuests.Any((Quest q) => q.Id.Equals(quest.Id))); - using (ImRaii.Disabled(num == 0)) + DisabledDisposable val = ImRaii.Disabled(num == 0); + try { if (ImGuiComponents.IconButton(FontAwesomeIcon.ListOl)) { @@ -275,6 +312,10 @@ internal sealed class QuestJournalUtils _chatGui.Print($"Added {num2} {value} to priority queue.", "Questionable", 576); } } + finally + { + ((IDisposable)val)?.Dispose(); + } if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { object obj; diff --git a/Questionable/Questionable.Windows.JournalComponents/QuestRewardComponent.cs b/Questionable/Questionable.Windows.JournalComponents/QuestRewardComponent.cs index d051d2d..6154a45 100644 --- a/Questionable/Questionable.Windows.JournalComponents/QuestRewardComponent.cs +++ b/Questionable/Questionable.Windows.JournalComponents/QuestRewardComponent.cs @@ -35,22 +35,34 @@ internal sealed class QuestRewardComponent public void DrawItemRewards() { - using ImRaii.IEndObject endObject = ImRaii.TabItem("Item Rewards"); - if (!(!endObject)) + //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) + TabItemDisposable val = ImRaii.TabItem((ImU8String)"Item Rewards"); + try { - ImGui.Checkbox("Show rewards from seasonal event quests", ref _showEventRewards); - ImGui.Spacing(); - ImGui.BulletText("Only untradeable items are listed (e.g. the Wind-up Airship can be sold on the market board)."); - DrawGroup("Mounts", EItemRewardType.Mount); - DrawGroup("Minions", EItemRewardType.Minion); - DrawGroup("Orchestrion Rolls", EItemRewardType.OrchestrionRoll); - DrawGroup("Triple Triad Cards", EItemRewardType.TripleTriadCard); - DrawGroup("Fashion Accessories", EItemRewardType.FashionAccessory); + if (!(!val)) + { + ImGui.Checkbox("Show rewards from seasonal event quests", ref _showEventRewards); + ImGui.Spacing(); + ImGui.BulletText("Only untradeable items are listed (e.g. the Wind-up Airship can be sold on the market board)."); + DrawGroup("Mounts", EItemRewardType.Mount); + DrawGroup("Minions", EItemRewardType.Minion); + DrawGroup("Orchestrion Rolls", EItemRewardType.OrchestrionRoll); + DrawGroup("Triple Triad Cards", EItemRewardType.TripleTriadCard); + DrawGroup("Fashion Accessories", EItemRewardType.FashionAccessory); + } + } + finally + { + ((TabItemDisposable)(ref val)).Dispose(); } } private void DrawGroup(string label, EItemRewardType type) { + //IL_0175: Unknown result type (might be due to invalid IL or missing references) + //IL_017a: Unknown result type (might be due to invalid IL or missing references) ImU8String label2 = new ImU8String(9, 2); label2.AppendFormatted(label); label2.AppendLiteral("###Reward"); @@ -82,18 +94,30 @@ internal sealed class QuestRewardComponent { continue; } - using ImRaii.IEndObject endObject = ImRaii.Tooltip(); - if (!(!endObject)) + TooltipDisposable val = ImRaii.Tooltip(); + try { - ImU8String text2 = new ImU8String(15, 1); - text2.AppendLiteral("Obtained from: "); - text2.AppendFormatted(questInfo.Name); - ImGui.Text(text2); - using (ImRaii.PushIndent()) + if (((TooltipDisposable)(ref val)).Alive) { - _questTooltipComponent.DrawInner(questInfo, showItemRewards: false); + ImU8String text2 = new ImU8String(15, 1); + text2.AppendLiteral("Obtained from: "); + text2.AppendFormatted(questInfo.Name); + ImGui.Text(text2); + IndentDisposable val2 = ImRaii.PushIndent(1, true); + try + { + _questTooltipComponent.DrawInner(questInfo, showItemRewards: false); + } + finally + { + ((IDisposable)val2)?.Dispose(); + } } } + finally + { + ((TooltipDisposable)(ref val)).Dispose(); + } } } } diff --git a/Questionable/Questionable.Windows.QuestComponents/ARealmRebornComponent.cs b/Questionable/Questionable.Windows.QuestComponents/ARealmRebornComponent.cs index b7836a4..67e306c 100644 --- a/Questionable/Questionable.Windows.QuestComponents/ARealmRebornComponent.cs +++ b/Questionable/Questionable.Windows.QuestComponents/ARealmRebornComponent.cs @@ -65,28 +65,39 @@ internal sealed class ARealmRebornComponent private void DrawPrimals() { + //IL_0050: Unknown result type (might be due to invalid IL or missing references) + //IL_0055: Unknown result type (might be due to invalid IL or missing references) bool flag = UIState.IsInstanceContentCompleted(RequiredPrimalInstances.Last()); bool flag2 = _uiUtils.ChecklistItem("Hard Mode Primals", flag, _configuration.Advanced.SkipARealmRebornHardModePrimals ? new System.Numerics.Vector4?(ImGuiColors.DalamudGrey) : ((System.Numerics.Vector4?)null)); if (flag || !flag2) { return; } - using ImRaii.IEndObject endObject = ImRaii.Tooltip(); - if (!(!endObject)) + TooltipDisposable val = ImRaii.Tooltip(); + try { - ushort[] requiredPrimalInstances = RequiredPrimalInstances; - foreach (ushort instanceId in requiredPrimalInstances) + if (((TooltipDisposable)(ref val)).Alive) { - (System.Numerics.Vector4 color, FontAwesomeIcon icon) instanceStyle = UiUtils.GetInstanceStyle(instanceId); - FFXIVClientStructs.FFXIV.Common.Math.Vector4 vector = instanceStyle.color; - FontAwesomeIcon item = instanceStyle.icon; - _uiUtils.ChecklistItem(_territoryData.GetInstanceName(instanceId) ?? "?", vector, item, ImGui.GetStyle().FramePadding.X); + ushort[] requiredPrimalInstances = RequiredPrimalInstances; + foreach (ushort instanceId in requiredPrimalInstances) + { + (System.Numerics.Vector4 color, FontAwesomeIcon icon) instanceStyle = UiUtils.GetInstanceStyle(instanceId); + FFXIVClientStructs.FFXIV.Common.Math.Vector4 vector = instanceStyle.color; + FontAwesomeIcon item = instanceStyle.icon; + _uiUtils.ChecklistItem(_territoryData.GetInstanceName(instanceId) ?? "?", vector, item, ImGui.GetStyle().FramePadding.X); + } } } + finally + { + ((TooltipDisposable)(ref val)).Dispose(); + } } private void DrawAllianceRaids() { + //IL_005e: Unknown result type (might be due to invalid IL or missing references) + //IL_0063: Unknown result type (might be due to invalid IL or missing references) QuestFunctions questFunctions = _questFunctions; IReadOnlyList crystalTowerQuests = QuestData.CrystalTowerQuests; bool flag = questFunctions.IsQuestComplete(crystalTowerQuests[crystalTowerQuests.Count - 1]); @@ -95,17 +106,24 @@ internal sealed class ARealmRebornComponent { return; } - using ImRaii.IEndObject endObject = ImRaii.Tooltip(); - if (!endObject) + TooltipDisposable val = ImRaii.Tooltip(); + try { - return; + if (!((TooltipDisposable)(ref val)).Alive) + { + return; + } + foreach (QuestId crystalTowerQuest in QuestData.CrystalTowerQuests) + { + (System.Numerics.Vector4 Color, FontAwesomeIcon Icon, string Status) questStyle = _uiUtils.GetQuestStyle(crystalTowerQuest); + FFXIVClientStructs.FFXIV.Common.Math.Vector4 vector = questStyle.Color; + FontAwesomeIcon item = questStyle.Icon; + _uiUtils.ChecklistItem(_questData.GetQuestInfo(crystalTowerQuest).Name, vector, item, ImGui.GetStyle().FramePadding.X); + } } - foreach (QuestId crystalTowerQuest in QuestData.CrystalTowerQuests) + finally { - (System.Numerics.Vector4 Color, FontAwesomeIcon Icon, string Status) questStyle = _uiUtils.GetQuestStyle(crystalTowerQuest); - FFXIVClientStructs.FFXIV.Common.Math.Vector4 vector = questStyle.Color; - FontAwesomeIcon item = questStyle.Icon; - _uiUtils.ChecklistItem(_questData.GetQuestInfo(crystalTowerQuest).Name, vector, item, ImGui.GetStyle().FramePadding.X); + ((TooltipDisposable)(ref val)).Dispose(); } } } diff --git a/Questionable/Questionable.Windows.QuestComponents/ActiveQuestComponent.cs b/Questionable/Questionable.Windows.QuestComponents/ActiveQuestComponent.cs index 9848712..340c4c3 100644 --- a/Questionable/Questionable.Windows.QuestComponents/ActiveQuestComponent.cs +++ b/Questionable/Questionable.Windows.QuestComponents/ActiveQuestComponent.cs @@ -61,7 +61,7 @@ internal sealed class ActiveQuestComponent public event EventHandler? Reload; [GeneratedRegex("\\s\\s+", RegexOptions.IgnoreCase, "en-US")] - [GeneratedCode("System.Text.RegularExpressions.Generator", "10.0.14.15411")] + [GeneratedCode("System.Text.RegularExpressions.Generator", "10.0.14.21808")] private static Regex MultipleWhitespaceRegex() { return _003CRegexGenerator_g_003EFBB8301322196CF81C64F1652C2FA6E1D6BF3907141F781E9D97ABED51BF056C4__MultipleWhitespaceRegex_0.Instance; @@ -90,6 +90,8 @@ internal sealed class ActiveQuestComponent public void Draw(bool isMinimized) { + //IL_0150: Unknown result type (might be due to invalid IL or missing references) + //IL_0157: Expected O, but got Unknown if (_fateController.IsRunning) { DrawFateActive(isMinimized); @@ -116,17 +118,27 @@ internal sealed class ActiveQuestComponent string currentTaskState = _questController.CurrentTaskState; if (currentTaskState != null) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange, true); + try { ImGui.TextUnformatted(currentTaskState); } + finally + { + ((IDisposable)val)?.Dispose(); + } } else { - using (ImRaii.Disabled()) + DisabledDisposable val2 = ImRaii.Disabled(); + try { ImGui.TextUnformatted(_questController.DebugState ?? string.Empty); } + finally + { + ((IDisposable)val2)?.Dispose(); + } } } try @@ -135,7 +147,8 @@ internal sealed class ActiveQuestComponent QuestStep questStep = questSequence?.FindStep(questProgress.Step); if (!isMinimized) { - using (ImRaii.Color color = new ImRaii.Color()) + ColorDisposable val3 = new ColorDisposable(); + try { bool flag; if (questStep != null) @@ -152,10 +165,14 @@ internal sealed class ActiveQuestComponent IL_017e: if (flag) { - color.Push(ImGuiCol.Text, ImGuiColors.DalamudOrange); + val3.Push(ImGuiCol.Text, ImGuiColors.DalamudOrange, true); } ImGui.TextUnformatted(questStep?.Comment ?? questSequence?.Comment ?? questProgress.Quest.Root.Comment ?? string.Empty); } + finally + { + ((IDisposable)val3)?.Dispose(); + } ImGui.Text(_questController.ToStatString()); } DrawQuestButtons(questProgress, questStep, questProgressInfo, isMinimized); @@ -191,7 +208,8 @@ internal sealed class ActiveQuestComponent text2.AppendFormatted((item2 == 1) ? string.Empty : "s"); text2.AppendLiteral(" - Leveling mode will start automatically"); ImGui.TextColored(in col, text2); - using (ImRaii.Disabled(_questController.IsRunning || _fateController.IsRunning || _seasonalDutyController.IsRunning || !_autoDutyIpc.IsStopped())) + DisabledDisposable val4 = ImRaii.Disabled(_questController.IsRunning || _fateController.IsRunning || _seasonalDutyController.IsRunning || !_autoDutyIpc.IsStopped()); + try { if (ImGuiComponents.IconButton(FontAwesomeIcon.Play)) { @@ -206,6 +224,10 @@ internal sealed class ActiveQuestComponent } } } + finally + { + ((IDisposable)val4)?.Dispose(); + } if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { if (!_autoDutyIpc.IsStopped()) @@ -262,13 +284,18 @@ internal sealed class ActiveQuestComponent private void DrawFateActive(bool isMinimized) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGold)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGold, true); + try { ImU8String text = new ImU8String(6, 1); text.AppendLiteral("FATE: "); text.AppendFormatted(Shorten(_fateController.CurrentFate.Name)); ImGui.TextUnformatted(text); } + finally + { + ((IDisposable)val)?.Dispose(); + } IList remainingTaskNames = _fateController.GetRemainingTaskNames(); if (remainingTaskNames.Count > 0) { @@ -288,13 +315,18 @@ internal sealed class ActiveQuestComponent private void DrawDutyActive(bool isMinimized) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen, true); + try { ImU8String text = new ImU8String(6, 1); text.AppendLiteral("Duty: "); text.AppendFormatted(Shorten(_seasonalDutyController.CurrentDuty.Name)); ImGui.TextUnformatted(text); } + finally + { + ((IDisposable)val)?.Dispose(); + } IList remainingTaskNames = _seasonalDutyController.GetRemainingTaskNames(); if (remainingTaskNames.Count > 0) { @@ -314,9 +346,14 @@ internal sealed class ActiveQuestComponent private void DrawQuestNames(QuestController.QuestProgress currentQuest, QuestController.ECurrentQuestType? currentQuestType) { + //IL_0709: Unknown result type (might be due to invalid IL or missing references) + //IL_070e: Unknown result type (might be due to invalid IL or missing references) + //IL_03c9: Unknown result type (might be due to invalid IL or missing references) + //IL_03ce: Unknown result type (might be due to invalid IL or missing references) if (currentQuestType == QuestController.ECurrentQuestType.Simulated) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true); + try { ImU8String text = new ImU8String(26, 4); text.AppendLiteral("Simulated Quest: "); @@ -330,10 +367,15 @@ internal sealed class ActiveQuestComponent ImGui.TextUnformatted(text); return; } + finally + { + ((IDisposable)val)?.Dispose(); + } } if (currentQuestType == QuestController.ECurrentQuestType.Gathering) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGold)) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGold, true); + try { ImU8String text2 = new ImU8String(20, 4); text2.AppendLiteral("Gathering: "); @@ -347,6 +389,10 @@ internal sealed class ActiveQuestComponent ImGui.TextUnformatted(text2); return; } + finally + { + ((IDisposable)val2)?.Dispose(); + } } QuestController.QuestProgress startedQuest = _questController.StartedQuest; if (startedQuest != null) @@ -403,91 +449,98 @@ internal sealed class ActiveQuestComponent ImGui.TextColored(in col, SeIconChar.Clock.ToIconString()); if (ImGui.IsItemHovered()) { - using ImRaii.IEndObject endObject = ImRaii.Tooltip(); - if (endObject) + TooltipDisposable val3 = ImRaii.Tooltip(); + try { - ImGui.Text("Stop Conditions:"); - ImGui.Separator(); - if (flag) + if (((TooltipDisposable)(ref val3)).Alive) { - int num2 = _objectTable.LocalPlayer?.Level ?? 0; - ImU8String text4 = new ImU8String(14, 1); - text4.AppendLiteral("Stop at level "); - text4.AppendFormatted(_configuration.Stop.TargetLevel); - ImGui.BulletText(text4); - if (num2 > 0) + ImGui.Text("Stop Conditions:"); + ImGui.Separator(); + if (flag) { + int num2 = _objectTable.LocalPlayer?.Level ?? 0; + ImU8String text4 = new ImU8String(14, 1); + text4.AppendLiteral("Stop at level "); + text4.AppendFormatted(_configuration.Stop.TargetLevel); + ImGui.BulletText(text4); + if (num2 > 0) + { + ImGui.SameLine(); + if (num2 >= _configuration.Stop.TargetLevel) + { + Vector4 col2 = ImGuiColors.ParsedGreen; + ImU8String text5 = new ImU8String(22, 1); + text5.AppendLiteral("(Current: "); + text5.AppendFormatted(num2); + text5.AppendLiteral(" - Reached!)"); + ImGui.TextColored(in col2, text5); + } + else + { + Vector4 col2 = ImGuiColors.ParsedBlue; + ImU8String text6 = new ImU8String(11, 1); + text6.AppendLiteral("(Current: "); + text6.AppendFormatted(num2); + text6.AppendLiteral(")"); + ImGui.TextColored(in col2, text6); + } + } + } + if (flag3) + { + if (flag) + { + ImGui.Spacing(); + } + int sequence = startedQuest.Sequence; + ImU8String text7 = new ImU8String(23, 1); + text7.AppendLiteral("Stop at quest sequence "); + text7.AppendFormatted(_configuration.Stop.TargetSequence); + ImGui.BulletText(text7); ImGui.SameLine(); - if (num2 >= _configuration.Stop.TargetLevel) + if (sequence >= _configuration.Stop.TargetSequence) { Vector4 col2 = ImGuiColors.ParsedGreen; - ImU8String text5 = new ImU8String(22, 1); - text5.AppendLiteral("(Current: "); - text5.AppendFormatted(num2); - text5.AppendLiteral(" - Reached!)"); - ImGui.TextColored(in col2, text5); + ImU8String text8 = new ImU8String(22, 1); + text8.AppendLiteral("(Current: "); + text8.AppendFormatted(sequence); + text8.AppendLiteral(" - Reached!)"); + ImGui.TextColored(in col2, text8); } else { Vector4 col2 = ImGuiColors.ParsedBlue; - ImU8String text6 = new ImU8String(11, 1); - text6.AppendLiteral("(Current: "); - text6.AppendFormatted(num2); - text6.AppendLiteral(")"); - ImGui.TextColored(in col2, text6); + ImU8String text9 = new ImU8String(11, 1); + text9.AppendLiteral("(Current: "); + text9.AppendFormatted(sequence); + text9.AppendLiteral(")"); + ImGui.TextColored(in col2, text9); } } - } - if (flag3) - { - if (flag) + if (flag2) { - ImGui.Spacing(); - } - int sequence = startedQuest.Sequence; - ImU8String text7 = new ImU8String(23, 1); - text7.AppendLiteral("Stop at quest sequence "); - text7.AppendFormatted(_configuration.Stop.TargetSequence); - ImGui.BulletText(text7); - ImGui.SameLine(); - if (sequence >= _configuration.Stop.TargetSequence) - { - Vector4 col2 = ImGuiColors.ParsedGreen; - ImU8String text8 = new ImU8String(22, 1); - text8.AppendLiteral("(Current: "); - text8.AppendFormatted(sequence); - text8.AppendLiteral(" - Reached!)"); - ImGui.TextColored(in col2, text8); - } - else - { - Vector4 col2 = ImGuiColors.ParsedBlue; - ImU8String text9 = new ImU8String(11, 1); - text9.AppendLiteral("(Current: "); - text9.AppendFormatted(sequence); - text9.AppendLiteral(")"); - ImGui.TextColored(in col2, text9); - } - } - if (flag2) - { - if (flag || flag3) - { - ImGui.Spacing(); - } - ImGui.BulletText("Stop after completing any of these quests:"); - ImGui.Indent(); - foreach (ElementId item in _configuration.Stop.QuestsToStopAfter) - { - if (_questRegistry.TryGetQuest(item, out Quest quest)) + if (flag || flag3) { - var (color, icon, _) = _uiUtils.GetQuestStyle(item); - _uiUtils.ChecklistItem($"{quest.Info.Name} ({item})", color, icon); + ImGui.Spacing(); } + ImGui.BulletText("Stop after completing any of these quests:"); + ImGui.Indent(); + foreach (ElementId item in _configuration.Stop.QuestsToStopAfter) + { + if (_questRegistry.TryGetQuest(item, out Quest quest)) + { + var (color, icon, _) = _uiUtils.GetQuestStyle(item); + _uiUtils.ChecklistItem($"{quest.Info.Name} ({item})", color, icon); + } + } + ImGui.Unindent(); } - ImGui.Unindent(); } } + finally + { + ((TooltipDisposable)(ref val3)).Dispose(); + } } } if (_configuration.Advanced.AdditionalStatusInformation && _questController.IsInterruptible()) @@ -496,65 +549,73 @@ internal sealed class ActiveQuestComponent ImGui.TextColored(ImGuiColors.DalamudYellow, SeIconChar.Hyadelyn.ToIconString()); if (ImGui.IsItemHovered()) { - using ImRaii.IEndObject endObject2 = ImRaii.Tooltip(); - if (endObject2) + TooltipDisposable val4 = ImRaii.Tooltip(); + try { - ImGui.Text("This quest sequence starts with a teleport to an Aetheryte."); - ImGui.Text("Certain priority quest (e.g. class quests) may be started/completed by the plugin prior to continuing with this quest."); - ImGui.Separator(); - ImGui.Text("Available priority quests:"); - List nextPriorityQuestsThatCanBeAccepted = _questFunctions.GetNextPriorityQuestsThatCanBeAccepted(); - List list = (from x in nextPriorityQuestsThatCanBeAccepted - where x.IsAvailable - select x.QuestId).ToList(); - if (list.Count > 0) + if (((TooltipDisposable)(ref val4)).Alive) { - foreach (ElementId item2 in list) + ImGui.Text("This quest sequence starts with a teleport to an Aetheryte."); + ImGui.Text("Certain priority quest (e.g. class quests) may be started/completed by the plugin prior to continuing with this quest."); + ImGui.Separator(); + ImGui.Text("Available priority quests:"); + List nextPriorityQuestsThatCanBeAccepted = _questFunctions.GetNextPriorityQuestsThatCanBeAccepted(); + List list = (from x in nextPriorityQuestsThatCanBeAccepted + where x.IsAvailable + select x.QuestId).ToList(); + if (list.Count > 0) { - if (_questRegistry.TryGetQuest(item2, out Quest quest2)) + foreach (ElementId item2 in list) { - ImU8String text10 = new ImU8String(3, 2); - text10.AppendFormatted(quest2.Info.Name); - text10.AppendLiteral(" ("); - text10.AppendFormatted(item2); - text10.AppendLiteral(")"); - ImGui.BulletText(text10); + if (_questRegistry.TryGetQuest(item2, out Quest quest2)) + { + ImU8String text10 = new ImU8String(3, 2); + text10.AppendFormatted(quest2.Info.Name); + text10.AppendLiteral(" ("); + text10.AppendFormatted(item2); + text10.AppendLiteral(")"); + ImGui.BulletText(text10); + } } } - } - else - { - ImGui.BulletText("(none)"); - } - if (_configuration.Advanced.AdditionalStatusInformation) - { - List list2 = nextPriorityQuestsThatCanBeAccepted.Where((PriorityQuestInfo x) => !x.IsAvailable).ToList(); - if (list2.Count > 0) + else { - ImGui.Text("Unavailable priority quests:"); - foreach (var (elementId2, value) in list2) + ImGui.BulletText("(none)"); + } + if (_configuration.Advanced.AdditionalStatusInformation) + { + List list2 = nextPriorityQuestsThatCanBeAccepted.Where((PriorityQuestInfo x) => !x.IsAvailable).ToList(); + if (list2.Count > 0) { - if (_questRegistry.TryGetQuest(elementId2, out Quest quest3)) + ImGui.Text("Unavailable priority quests:"); + foreach (var (elementId2, value) in list2) { - ImU8String text12 = new ImU8String(6, 3); - text12.AppendFormatted(quest3.Info.Name); - text12.AppendLiteral(" ("); - text12.AppendFormatted(elementId2); - text12.AppendLiteral(") - "); - text12.AppendFormatted(value); - ImGui.BulletText(text12); + if (_questRegistry.TryGetQuest(elementId2, out Quest quest3)) + { + ImU8String text12 = new ImU8String(6, 3); + text12.AppendFormatted(quest3.Info.Name); + text12.AppendLiteral(" ("); + text12.AppendFormatted(elementId2); + text12.AppendLiteral(") - "); + text12.AppendFormatted(value); + ImGui.BulletText(text12); + } } } } } } + finally + { + ((TooltipDisposable)(ref val4)).Dispose(); + } } } } QuestController.QuestProgress nextQuest = _questController.NextQuest; if (nextQuest != null) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow)) + ColorDisposable val5 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow, true); + try { ImU8String text13 = new ImU8String(21, 4); text13.AppendLiteral("Next Quest: "); @@ -567,6 +628,10 @@ internal sealed class ActiveQuestComponent text13.AppendFormatted(nextQuest.Step); ImGui.TextUnformatted(text13); } + finally + { + ((IDisposable)val5)?.Dispose(); + } } } @@ -580,8 +645,9 @@ internal sealed class ActiveQuestComponent return questProgressInfo; } Vector4* styleColorVec = ImGui.GetStyleColorVec4(ImGuiCol.TextDisabled); - Vector4 color = ((styleColorVec == null) ? ImGuiColors.ParsedOrange : (*styleColorVec)); - using (ImRaii.PushColor(ImGuiCol.Text, color)) + Vector4 vector = ((styleColorVec == null) ? ImGuiColors.ParsedOrange : (*styleColorVec)); + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, vector, true); + try { ImU8String text = new ImU8String(0, 1); text.AppendFormatted(questProgressInfo); @@ -608,10 +674,15 @@ internal sealed class ActiveQuestComponent ImGui.Text(text3); } } + finally + { + ((IDisposable)val)?.Dispose(); + } } else if (currentQuest.Quest.Id is QuestId) { - using (ImRaii.Disabled()) + DisabledDisposable val2 = ImRaii.Disabled(); + try { if (currentQuest.Quest.Id == _questController.NextQuest?.Quest.Id) { @@ -622,13 +693,18 @@ internal sealed class ActiveQuestComponent ImGui.TextUnformatted("(Not accepted)"); } } + finally + { + ((IDisposable)val2)?.Dispose(); + } } return questProgressInfo; } private void DrawQuestButtons(QuestController.QuestProgress currentQuest, QuestStep? currentStep, QuestProgressInfo? questProgressInfo, bool isMinimized) { - using (ImRaii.Disabled(_questController.IsRunning || _fateController.IsRunning || _seasonalDutyController.IsRunning)) + DisabledDisposable val = ImRaii.Disabled(_questController.IsRunning || _fateController.IsRunning || _seasonalDutyController.IsRunning); + try { if (ImGuiComponents.IconButton(FontAwesomeIcon.Play)) { @@ -647,6 +723,10 @@ internal sealed class ActiveQuestComponent } } } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.SameLine(); if (ImGuiComponents.IconButton(FontAwesomeIcon.Stop)) { @@ -666,10 +746,12 @@ internal sealed class ActiveQuestComponent } bool flag = currentStep == currentQuest.Quest.FindSequence(currentQuest.Sequence)?.Steps.LastOrDefault(); WaitAtEnd.WaitNextStepOrSequence task; - bool condition = currentStep != null && !flag && currentStep.InteractionType == EInteractionType.Instruction && _questController.HasCurrentTaskMatching(out task); - using (ImRaii.Disabled(flag)) + bool flag2 = currentStep != null && !flag && currentStep.InteractionType == EInteractionType.Instruction && _questController.HasCurrentTaskMatching(out task); + val = ImRaii.Disabled(flag); + try { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen, condition)) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen, flag2); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.ArrowCircleRight, "Skip")) { @@ -681,6 +763,14 @@ internal sealed class ActiveQuestComponent ImGui.SetTooltip("Skip the current step of the quest path."); } } + finally + { + ((IDisposable)val2)?.Dispose(); + } + } + finally + { + ((IDisposable)val)?.Dispose(); } if (_commandManager.Commands.ContainsKey("/questinfo")) { @@ -739,7 +829,8 @@ internal sealed class ActiveQuestComponent { return; } - using (ImRaii.PushId("SimulatedStep")) + IdDisposable val = ImRaii.PushId((ImU8String)"SimulatedStep", true); + try { ImU8String text2 = new ImU8String(9, 2); text2.AppendLiteral("Step: "); @@ -776,6 +867,10 @@ internal sealed class ActiveQuestComponent _questController.Stop("ClearSim"); } } + finally + { + ((IDisposable)val)?.Dispose(); + } } private static string Shorten(string text) diff --git a/Questionable/Questionable.Windows.QuestComponents/EventInfoComponent.cs b/Questionable/Questionable.Windows.QuestComponents/EventInfoComponent.cs index a79c19d..09f3b4c 100644 --- a/Questionable/Questionable.Windows.QuestComponents/EventInfoComponent.cs +++ b/Questionable/Questionable.Windows.QuestComponents/EventInfoComponent.cs @@ -171,10 +171,11 @@ internal sealed class EventInfoComponent { continue; } - ImU8String id = new ImU8String(21, 1); - id.AppendLiteral("##EventQuestSelection"); - id.AppendFormatted(questId); - using (ImRaii.PushId(id)) + ImU8String imU8String = new ImU8String(21, 1); + imU8String.AppendLiteral("##EventQuestSelection"); + imU8String.AppendFormatted(questId); + IdDisposable val = ImRaii.PushId(imU8String, true); + try { string name = _questData.GetQuestInfo(questId).Name; if (list.Contains(questId) && _questRegistry.TryGetQuest(questId, out Questionable.Model.Quest quest)) @@ -203,6 +204,10 @@ internal sealed class EventInfoComponent } } } + finally + { + ((IDisposable)val)?.Dispose(); + } } } diff --git a/Questionable/Questionable.Windows.QuestComponents/ManualPriorityComponent.cs b/Questionable/Questionable.Windows.QuestComponents/ManualPriorityComponent.cs index 6f7bf1c..dbbe752 100644 --- a/Questionable/Questionable.Windows.QuestComponents/ManualPriorityComponent.cs +++ b/Questionable/Questionable.Windows.QuestComponents/ManualPriorityComponent.cs @@ -57,6 +57,9 @@ internal sealed class ManualPriorityComponent public void Draw() { + //IL_00ab: 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_00b1: Unknown result type (might be due to invalid IL or missing references) ImGui.TextWrapped("When you have an active Main Scenario Quest, Questionable will prioritise quests in this order:"); ImGui.BulletText("Priority quests: class quests, A Realm Reborn primals and raids"); ImGui.BulletText("Supported quests from your Journal's To-Do list (always visible on-screen quests)"); @@ -70,23 +73,34 @@ internal sealed class ManualPriorityComponent { ImGui.Text("Priority queue (drag arrow buttons to reorder):"); } - using (ImRaii.IEndObject endObject = ImRaii.Child("ManualPriorityList", new Vector2(-1f, -27f), border: true)) + ChildDisposable val = ImRaii.Child((ImU8String)"ManualPriorityList", new Vector2(-1f, -27f), true); + try { - if (endObject) + if (ChildDisposable.op_Implicit(val)) { DrawQuestList(); } } + finally + { + ((ChildDisposable)(ref val)).Dispose(); + } List list = ParseClipboardItems(); - using (ImRaii.Disabled(list.Count == 0)) + DisabledDisposable val2 = ImRaii.Disabled(list.Count == 0); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Download, "Import from Clipboard")) { ImportFromClipboard(list); } } + finally + { + ((IDisposable)val2)?.Dispose(); + } ImGui.SameLine(); - using (ImRaii.Disabled(_questController.ManualPriorityQuests.Count == 0)) + val2 = ImRaii.Disabled(_questController.ManualPriorityQuests.Count == 0); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Upload, "Export to Clipboard")) { @@ -98,18 +112,27 @@ internal sealed class ManualPriorityComponent _questController.SavePriorityQuests(); } ImGui.SameLine(); - using (ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl))) + DisabledDisposable val3 = ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl)); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All")) { _questController.ClearQuestPriority(); } } + finally + { + ((IDisposable)val3)?.Dispose(); + } if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { ImGui.SetTooltip("Hold CTRL to enable this button."); } } + finally + { + ((IDisposable)val2)?.Dispose(); + } } private void DrawQuestList() @@ -131,10 +154,11 @@ internal sealed class ManualPriorityComponent { Vector2 item = ImGui.GetCursorScreenPos() + new Vector2(0f, (0f - ImGui.GetStyle().ItemSpacing.Y) / 2f); Quest quest3 = manualPriorityQuests[i]; - ImU8String id = new ImU8String(5, 1); - id.AppendLiteral("Quest"); - id.AppendFormatted(quest3.Id); - using (ImRaii.PushId(id)) + ImU8String imU8String = new ImU8String(5, 1); + imU8String.AppendLiteral("Quest"); + imU8String.AppendFormatted(quest3.Id); + IdDisposable val = ImRaii.PushId(imU8String, true); + try { ImGui.AlignTextToFramePadding(); ImU8String text = new ImU8String(1, 1); @@ -160,10 +184,15 @@ internal sealed class ManualPriorityComponent } if (manualPriorityQuests.Count > 1) { - using (ImRaii.PushFont(UiBuilder.IconFont)) + FontDisposable val2 = ImRaii.PushFont(UiBuilder.IconFont, true); + try { ImGui.SameLine(ImGui.GetContentRegionAvail().X + ImGui.GetStyle().WindowPadding.X - ImGui.CalcTextSize(FontAwesomeIcon.ArrowsUpDown.ToIconString()).X - ImGui.CalcTextSize(FontAwesomeIcon.Times.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 4f - ImGui.GetStyle().ItemSpacing.X); } + finally + { + ((IDisposable)val2)?.Dispose(); + } if (_draggedItem == quest3.Id) { ImGuiComponents.IconButton("##Move", FontAwesomeIcon.ArrowsUpDown, ImGui.ColorConvertU32ToFloat4(ImGui.GetColorU32(ImGuiCol.ButtonActive))); @@ -180,16 +209,25 @@ internal sealed class ManualPriorityComponent } else { - using (ImRaii.PushFont(UiBuilder.IconFont)) + FontDisposable val2 = ImRaii.PushFont(UiBuilder.IconFont, true); + try { ImGui.SameLine(ImGui.GetContentRegionAvail().X + ImGui.GetStyle().WindowPadding.X - ImGui.CalcTextSize(FontAwesomeIcon.Times.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 2f); } + finally + { + ((IDisposable)val2)?.Dispose(); + } } if (ImGuiComponents.IconButton($"##Remove{i}", FontAwesomeIcon.Times)) { quest = quest3; } } + finally + { + ((IDisposable)val)?.Dispose(); + } Vector2 item2 = new Vector2(item.X + x, ImGui.GetCursorScreenPos().Y - ImGui.GetStyle().ItemSpacing.Y + 2f); list.Add((item, item2)); } diff --git a/Questionable/Questionable.Windows.QuestComponents/PresetBuilderComponent.cs b/Questionable/Questionable.Windows.QuestComponents/PresetBuilderComponent.cs index f52f5fe..4b047c5 100644 --- a/Questionable/Questionable.Windows.QuestComponents/PresetBuilderComponent.cs +++ b/Questionable/Questionable.Windows.QuestComponents/PresetBuilderComponent.cs @@ -77,25 +77,38 @@ internal sealed class PresetBuilderComponent public void Draw() { + //IL_002e: Unknown result type (might be due to invalid IL or missing references) + //IL_0033: Unknown result type (might be due to invalid IL or missing references) + //IL_0034: Unknown result type (might be due to invalid IL or missing references) ImGui.TextWrapped("Quest presets allow you to quickly add related quests to your priority list. These are useful for unlocking content that may be required later."); ImGui.Spacing(); - using (ImRaii.IEndObject endObject = ImRaii.Child("PresetList", new Vector2(-1f, -27f), border: true)) + ChildDisposable val = ImRaii.Child((ImU8String)"PresetList", new Vector2(-1f, -27f), true); + try { - if (endObject) + if (ChildDisposable.op_Implicit(val)) { DrawPresetGroups(); } } + finally + { + ((ChildDisposable)(ref val)).Dispose(); + } List list = (from questId in GetAllPresetQuests() where _questController.ManualPriorityQuests.Any((Quest q) => q.Id.Equals(questId)) select questId).ToList(); - using (ImRaii.Disabled(list.Count == 0)) + DisabledDisposable val2 = ImRaii.Disabled(list.Count == 0); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, $"Clear All Preset Quests ({list.Count})")) { ClearAllPresetQuests(list); } } + finally + { + ((IDisposable)val2)?.Dispose(); + } if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { if (list.Count == 0) @@ -131,7 +144,8 @@ internal sealed class PresetBuilderComponent QuestPreset value; if (DrawGroupHeader("Aether Currents", "Unlock aether currents in various expansion zones to enable flying.", orderedEnumerable)) { - using (ImRaii.PushIndent()) + IndentDisposable val = ImRaii.PushIndent(1, true); + try { foreach (KeyValuePair item in orderedEnumerable) { @@ -141,10 +155,15 @@ internal sealed class PresetBuilderComponent DrawPreset(key2, preset); } } + finally + { + ((IDisposable)val)?.Dispose(); + } } if (DrawGroupHeader("City Aethernet", "Unlock aethernet shards in major cities to enable city teleports.", orderedEnumerable2)) { - using (ImRaii.PushIndent()) + IndentDisposable val2 = ImRaii.PushIndent(1, true); + try { foreach (KeyValuePair item2 in orderedEnumerable2) { @@ -154,12 +173,17 @@ internal sealed class PresetBuilderComponent DrawPreset(key3, preset2); } } + finally + { + ((IDisposable)val2)?.Dispose(); + } } if (!orderedEnumerable3.Any() || !DrawGroupHeader("Content Unlocks", "Essential quest series and unlocks that may be required for progression.", orderedEnumerable3)) { return; } - using (ImRaii.PushIndent()) + IndentDisposable val3 = ImRaii.PushIndent(1, true); + try { foreach (KeyValuePair item3 in orderedEnumerable3) { @@ -169,6 +193,10 @@ internal sealed class PresetBuilderComponent DrawPreset(key4, preset3); } } + finally + { + ((IDisposable)val3)?.Dispose(); + } } private bool DrawGroupHeader(string groupName, string groupDescription, IEnumerable> presets) @@ -221,7 +249,8 @@ internal sealed class PresetBuilderComponent private void DrawPreset(string key, QuestPreset preset) { - using (ImRaii.PushId(key)) + IdDisposable val = ImRaii.PushId((ImU8String)key, true); + try { List availableQuestsForPreset = GetAvailableQuestsForPreset(preset); List completedQuestsForPreset = GetCompletedQuestsForPreset(preset); @@ -262,7 +291,8 @@ internal sealed class PresetBuilderComponent { return; } - using (ImRaii.PushIndent()) + IndentDisposable val2 = ImRaii.PushIndent(1, true); + try { ImGui.TextWrapped(preset.Description); ImGui.Spacing(); @@ -362,6 +392,14 @@ internal sealed class PresetBuilderComponent _uiUtils.ChecklistItem("No applicable quests found", ImGuiColors.DalamudGrey, FontAwesomeIcon.Minus); goto IL_03d8; } + finally + { + ((IDisposable)val2)?.Dispose(); + } + } + finally + { + ((IDisposable)val)?.Dispose(); } } diff --git a/Questionable/Questionable.Windows.QuestComponents/QuestSequenceComponent.cs b/Questionable/Questionable.Windows.QuestComponents/QuestSequenceComponent.cs index b28c9a8..669224d 100644 --- a/Questionable/Questionable.Windows.QuestComponents/QuestSequenceComponent.cs +++ b/Questionable/Questionable.Windows.QuestComponents/QuestSequenceComponent.cs @@ -62,18 +62,33 @@ internal sealed class QuestSequenceComponent ImGui.TextColored(new Vector4(0.98f, 0.98f, 1f, 1f), "Quest Sequence Viewer"); ImGui.SameLine(x - 35f); ImGui.SetCursorPosY(ImGui.GetCursorPosY() - num2 + ImGui.GetStyle().ItemSpacing.Y); - using (ImRaii.PushColor(ImGuiCol.Button, Vector4.Zero)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Button, Vector4.Zero, true); + try { - using (ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.8f, 0.3f, 0.3f, 0.4f))) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.8f, 0.3f, 0.3f, 0.4f), true); + try { - using (ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.9f, 0.2f, 0.2f, 0.6f))) + ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.9f, 0.2f, 0.2f, 0.6f), true); + try { if (ImGuiComponents.IconButton(FontAwesomeIcon.Times)) { isOpen = false; } } + finally + { + ((IDisposable)val3)?.Dispose(); + } } + finally + { + ((IDisposable)val2)?.Dispose(); + } + } + finally + { + ((IDisposable)val)?.Dispose(); } ImGui.SetCursorPosY(cursorScreenPos.Y + num - ImGui.GetCursorScreenPos().Y + ImGui.GetCursorPosY()); } @@ -131,29 +146,40 @@ internal sealed class QuestSequenceComponent windowDrawList.AddRect(cursorScreenPos, cursorScreenPos + new Vector2(x, y), ImGui.ColorConvertFloat4ToU32(new Vector4(0.6f, 0.5f, 0.8f, 0.2f)), 4f, ImDrawFlags.None, 1f); ImGui.SetCursorPosY(ImGui.GetCursorPosY() + ImGui.GetStyle().ItemSpacing.Y * 1.5f); ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 10f); - using (ImRaii.PushFont(UiBuilder.IconFont)) + FontDisposable val = ImRaii.PushFont(UiBuilder.IconFont, true); + try { ImGui.TextColored(new Vector4(0.7f, 0.6f, 0.9f, 1f), FontAwesomeIcon.Search.ToIconString()); } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.SameLine(); float x2 = ImGui.GetStyle().ItemSpacing.X; float num = 10f; float num2 = 10f; float num3 = ImGui.CalcTextSize("Search").X + ImGui.CalcTextSize(FontAwesomeIcon.Search.ToIconString()).X + ImGui.GetStyle().FramePadding.X * 4f + x2; ImGui.SetNextItemWidth(x - num3 - x2 * 3f - num - num2); - using (ImRaii.PushColor(ImGuiCol.FrameBg, new Vector4(0.08f, 0.06f, 0.12f, 0.8f))) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.FrameBg, new Vector4(0.08f, 0.06f, 0.12f, 0.8f), true); + try { - using (ImRaii.PushColor(ImGuiCol.FrameBgHovered, new Vector4(0.12f, 0.1f, 0.18f, 0.9f))) + ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.FrameBgHovered, new Vector4(0.12f, 0.1f, 0.18f, 0.9f), true); + try { - using (ImRaii.PushColor(ImGuiCol.FrameBgActive, new Vector4(0.15f, 0.13f, 0.22f, 1f))) + ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.FrameBgActive, new Vector4(0.15f, 0.13f, 0.22f, 1f), true); + try { bool flag = ImGui.InputTextWithHint("##QuestLookup", "Enter quest ID...", ref _questLookupInput, 10, ImGuiInputTextFlags.EnterReturnsTrue); ImGui.SameLine(); - using (ImRaii.PushColor(ImGuiCol.Button, new Vector4(0.25f, 0.22f, 0.32f, 0.8f))) + ColorDisposable val5 = ImRaii.PushColor(ImGuiCol.Button, new Vector4(0.25f, 0.22f, 0.32f, 0.8f), true); + try { - using (ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.35f, 0.3f, 0.45f, 0.9f))) + ColorDisposable val6 = ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.35f, 0.3f, 0.45f, 0.9f), true); + try { - using (ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.4f, 0.35f, 0.5f, 1f))) + ColorDisposable val7 = ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.4f, 0.35f, 0.5f, 1f), true); + try { bool flag2 = ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Search, "Search"); if (flag || flag2) @@ -168,10 +194,34 @@ internal sealed class QuestSequenceComponent } } } + finally + { + ((IDisposable)val7)?.Dispose(); + } + } + finally + { + ((IDisposable)val6)?.Dispose(); } } + finally + { + ((IDisposable)val5)?.Dispose(); + } + } + finally + { + ((IDisposable)val4)?.Dispose(); } } + finally + { + ((IDisposable)val3)?.Dispose(); + } + } + finally + { + ((IDisposable)val2)?.Dispose(); } ImGui.SetCursorPosY(ImGui.GetCursorPosY() + ImGui.GetStyle().ItemSpacing.Y * 1.5f); ImGui.Spacing(); @@ -255,11 +305,14 @@ internal sealed class QuestSequenceComponent 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))) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Button, new Vector4(0.18f, 0.16f, 0.22f, 0.8f), true); + try { - using (ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.28f, 0.24f, 0.32f, 0.95f))) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.28f, 0.24f, 0.32f, 0.95f), true); + try { - using (ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.35f, 0.3f, 0.45f, 1f))) + ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.35f, 0.3f, 0.45f, 1f), true); + try { if (ImGuiComponents.IconButton(FontAwesomeIcon.Copy)) { @@ -270,7 +323,19 @@ internal sealed class QuestSequenceComponent ImGui.SetTooltip("Copies filename as QuestID_QuestNameWithSpaces.json"); } } + finally + { + ((IDisposable)val3)?.Dispose(); + } } + finally + { + ((IDisposable)val2)?.Dispose(); + } + } + finally + { + ((IDisposable)val)?.Dispose(); } if (currentSequence.HasValue) { @@ -366,95 +431,115 @@ internal sealed class QuestSequenceComponent private static void DrawSummaryCards(int totalSequences, int maxSeq, bool hasQuestPath, float coverage, Vector4 coverageColor, int implementedCount, int expectedCount) { - using ImRaii.IEndObject endObject = ImRaii.Table("SummaryCards", 2, ImGuiTableFlags.None); - if (!endObject) + //IL_0046: Unknown result type (might be due to invalid IL or missing references) + //IL_004b: Unknown result type (might be due to invalid IL or missing references) + //IL_004c: Unknown result type (might be due to invalid IL or missing references) + TableDisposable val = ImRaii.Table((ImU8String)"SummaryCards", 2, ImGuiTableFlags.None); + try { - return; - } - ImGui.TableSetupColumn("GameData", ImGuiTableColumnFlags.WidthStretch, 0.4f); - ImGui.TableSetupColumn("QuestPath", ImGuiTableColumnFlags.WidthStretch, 0.6f); - ImGui.TableNextRow(); - ImGui.TableNextColumn(); - DrawCard(80f, new Vector4(0.6f, 0.85f, 1f, 1f), FontAwesomeIcon.Gamepad, "Expected Sequences", delegate - { - ImGui.Spacing(); - ImGui.Indent(10f); - Vector4 col = new Vector4(0.9f, 0.9f, 0.98f, 1f); - ImU8String text = new ImU8String(6, 0); - text.AppendLiteral("Count:"); - ImGui.TextColored(in col, text); - ImGui.SameLine(); - col = new Vector4(0.7f, 0.9f, 1f, 1f); - ImU8String text2 = new ImU8String(0, 1); - text2.AppendFormatted(totalSequences); - ImGui.TextColored(in col, text2); - ImGui.Spacing(); - col = new Vector4(0.9f, 0.9f, 0.98f, 1f); - ImU8String text3 = new ImU8String(6, 0); - text3.AppendLiteral("Range:"); - ImGui.TextColored(in col, text3); - ImGui.SameLine(); - col = new Vector4(0.7f, 0.9f, 1f, 1f); - ImU8String text4 = new ImU8String(9, 1); - text4.AppendLiteral("0 → "); - text4.AppendFormatted(maxSeq); - text4.AppendLiteral(", 255"); - ImGui.TextColored(in col, text4); - ImGui.Unindent(10f); - }); - ImGui.TableNextColumn(); - DrawCard(80f, new Vector4(0.5f, 1f, 0.6f, 1f), FontAwesomeIcon.Code, "Implementation Status", delegate - { - if (hasQuestPath) + if (!val) { + return; + } + ImGui.TableSetupColumn("GameData", ImGuiTableColumnFlags.WidthStretch, 0.4f); + ImGui.TableSetupColumn("QuestPath", ImGuiTableColumnFlags.WidthStretch, 0.6f); + ImGui.TableNextRow(); + ImGui.TableNextColumn(); + DrawCard(80f, new Vector4(0.6f, 0.85f, 1f, 1f), FontAwesomeIcon.Gamepad, "Expected Sequences", delegate + { + ImGui.Spacing(); ImGui.Indent(10f); - ImGui.TextColored(new Vector4(0.9f, 0.9f, 0.98f, 1f), "Progress:"); - ImGui.SameLine(); - ref Vector4 col = ref coverageColor; - ImU8String text = new ImU8String(0, 1); - text.AppendFormatted(implementedCount); + Vector4 col = new Vector4(0.9f, 0.9f, 0.98f, 1f); + ImU8String text = new ImU8String(6, 0); + text.AppendLiteral("Count:"); ImGui.TextColored(in col, text); ImGui.SameLine(); - ImGui.TextColored(new Vector4(0.7f, 0.7f, 0.8f, 1f), "/"); - ImGui.SameLine(); - Vector4 col2 = new Vector4(0.9f, 0.9f, 0.98f, 1f); + col = new Vector4(0.7f, 0.9f, 1f, 1f); ImU8String text2 = new ImU8String(0, 1); - text2.AppendFormatted(expectedCount); - ImGui.TextColored(in col2, text2); - ImGui.SameLine(); - ref Vector4 col3 = ref coverageColor; - ImU8String text3 = new ImU8String(3, 1); - text3.AppendLiteral("("); - text3.AppendFormatted(coverage, "F0"); - text3.AppendLiteral("%)"); - ImGui.TextColored(in col3, text3); + text2.AppendFormatted(totalSequences); + ImGui.TextColored(in col, text2); ImGui.Spacing(); - Vector2 cursorScreenPos = ImGui.GetCursorScreenPos(); - float x = ImGui.GetContentRegionAvail().X - 10f; - using (ImRaii.PushColor(ImGuiCol.PlotHistogram, coverageColor)) - { - using (ImRaii.PushColor(ImGuiCol.FrameBg, new Vector4(0.08f, 0.06f, 0.12f, 0.8f))) - { - ImGui.ProgressBar(coverage / 100f, new Vector2(x, 16f), ""); - } - } - ImGui.GetWindowDrawList().AddRect(cursorScreenPos, cursorScreenPos + new Vector2(x, 16f), ImGui.ColorConvertFloat4ToU32(new Vector4(0.6f, 0.5f, 0.8f, 0.3f)), 2f); + col = new Vector4(0.9f, 0.9f, 0.98f, 1f); + ImU8String text3 = new ImU8String(6, 0); + text3.AppendLiteral("Range:"); + ImGui.TextColored(in col, text3); + ImGui.SameLine(); + col = new Vector4(0.7f, 0.9f, 1f, 1f); + ImU8String text4 = new ImU8String(9, 1); + text4.AppendLiteral("0 → "); + text4.AppendFormatted(maxSeq); + text4.AppendLiteral(", 255"); + ImGui.TextColored(in col, text4); ImGui.Unindent(10f); - } - else + }); + ImGui.TableNextColumn(); + DrawCard(80f, new Vector4(0.5f, 1f, 0.6f, 1f), FontAwesomeIcon.Code, "Implementation Status", delegate { - ImGui.Spacing(); - ImGui.Indent(10f); - ImGui.PushFont(UiBuilder.IconFont); - ImGui.TextColored(new Vector4(0.6f, 0.5f, 0.8f, 0.8f), FontAwesomeIcon.Ban.ToIconString()); - ImGui.PopFont(); - ImGui.SameLine(); - ImGui.TextColored(new Vector4(0.6f, 0.5f, 0.8f, 0.8f), "Not Implemented"); - ImGui.Spacing(); - ImGui.TextColored(new Vector4(0.7f, 0.7f, 0.8f, 1f), "No quest path data available"); - ImGui.Unindent(10f); - } - }); + if (hasQuestPath) + { + ImGui.Indent(10f); + ImGui.TextColored(new Vector4(0.9f, 0.9f, 0.98f, 1f), "Progress:"); + ImGui.SameLine(); + ref Vector4 col = ref coverageColor; + ImU8String text = new ImU8String(0, 1); + text.AppendFormatted(implementedCount); + ImGui.TextColored(in col, text); + ImGui.SameLine(); + ImGui.TextColored(new Vector4(0.7f, 0.7f, 0.8f, 1f), "/"); + ImGui.SameLine(); + Vector4 col2 = new Vector4(0.9f, 0.9f, 0.98f, 1f); + ImU8String text2 = new ImU8String(0, 1); + text2.AppendFormatted(expectedCount); + ImGui.TextColored(in col2, text2); + ImGui.SameLine(); + ref Vector4 col3 = ref coverageColor; + ImU8String text3 = new ImU8String(3, 1); + text3.AppendLiteral("("); + text3.AppendFormatted(coverage, "F0"); + text3.AppendLiteral("%)"); + ImGui.TextColored(in col3, text3); + ImGui.Spacing(); + Vector2 cursorScreenPos = ImGui.GetCursorScreenPos(); + float x = ImGui.GetContentRegionAvail().X - 10f; + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.PlotHistogram, coverageColor, true); + try + { + ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.FrameBg, new Vector4(0.08f, 0.06f, 0.12f, 0.8f), true); + try + { + ImGui.ProgressBar(coverage / 100f, new Vector2(x, 16f), ""); + } + finally + { + ((IDisposable)val3)?.Dispose(); + } + } + finally + { + ((IDisposable)val2)?.Dispose(); + } + ImGui.GetWindowDrawList().AddRect(cursorScreenPos, cursorScreenPos + new Vector2(x, 16f), ImGui.ColorConvertFloat4ToU32(new Vector4(0.6f, 0.5f, 0.8f, 0.3f)), 2f); + ImGui.Unindent(10f); + } + else + { + ImGui.Spacing(); + ImGui.Indent(10f); + ImGui.PushFont(UiBuilder.IconFont); + ImGui.TextColored(new Vector4(0.6f, 0.5f, 0.8f, 0.8f), FontAwesomeIcon.Ban.ToIconString()); + ImGui.PopFont(); + ImGui.SameLine(); + ImGui.TextColored(new Vector4(0.6f, 0.5f, 0.8f, 0.8f), "Not Implemented"); + ImGui.Spacing(); + ImGui.TextColored(new Vector4(0.7f, 0.7f, 0.8f, 1f), "No quest path data available"); + ImGui.Unindent(10f); + } + }); + } + finally + { + ((TableDisposable)(ref val)).Dispose(); + } } private static void DrawCard(float height, Vector4 accentColor, FontAwesomeIcon icon, string title, System.Action content) @@ -479,58 +564,100 @@ internal sealed class QuestSequenceComponent private void DrawSequenceGrid(int maxSeq, byte? currentSequence, HashSet implementedSequences, Dictionary sequenceDetails, bool hasEndSequence) { + //IL_0092: 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_0099: 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) + //IL_0100: Unknown result type (might be due to invalid IL or missing references) + //IL_0102: Unknown result type (might be due to invalid IL or missing references) int val = maxSeq + 2; float x = ImGui.GetContentRegionAvail().X; int val2 = Math.Max(4, Math.Min(8, (int)(x / 100f))); val2 = Math.Min(val2, val); float y = ImGui.GetContentRegionAvail().Y; - using (ImRaii.PushColor(ImGuiCol.ChildBg, new Vector4(0.08f, 0.06f, 0.12f, 0.6f))) + ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.ChildBg, new Vector4(0.08f, 0.06f, 0.12f, 0.6f), true); + try { - using (ImRaii.PushColor(ImGuiCol.Border, new Vector4(0.6f, 0.5f, 0.8f, 0.2f))) + ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.Border, new Vector4(0.6f, 0.5f, 0.8f, 0.2f), true); + try { - using ImRaii.IEndObject endObject = ImRaii.Child("SequenceGrid", new Vector2(-1f, y), border: true, ImGuiWindowFlags.None); - if (!ImRaii.IEndObject.op_True(endObject)) + ChildDisposable val5 = ImRaii.Child((ImU8String)"SequenceGrid", new Vector2(-1f, y), true, ImGuiWindowFlags.None); + try { - return; - } - using (ImRaii.PushColor(ImGuiCol.TableBorderStrong, new Vector4(0.6f, 0.5f, 0.8f, 0.2f))) - { - using (ImRaii.PushColor(ImGuiCol.TableBorderLight, new Vector4(0.6f, 0.5f, 0.8f, 0.15f))) + if (!ChildDisposable.op_Implicit(val5)) { - using ImRaii.IEndObject endObject2 = ImRaii.Table("SequenceGridTable", val2, ImGuiTableFlags.Borders | ImGuiTableFlags.SizingStretchSame); - if (!ImRaii.IEndObject.op_True(endObject2)) + return; + } + ColorDisposable val6 = ImRaii.PushColor(ImGuiCol.TableBorderStrong, new Vector4(0.6f, 0.5f, 0.8f, 0.2f), true); + try + { + ColorDisposable val7 = ImRaii.PushColor(ImGuiCol.TableBorderLight, new Vector4(0.6f, 0.5f, 0.8f, 0.15f), true); + try { - return; - } - int num = 0; - for (int i = 0; i <= maxSeq; i++) - { - if (num % val2 == 0) + TableDisposable val8 = ImRaii.Table((ImU8String)"SequenceGridTable", val2, ImGuiTableFlags.Borders | ImGuiTableFlags.SizingStretchSame); + try { - ImGui.TableNextRow(); + if (!TableDisposable.op_Implicit(val8)) + { + return; + } + int num = 0; + for (int i = 0; i <= maxSeq; i++) + { + if (num % val2 == 0) + { + ImGui.TableNextRow(); + } + ImGui.TableNextColumn(); + DrawSequenceCell(i, currentSequence, implementedSequences, sequenceDetails); + num++; + } + if (num % val2 == 0) + { + ImGui.TableNextRow(); + } + ImGui.TableNextColumn(); + DrawSequenceCell(255, currentSequence, implementedSequences, sequenceDetails, hasEndSequence); + for (num++; num % val2 != 0; num++) + { + ImGui.TableNextColumn(); + } + } + finally + { + ((TableDisposable)(ref val8)).Dispose(); } - ImGui.TableNextColumn(); - DrawSequenceCell(i, currentSequence, implementedSequences, sequenceDetails); - num++; } - if (num % val2 == 0) + finally { - ImGui.TableNextRow(); - } - ImGui.TableNextColumn(); - DrawSequenceCell(255, currentSequence, implementedSequences, sequenceDetails, hasEndSequence); - for (num++; num % val2 != 0; num++) - { - ImGui.TableNextColumn(); + ((IDisposable)val7)?.Dispose(); } } + finally + { + ((IDisposable)val6)?.Dispose(); + } + } + finally + { + ((ChildDisposable)(ref val5)).Dispose(); } } + finally + { + ((IDisposable)val4)?.Dispose(); + } + } + finally + { + ((IDisposable)val3)?.Dispose(); } } private void DrawSequenceCell(int sequenceId, byte? currentSequence, HashSet implementedSequences, Dictionary sequenceDetails, bool? forcedImplemented = null) { + //IL_035b: Unknown result type (might be due to invalid IL or missing references) + //IL_0360: Unknown result type (might be due to invalid IL or missing references) bool flag = currentSequence.HasValue && sequenceId == currentSequence.Value; bool flag2 = forcedImplemented ?? implementedSequences.Contains(sequenceId); bool flag3 = _hoveredSequenceId == sequenceId; @@ -574,15 +701,21 @@ internal sealed class QuestSequenceComponent if (ImGui.IsItemHovered()) { _hoveredSequenceId = sequenceId; - using (ImRaii.Tooltip()) + TooltipDisposable val = ImRaii.Tooltip(); + try { - using (ImRaii.PushColor(ImGuiCol.Text, new Vector4(0.98f, 0.98f, 1f, 1f))) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, new Vector4(0.98f, 0.98f, 1f, 1f), true); + try { ImU8String text2 = new ImU8String(9, 1); text2.AppendLiteral("Sequence "); text2.AppendFormatted(sequenceId); ImGui.Text(text2); } + finally + { + ((IDisposable)val2)?.Dispose(); + } ImGui.Separator(); if (flag2 && sequenceDetails.TryGetValue(sequenceId, out (int, string) value)) { @@ -627,6 +760,10 @@ internal sealed class QuestSequenceComponent ImGui.TextColored(new Vector4(1f, 0.85f, 0.5f, 1f), "► Currently Active"); } } + finally + { + ((TooltipDisposable)(ref val)).Dispose(); + } } else if (_hoveredSequenceId == sequenceId) { diff --git a/Questionable/Questionable.Windows.QuestComponents/QuestTooltipComponent.cs b/Questionable/Questionable.Windows.QuestComponents/QuestTooltipComponent.cs index 1fb48de..ade06b9 100644 --- a/Questionable/Questionable.Windows.QuestComponents/QuestTooltipComponent.cs +++ b/Questionable/Questionable.Windows.QuestComponents/QuestTooltipComponent.cs @@ -1,3 +1,4 @@ +using System; using Dalamud.Bindings.ImGui; using Dalamud.Game.Text; using Dalamud.Interface; @@ -38,10 +39,19 @@ internal sealed class QuestTooltipComponent public void Draw(IQuestInfo questInfo) { - using ImRaii.IEndObject endObject = ImRaii.Tooltip(); - if (endObject) + //IL_0000: Unknown result type (might be due to invalid IL or missing references) + //IL_0005: Unknown result type (might be due to invalid IL or missing references) + TooltipDisposable val = ImRaii.Tooltip(); + try { - DrawInner(questInfo, showItemRewards: true); + if (((TooltipDisposable)(ref val)).Alive) + { + DrawInner(questInfo, showItemRewards: true); + } + } + finally + { + ((TooltipDisposable)(ref val)).Dispose(); } } @@ -143,10 +153,15 @@ internal sealed class QuestTooltipComponent } else { - using (ImRaii.Disabled()) + DisabledDisposable val = ImRaii.Disabled(); + try { _uiUtils.ChecklistItem($"Unknown Quest ({previousQuest.QuestId})", ImGuiColors.DalamudGrey, FontAwesomeIcon.Question); } + finally + { + ((IDisposable)val)?.Dispose(); + } } } } diff --git a/Questionable/Questionable.Windows.QuestComponents/QuestValidationComponent.cs b/Questionable/Questionable.Windows.QuestComponents/QuestValidationComponent.cs index 6a632c8..e3074a4 100644 --- a/Questionable/Questionable.Windows.QuestComponents/QuestValidationComponent.cs +++ b/Questionable/Questionable.Windows.QuestComponents/QuestValidationComponent.cs @@ -55,20 +55,26 @@ internal sealed class QuestValidationComponent ImGui.SameLine(); ImGui.Text("("); ImGui.SameLine(); - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true); + try { ImU8String text2 = new ImU8String(7, 1); text2.AppendFormatted(errorCount); text2.AppendLiteral(" errors"); ImGui.Text(text2); } + finally + { + ((IDisposable)val)?.Dispose(); + } } if (num > 0) { if (errorCount > 0) { ImGui.SameLine(); - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange)) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange, true); + try { ImU8String text3 = new ImU8String(12, 1); text3.AppendLiteral(", "); @@ -77,11 +83,16 @@ internal sealed class QuestValidationComponent ImGui.Text(text3); return; } + finally + { + ((IDisposable)val2)?.Dispose(); + } } ImGui.SameLine(); ImGui.Text("("); ImGui.SameLine(); - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange)) + ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange, true); + try { ImU8String text4 = new ImU8String(10, 1); text4.AppendFormatted(num); @@ -89,6 +100,10 @@ internal sealed class QuestValidationComponent ImGui.Text(text4); return; } + finally + { + ((IDisposable)val3)?.Dispose(); + } } if (errorCount > 0) { @@ -99,22 +114,32 @@ internal sealed class QuestValidationComponent private void DrawValidationTable() { - using ImRaii.IEndObject endObject = ImRaii.Table("ValidationIssues", 6, ImGuiTableFlags.Borders | ImGuiTableFlags.Sortable | ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY); - if (!(!endObject)) + //IL_0010: Unknown result type (might be due to invalid IL or missing references) + //IL_0015: Unknown result type (might be due to invalid IL or missing references) + //IL_0016: Unknown result type (might be due to invalid IL or missing references) + TableDisposable val = ImRaii.Table((ImU8String)"ValidationIssues", 6, ImGuiTableFlags.Borders | ImGuiTableFlags.Sortable | ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY); + try { - ImGui.TableSetupColumn("ID", ImGuiTableColumnFlags.WidthFixed, 60f); - ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthFixed, 250f); - ImGui.TableSetupColumn("Seq", ImGuiTableColumnFlags.WidthFixed, 40f); - ImGui.TableSetupColumn("Step", ImGuiTableColumnFlags.WidthFixed, 40f); - ImGui.TableSetupColumn("Issue", ImGuiTableColumnFlags.WidthStretch); - ImGui.TableSetupColumn("Actions", ImGuiTableColumnFlags.WidthFixed, 60f); - ImGui.TableHeadersRow(); - IReadOnlyList issues = _questValidator.Issues; - for (int i = 0; i < issues.Count; i++) + if (!(!val)) { - DrawValidationRow(issues[i], i); + ImGui.TableSetupColumn("ID", ImGuiTableColumnFlags.WidthFixed, 60f); + ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthFixed, 250f); + ImGui.TableSetupColumn("Seq", ImGuiTableColumnFlags.WidthFixed, 40f); + ImGui.TableSetupColumn("Step", ImGuiTableColumnFlags.WidthFixed, 40f); + ImGui.TableSetupColumn("Issue", ImGuiTableColumnFlags.WidthStretch); + ImGui.TableSetupColumn("Actions", ImGuiTableColumnFlags.WidthFixed, 60f); + ImGui.TableHeadersRow(); + IReadOnlyList issues = _questValidator.Issues; + for (int i = 0; i < issues.Count; i++) + { + DrawValidationRow(issues[i], i); + } } } + finally + { + ((TableDisposable)(ref val)).Dispose(); + } } private void DrawValidationRow(ValidationIssue issue, int index) @@ -136,10 +161,15 @@ internal sealed class QuestValidationComponent } else { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudGrey2)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudGrey2, true); + try { ImGui.TextUnformatted("\ufffd"); } + finally + { + ((IDisposable)val)?.Dispose(); + } } } if (ImGui.TableNextColumn()) @@ -150,10 +180,15 @@ internal sealed class QuestValidationComponent } else { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudGrey2)) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudGrey2, true); + try { ImGui.TextUnformatted("\ufffd"); } + finally + { + ((IDisposable)val2)?.Dispose(); + } } } if (ImGui.TableNextColumn()) @@ -168,21 +203,31 @@ internal sealed class QuestValidationComponent private void DrawIssueCell(ValidationIssue issue, int index) { - Vector4 color = ((issue.Severity == EIssueSeverity.Error) ? ImGuiColors.DalamudRed : ImGuiColors.DalamudOrange); + Vector4 vector = ((issue.Severity == EIssueSeverity.Error) ? ImGuiColors.DalamudRed : ImGuiColors.DalamudOrange); FontAwesomeIcon icon = ((issue.Severity == EIssueSeverity.Error) ? FontAwesomeIcon.ExclamationTriangle : FontAwesomeIcon.InfoCircle); using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push()) { - using (ImRaii.PushColor(ImGuiCol.Text, color)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, vector, true); + try { ImGui.TextUnformatted(icon.ToIconString()); } + finally + { + ((IDisposable)val)?.Dispose(); + } } ImGui.SameLine(); string issueSummary = GetIssueSummary(issue); - using (ImRaii.PushColor(ImGuiCol.Text, color)) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, vector, true); + try { ImGui.TextWrapped(issueSummary); } + finally + { + ((IDisposable)val2)?.Dispose(); + } } private void DrawActionsCell(ValidationIssue issue, int index) diff --git a/Questionable/Questionable.Windows.QuestComponents/QuickAccessButtonsComponent.cs b/Questionable/Questionable.Windows.QuestComponents/QuickAccessButtonsComponent.cs index ab56914..61ccf21 100644 --- a/Questionable/Questionable.Windows.QuestComponents/QuickAccessButtonsComponent.cs +++ b/Questionable/Questionable.Windows.QuestComponents/QuickAccessButtonsComponent.cs @@ -69,13 +69,18 @@ internal sealed class QuickAccessButtonsComponent private void DrawRebuildNavmeshButton() { bool flag = _commandManager.Commands.ContainsKey("/vnav"); - using (ImRaii.Disabled(!flag || !ImGui.IsKeyDown(ImGuiKey.ModCtrl))) + DisabledDisposable val = ImRaii.Disabled(!flag || !ImGui.IsKeyDown(ImGuiKey.ModCtrl)); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.GlobeEurope, "Rebuild Navmesh")) { _commandManager.ProcessCommand("/vnav rebuild"); } } + finally + { + ((IDisposable)val)?.Dispose(); + } if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { if (!flag) @@ -118,7 +123,8 @@ internal sealed class QuickAccessButtonsComponent return; } int num2 = ((validationErrorCount == 0 || num == 0) ? 1 : 2); - using (ImRaii.PushId("validationissues")) + IdDisposable val = ImRaii.PushId((ImU8String)"validationissues", true); + try { FontAwesomeIcon icon = FontAwesomeIcon.ExclamationTriangle; FontAwesomeIcon icon2 = FontAwesomeIcon.InfoCircle; @@ -170,5 +176,9 @@ internal sealed class QuickAccessButtonsComponent _questValidationWindow.IsOpenAndUncollapsed = true; } } + finally + { + ((IDisposable)val)?.Dispose(); + } } } diff --git a/Questionable/Questionable.Windows.QuestComponents/SavedPresetsComponent.cs b/Questionable/Questionable.Windows.QuestComponents/SavedPresetsComponent.cs index dd7fa14..1d5ede9 100644 --- a/Questionable/Questionable.Windows.QuestComponents/SavedPresetsComponent.cs +++ b/Questionable/Questionable.Windows.QuestComponents/SavedPresetsComponent.cs @@ -87,23 +87,32 @@ internal sealed class SavedPresetsComponent public void Draw() { + //IL_0039: Unknown result type (might be due to invalid IL or missing references) + //IL_003e: Unknown result type (might be due to invalid IL or missing references) + //IL_003f: Unknown result type (might be due to invalid IL or missing references) ImGui.TextWrapped("Save your current priority queue as a preset for quick access later. Saved presets are stored in your configuration and persist between sessions."); ImGui.Spacing(); DrawSaveSection(); ImGui.Spacing(); - using (ImRaii.IEndObject endObject = ImRaii.Child("SavedPresetsList", new Vector2(-1f, -27f), border: true)) + ChildDisposable val = ImRaii.Child((ImU8String)"SavedPresetsList", new Vector2(-1f, -27f), true); + try { - if (endObject) + if (ChildDisposable.op_Implicit(val)) { DrawSavedPresets(); } } + finally + { + ((ChildDisposable)(ref val)).Dispose(); + } DrawBottomButtons(); } private void DrawSaveSection() { int count = _questController.ManualPriorityQuests.Count; + DisabledDisposable val; if (_showSaveDialog) { ImGui.Text("Save Current Priority Queue as Preset:"); @@ -113,13 +122,18 @@ internal sealed class SavedPresetsComponent ImGui.SetNextItemWidth(250f); ImGui.InputTextWithHint("##PresetDescription", "Description (optional)...", ref _newPresetDescription, 256); ImGui.SameLine(); - using (ImRaii.Disabled(string.IsNullOrWhiteSpace(_newPresetName) || count == 0)) + val = ImRaii.Disabled(string.IsNullOrWhiteSpace(_newPresetName) || count == 0); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Save, "Save")) { SaveCurrentPreset(); } } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.SameLine(); if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Times, "Cancel")) { @@ -133,13 +147,18 @@ internal sealed class SavedPresetsComponent } return; } - using (ImRaii.Disabled(count == 0)) + val = ImRaii.Disabled(count == 0); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, $"Save Current Queue ({count} quests)")) { _showSaveDialog = true; } } + finally + { + ((IDisposable)val)?.Dispose(); + } if (count == 0 && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { ImGui.SetTooltip("Add quests to the priority queue first to save them as a preset."); @@ -173,7 +192,8 @@ internal sealed class SavedPresetsComponent private void DrawPresetEntry(string key, Configuration.SavedQuestPreset preset) { - using (ImRaii.PushId(key)) + IdDisposable val = ImRaii.PushId((ImU8String)key, true); + try { List availableQuests = GetAvailableQuests(preset.QuestIds); List completedQuests = GetCompletedQuests(preset.QuestIds); @@ -204,8 +224,10 @@ internal sealed class SavedPresetsComponent if (ImGui.CollapsingHeader(label, flag ? ImGuiTreeNodeFlags.DefaultOpen : ImGuiTreeNodeFlags.None)) { _expandedPreset = key; - using (ImRaii.PushIndent()) + IndentDisposable val2 = ImRaii.PushIndent(1, true); + try { + DisabledDisposable val3; if (_renamingPresetKey == key) { ImGui.Text("Name:"); @@ -216,13 +238,18 @@ internal sealed class SavedPresetsComponent ImGui.SameLine(); ImGui.SetNextItemWidth(300f); ImGui.InputTextWithHint("##EditDescription", "Description (optional)...", ref _renamePresetDescription, 256); - using (ImRaii.Disabled(string.IsNullOrWhiteSpace(_renamePresetName))) + val3 = ImRaii.Disabled(string.IsNullOrWhiteSpace(_renamePresetName)); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Check, "Save Changes")) { RenamePreset(key, _renamePresetName, _renamePresetDescription); } } + finally + { + ((IDisposable)val3)?.Dispose(); + } ImGui.SameLine(); if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Times, "Cancel")) { @@ -246,13 +273,18 @@ internal sealed class SavedPresetsComponent ImGui.TextColored(in col, text2); } ImGui.Spacing(); - using (ImRaii.Disabled(availableQuests.Count == 0)) + val3 = ImRaii.Disabled(availableQuests.Count == 0); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, $"Add Available ({availableQuests.Count})")) { AddPresetToPriority(availableQuests); } } + finally + { + ((IDisposable)val3)?.Dispose(); + } if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { if (availableQuests.Count == 0) @@ -269,13 +301,18 @@ internal sealed class SavedPresetsComponent } } ImGui.SameLine(); - using (ImRaii.Disabled(alreadyPriorityQuests.Count == 0)) + val3 = ImRaii.Disabled(alreadyPriorityQuests.Count == 0); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Minus, $"Remove from Priority ({alreadyPriorityQuests.Count})")) { RemovePresetFromPriority(alreadyPriorityQuests); } } + finally + { + ((IDisposable)val3)?.Dispose(); + } if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { if (alreadyPriorityQuests.Count == 0) @@ -300,7 +337,8 @@ internal sealed class SavedPresetsComponent ImGui.SetTooltip("Export this preset to clipboard for sharing."); } ImGui.SameLine(); - using (ImRaii.Disabled(_renamingPresetKey != null)) + val3 = ImRaii.Disabled(_renamingPresetKey != null); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Pen, "Edit")) { @@ -309,19 +347,28 @@ internal sealed class SavedPresetsComponent _renamePresetDescription = preset.Description; } } + finally + { + ((IDisposable)val3)?.Dispose(); + } if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { ImGui.SetTooltip("Edit preset name and description."); } ImGui.SameLine(); int count = _questController.ManualPriorityQuests.Count; - using (ImRaii.Disabled(count == 0)) + val3 = ImRaii.Disabled(count == 0); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Sync, "Update")) { UpdatePresetQuests(key, preset); } } + finally + { + ((IDisposable)val3)?.Dispose(); + } if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { if (count == 0) @@ -338,13 +385,18 @@ internal sealed class SavedPresetsComponent } } ImGui.SameLine(); - using (ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl))) + val3 = ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl)); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Delete")) { _presetToDelete = key; } } + finally + { + ((IDisposable)val3)?.Dispose(); + } if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { ImGui.SetTooltip("Hold CTRL to delete this preset."); @@ -378,6 +430,10 @@ internal sealed class SavedPresetsComponent } ImGui.Spacing(); } + finally + { + ((IDisposable)val2)?.Dispose(); + } } else if (_expandedPreset == key) { @@ -390,49 +446,69 @@ internal sealed class SavedPresetsComponent ImGui.EndTooltip(); } } + finally + { + ((IDisposable)val)?.Dispose(); + } } private void DrawBottomButtons() { PresetExportData presetExportData = ParseClipboardPreset(); List list = ParseClipboardAllPresets(); - using (ImRaii.Disabled(presetExportData == null)) + DisabledDisposable val = ImRaii.Disabled(presetExportData == null); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Download, "Import Preset") && presetExportData != null) { ImportPresetFromClipboard(presetExportData); } } + finally + { + ((IDisposable)val)?.Dispose(); + } if (presetExportData == null && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { ImGui.SetTooltip("Copy a valid preset string to clipboard first."); } ImGui.SameLine(); - using (ImRaii.Disabled(list == null || list.Count == 0)) + val = ImRaii.Disabled(list == null || list.Count == 0); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.FileImport, "Import All" + ((list != null && list.Count > 0) ? $" ({list.Count})" : "")) && list != null) { ImportAllPresetsFromClipboard(list); } } + finally + { + ((IDisposable)val)?.Dispose(); + } if ((list == null || list.Count == 0) && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { ImGui.SetTooltip("Copy a valid 'all presets' export string to clipboard first."); } ImGui.SameLine(); - using (ImRaii.Disabled(_configuration.General.SavedPresets.Count == 0)) + val = ImRaii.Disabled(_configuration.General.SavedPresets.Count == 0); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.FileExport, $"Export All ({_configuration.General.SavedPresets.Count})")) { ExportAllPresetsToClipboard(); } } + finally + { + ((IDisposable)val)?.Dispose(); + } if (_configuration.General.SavedPresets.Count == 0 && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { ImGui.SetTooltip("No saved presets to export."); } ImGui.SameLine(); - using (ImRaii.Disabled(_configuration.General.SavedPresets.Count == 0 || !ImGui.IsKeyDown(ImGuiKey.ModCtrl))) + val = ImRaii.Disabled(_configuration.General.SavedPresets.Count == 0 || !ImGui.IsKeyDown(ImGuiKey.ModCtrl)); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All")) { @@ -441,6 +517,10 @@ internal sealed class SavedPresetsComponent _logger.LogInformation("Cleared all saved presets"); } } + finally + { + ((IDisposable)val)?.Dispose(); + } if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { if (_configuration.General.SavedPresets.Count == 0) diff --git a/Questionable/Questionable.Windows.QuestComponents/ValidationDetailsRenderer.cs b/Questionable/Questionable.Windows.QuestComponents/ValidationDetailsRenderer.cs index d90dce0..24828ab 100644 --- a/Questionable/Questionable.Windows.QuestComponents/ValidationDetailsRenderer.cs +++ b/Questionable/Questionable.Windows.QuestComponents/ValidationDetailsRenderer.cs @@ -111,17 +111,23 @@ internal sealed class ValidationDetailsRenderer private void DrawIssueDetails(ValidationIssue issue) { - Vector4 color = ((issue.Severity == EIssueSeverity.Error) ? ImGuiColors.DalamudRed : ImGuiColors.DalamudOrange); + Vector4 vector = ((issue.Severity == EIssueSeverity.Error) ? ImGuiColors.DalamudRed : ImGuiColors.DalamudOrange); FontAwesomeIcon icon = ((issue.Severity == EIssueSeverity.Error) ? FontAwesomeIcon.ExclamationTriangle : FontAwesomeIcon.InfoCircle); using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push()) { - using (ImRaii.PushColor(ImGuiCol.Text, color)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, vector, true); + try { ImGui.TextUnformatted(icon.ToIconString()); } + finally + { + ((IDisposable)val)?.Dispose(); + } } ImGui.SameLine(); - using (ImRaii.PushColor(ImGuiCol.Text, color)) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, vector, true); + try { ImU8String text = new ImU8String(2, 2); text.AppendFormatted(issue.Severity); @@ -129,6 +135,10 @@ internal sealed class ValidationDetailsRenderer text.AppendFormatted(issue.Type); ImGui.Text(text); } + finally + { + ((IDisposable)val2)?.Dispose(); + } ImGui.Separator(); if (issue.ElementId != null) { @@ -194,24 +204,39 @@ internal sealed class ValidationDetailsRenderer } else if (text.StartsWith("JSON parsing error", StringComparison.Ordinal)) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true); + try { ImGui.TextWrapped(text); } + finally + { + ((IDisposable)val)?.Dispose(); + } } else if (text.StartsWith("This usually indicates", StringComparison.Ordinal) || text.StartsWith("Please check", StringComparison.Ordinal)) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen)) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen, true); + try { ImGui.TextWrapped(text); } + finally + { + ((IDisposable)val2)?.Dispose(); + } } else if (text.StartsWith("\ufffd ", StringComparison.Ordinal)) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow)) + ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow, true); + try { ImGui.TextWrapped(text); } + finally + { + ((IDisposable)val3)?.Dispose(); + } } else { @@ -253,8 +278,9 @@ internal sealed class ValidationDetailsRenderer for (int num = 0; num < list.Count; num++) { string value = list[num]; - Vector4 color = array2[num % array2.Length]; - using (ImRaii.PushColor(ImGuiCol.Text, color)) + Vector4 vector = array2[num % array2.Length]; + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, vector, true); + try { if (ElementId.TryFromString(value, out ElementId elementId) && elementId != null) { @@ -285,6 +311,10 @@ internal sealed class ValidationDetailsRenderer ImGui.TextWrapped(text3); } } + finally + { + ((IDisposable)val)?.Dispose(); + } } ImGui.Unindent(); } @@ -318,7 +348,8 @@ internal sealed class ValidationDetailsRenderer private void DrawJsonValidationError(JsonValidationError error, int index) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow, true); + try { ImU8String text = new ImU8String(8, 1); text.AppendLiteral("Error #"); @@ -326,16 +357,25 @@ internal sealed class ValidationDetailsRenderer text.AppendLiteral(":"); ImGui.Text(text); } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.Indent(12f); if (!string.IsNullOrEmpty(error.Path)) { ImGui.AlignTextToFramePadding(); ImGui.Text("Location:"); ImGui.SameLine(); - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue)) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue, true); + try { ImGui.TextWrapped(FormatJsonPath(error.Path)); } + finally + { + ((IDisposable)val2)?.Dispose(); + } } if (error.Messages.Count > 0) { @@ -344,7 +384,8 @@ internal sealed class ValidationDetailsRenderer foreach (string message in error.Messages) { ImGui.Indent(12f); - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed)) + ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true); + try { string text2 = CleanJsonText(message); if (string.Equals(text2, "validation failed", StringComparison.OrdinalIgnoreCase)) @@ -357,13 +398,18 @@ internal sealed class ValidationDetailsRenderer ImGui.TextWrapped(text3); ImGui.Unindent(12f); } + finally + { + ((IDisposable)val3)?.Dispose(); + } } } List validationSuggestions = GetValidationSuggestions(error); if (validationSuggestions.Count > 0) { ImGui.Spacing(); - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen)) + ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen, true); + try { ImGui.Text("Suggestions:"); foreach (string item in validationSuggestions) @@ -371,19 +417,33 @@ internal sealed class ValidationDetailsRenderer ImGui.Indent(12f); using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push()) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow)) + ColorDisposable val5 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow, true); + try { ImGui.Text(FontAwesomeIcon.Lightbulb.ToIconString()); } + finally + { + ((IDisposable)val5)?.Dispose(); + } } ImGui.SameLine(); - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen)) + ColorDisposable val6 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen, true); + try { ImGui.TextWrapped(item); ImGui.Unindent(12f); } + finally + { + ((IDisposable)val6)?.Dispose(); + } } } + finally + { + ((IDisposable)val4)?.Dispose(); + } } ImGui.Unindent(12f); } @@ -395,10 +455,15 @@ internal sealed class ValidationDetailsRenderer { if (text.StartsWith("JSON Validation failed:", StringComparison.Ordinal)) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true); + try { ImGui.TextWrapped(text); } + finally + { + ((IDisposable)val)?.Dispose(); + } } else if (text.StartsWith(" - ", StringComparison.Ordinal)) { @@ -413,24 +478,39 @@ internal sealed class ValidationDetailsRenderer } ImGui.Text("\ufffd"); ImGui.SameLine(); - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue)) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue, true); + try { ImGui.Text(FormatJsonPath(path)); } + finally + { + ((IDisposable)val2)?.Dispose(); + } ImGui.SameLine(); ImGui.Text(":"); ImGui.SameLine(); - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed)) + ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true); + try { ImGui.TextWrapped(text2); } + finally + { + ((IDisposable)val3)?.Dispose(); + } } else { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed)) + ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true); + try { ImGui.TextWrapped(CleanJsonText(text)); } + finally + { + ((IDisposable)val4)?.Dispose(); + } } } else @@ -541,20 +621,30 @@ internal sealed class ValidationDetailsRenderer } else if (text.StartsWith("Error:", StringComparison.Ordinal) || text.StartsWith("Invalid", StringComparison.Ordinal) || text.StartsWith("Missing", StringComparison.Ordinal)) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true); + try { ImGui.TextWrapped(text); } + finally + { + ((IDisposable)val)?.Dispose(); + } } else if (text.Contains(':', StringComparison.Ordinal)) { int num = text.IndexOf(':', StringComparison.Ordinal); string text2 = text.Substring(0, num); string text3 = text.Substring(num + 1).TrimStart(); - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue)) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue, true); + try { ImGui.Text(text2 + ":"); } + finally + { + ((IDisposable)val2)?.Dispose(); + } ImGui.SameLine(); ImGui.TextWrapped(text3); } diff --git a/Questionable/Questionable.Windows.Utils/QuestSelector.cs b/Questionable/Questionable.Windows.Utils/QuestSelector.cs index 08aee3b..9be2d93 100644 --- a/Questionable/Questionable.Windows.Utils/QuestSelector.cs +++ b/Questionable/Questionable.Windows.Utils/QuestSelector.cs @@ -24,6 +24,9 @@ internal sealed class QuestSelector(QuestRegistry questRegistry) public void DrawSelection() { + //IL_0144: Unknown result type (might be due to invalid IL or missing references) + //IL_0149: Unknown result type (might be due to invalid IL or missing references) + //IL_014b: Unknown result type (might be due to invalid IL or missing references) if (QuestSelected == null) { throw new InvalidOperationException("QuestSelected action must be set before drawing the quest selector."); @@ -52,9 +55,10 @@ internal sealed class QuestSelector(QuestRegistry questRegistry) { enumerable = questRegistry.AllQuests.Where((Quest x) => DefaultPredicate?.Invoke(x) ?? true); } - using (ImRaii.IEndObject endObject = ImRaii.Child("##QuestScrollArea", new Vector2(0f, 300f), border: false)) + ChildDisposable val = ImRaii.Child((ImU8String)"##QuestScrollArea", new Vector2(0f, 300f), false); + try { - if (endObject) + if (ChildDisposable.op_Implicit(val)) { foreach (Quest item in enumerable) { @@ -71,6 +75,10 @@ internal sealed class QuestSelector(QuestRegistry questRegistry) } } } + finally + { + ((ChildDisposable)(ref val)).Dispose(); + } ImGui.EndCombo(); } else diff --git a/Questionable/Questionable.Windows/ChangelogWindow.cs b/Questionable/Questionable.Windows/ChangelogWindow.cs index 3b547ca..bbcaef2 100644 --- a/Questionable/Questionable.Windows/ChangelogWindow.cs +++ b/Questionable/Questionable.Windows/ChangelogWindow.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using System.Numerics; @@ -31,17 +32,18 @@ internal sealed class ChangelogWindow : LWindow public ChangelogWindow(Configuration configuration, IDalamudPluginInterface pluginInterface) : base("Questionable Changelog###QuestionableChangelog", ImGuiWindowFlags.NoTitleBar) { + //IL_0086: Unknown result type (might be due to invalid IL or missing references) _configuration = configuration; _pluginInterface = pluginInterface; _headerComponent = new ChangelogHeaderComponent(); _footerComponent = new ChangelogFooterComponent(); base.Size = new Vector2(900f, 650f); base.SizeCondition = ImGuiCond.FirstUseEver; - base.SizeConstraints = new WindowSizeConstraints - { - MinimumSize = new Vector2(700f, 500f), - MaximumSize = new Vector2(float.MaxValue, float.MaxValue) - }; + WindowSizeConstraints value = default(WindowSizeConstraints); + ((WindowSizeConstraints)(ref value))._002Ector(); + ((WindowSizeConstraints)(ref value)).MinimumSize = new Vector2(700f, 500f); + ((WindowSizeConstraints)(ref value)).MaximumSize = new Vector2(float.MaxValue, float.MaxValue); + ((Window)this).SizeConstraints = value; } public override void DrawContent() @@ -78,50 +80,90 @@ internal sealed class ChangelogWindow : LWindow private void DrawChangelogEntries() { + //IL_00de: Unknown result type (might be due to invalid IL or missing references) + //IL_00e3: Unknown result type (might be due to invalid IL or missing references) + //IL_00e5: Unknown result type (might be due to invalid IL or missing references) + //IL_0103: Unknown result type (might be due to invalid IL or missing references) + //IL_0108: Unknown result type (might be due to invalid IL or missing references) + //IL_010a: Unknown result type (might be due to invalid IL or missing references) _headerAnimationTime += ImGui.GetIO().DeltaTime; - using (ImRaii.PushColor(ImGuiCol.ScrollbarBg, new Vector4(0.1f, 0.08f, 0.14f, 0.6f))) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.ScrollbarBg, new Vector4(0.1f, 0.08f, 0.14f, 0.6f), true); + try { - using (ImRaii.PushColor(ImGuiCol.ScrollbarGrab, new Vector4(0.55f, 0.45f, 0.75f, 0.4f))) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.ScrollbarGrab, new Vector4(0.55f, 0.45f, 0.75f, 0.4f), true); + try { - using (ImRaii.PushColor(ImGuiCol.ScrollbarGrabHovered, new Vector4(0.65f, 0.55f, 0.85f, 0.6f))) + ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.ScrollbarGrabHovered, new Vector4(0.65f, 0.55f, 0.85f, 0.6f), true); + try { - using (ImRaii.PushColor(ImGuiCol.ScrollbarGrabActive, new Vector4(0.75f, 0.55f, 0.95f, 0.8f))) + ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.ScrollbarGrabActive, new Vector4(0.75f, 0.55f, 0.95f, 0.8f), true); + try { float num = ImGui.GetFrameHeightWithSpacing() + ImGui.GetStyle().ItemSpacing.Y * 2f; - using ImRaii.IEndObject endObject = ImRaii.Child("ChangelogScroll", new Vector2(0f, 0f - num), border: false, ImGuiWindowFlags.NoScrollbar); - if (!endObject) + ChildDisposable val5 = ImRaii.Child((ImU8String)"ChangelogScroll", new Vector2(0f, 0f - num), false, ImGuiWindowFlags.NoScrollbar); + try { - return; + if (!val5) + { + return; + } + ChildDisposable val6 = ImRaii.Child((ImU8String)"ChangelogScrollInner", Vector2.Zero, false); + try + { + if (!val6) + { + return; + } + List changelogs = ChangelogData.Changelogs; + ChangelogEntry changelogEntry = changelogs.FirstOrDefault(); + if (changelogs.Count == 0) + { + ImGui.SetCursorPosY(ImGui.GetCursorPosY() + 40f); + Vector2 vector = ImGui.CalcTextSize("No changelog entries available."); + ImGui.SetCursorPosX((ImGui.GetContentRegionAvail().X - vector.X) * 0.5f); + ImGui.TextDisabled("No changelog entries available."); + return; + } + ChangelogEntryComponent changelogEntryComponent = new ChangelogEntryComponent(_configuration, _windowOpenCount, _headerAnimationTime); + foreach (ChangelogEntry item in changelogs) + { + changelogEntryComponent.Draw(item, item == changelogEntry, _hasSetInitialState); + Vector2 cursorScreenPos = ImGui.GetCursorScreenPos(); + float num2 = ImGui.GetContentRegionAvail().X * 0.5f; + float num3 = (ImGui.GetContentRegionAvail().X - num2) * 0.5f; + ImGui.GetWindowDrawList().AddLine(cursorScreenPos + new Vector2(num3, 0f), cursorScreenPos + new Vector2(num3 + num2, 0f), ImGui.ColorConvertFloat4ToU32(new Vector4(0.55f, 0.45f, 0.75f, 0.1f)), 1f); + ImGui.SetCursorPosY(ImGui.GetCursorPosY() + 4f); + } + _hasSetInitialState = true; + } + finally + { + ((ChildDisposable)(ref val6)).Dispose(); + } } - using ImRaii.IEndObject endObject2 = ImRaii.Child("ChangelogScrollInner", Vector2.Zero, border: false); - if (!endObject2) + finally { - return; + ((ChildDisposable)(ref val5)).Dispose(); } - List changelogs = ChangelogData.Changelogs; - ChangelogEntry changelogEntry = changelogs.FirstOrDefault(); - if (changelogs.Count == 0) - { - ImGui.SetCursorPosY(ImGui.GetCursorPosY() + 40f); - Vector2 vector = ImGui.CalcTextSize("No changelog entries available."); - ImGui.SetCursorPosX((ImGui.GetContentRegionAvail().X - vector.X) * 0.5f); - ImGui.TextDisabled("No changelog entries available."); - return; - } - ChangelogEntryComponent changelogEntryComponent = new ChangelogEntryComponent(_configuration, _windowOpenCount, _headerAnimationTime); - foreach (ChangelogEntry item in changelogs) - { - changelogEntryComponent.Draw(item, item == changelogEntry, _hasSetInitialState); - Vector2 cursorScreenPos = ImGui.GetCursorScreenPos(); - float num2 = ImGui.GetContentRegionAvail().X * 0.5f; - float num3 = (ImGui.GetContentRegionAvail().X - num2) * 0.5f; - ImGui.GetWindowDrawList().AddLine(cursorScreenPos + new Vector2(num3, 0f), cursorScreenPos + new Vector2(num3 + num2, 0f), ImGui.ColorConvertFloat4ToU32(new Vector4(0.55f, 0.45f, 0.75f, 0.1f)), 1f); - ImGui.SetCursorPosY(ImGui.GetCursorPosY() + 4f); - } - _hasSetInitialState = true; + } + finally + { + ((IDisposable)val4)?.Dispose(); } } + finally + { + ((IDisposable)val3)?.Dispose(); + } } + finally + { + ((IDisposable)val2)?.Dispose(); + } + } + finally + { + ((IDisposable)val)?.Dispose(); } } diff --git a/Questionable/Questionable.Windows/ConfigWindow.cs b/Questionable/Questionable.Windows/ConfigWindow.cs index ef7f0e0..d4bfc4c 100644 --- a/Questionable/Questionable.Windows/ConfigWindow.cs +++ b/Questionable/Questionable.Windows/ConfigWindow.cs @@ -36,6 +36,12 @@ internal sealed class ConfigWindow : LWindow, IPersistableWindowConfig public ConfigWindow(IDalamudPluginInterface pluginInterface, GeneralConfigComponent generalConfigComponent, PluginConfigComponent pluginConfigComponent, DutyConfigComponent dutyConfigComponent, SinglePlayerDutyConfigComponent singlePlayerDutyConfigComponent, StopConditionComponent stopConditionComponent, BlacklistConfigComponent blacklistConfigComponent, NotificationConfigComponent notificationConfigComponent, DebugConfigComponent debugConfigComponent, Configuration configuration, ChangelogWindow changelogWindow) : base("Config - Questionable###QuestionableConfig", ImGuiWindowFlags.AlwaysAutoResize) { + //IL_006f: Unknown result type (might be due to invalid IL or missing references) + //IL_0074: Unknown result type (might be due to invalid IL or missing references) + //IL_007f: Unknown result type (might be due to invalid IL or missing references) + //IL_0094: Unknown result type (might be due to invalid IL or missing references) + //IL_00a6: Unknown result type (might be due to invalid IL or missing references) + //IL_00d0: Expected O, but got Unknown _pluginInterface = pluginInterface; _generalConfigComponent = generalConfigComponent; _pluginConfigComponent = pluginConfigComponent; @@ -46,7 +52,7 @@ internal sealed class ConfigWindow : LWindow, IPersistableWindowConfig _notificationConfigComponent = notificationConfigComponent; _debugConfigComponent = debugConfigComponent; _configuration = configuration; - base.TitleBarButtons.Add(new TitleBarButton + ((Window)this).TitleBarButtons.Add(new TitleBarButton { Icon = FontAwesomeIcon.FileAlt, IconOffset = new Vector2(1.5f, 1f), @@ -65,17 +71,27 @@ internal sealed class ConfigWindow : LWindow, IPersistableWindowConfig public override void DrawContent() { - using ImRaii.IEndObject endObject = ImRaii.TabBar("QuestionableConfigTabs"); - if (!(!endObject)) + //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)"QuestionableConfigTabs"); + try { - _generalConfigComponent.DrawTab(); - _pluginConfigComponent.DrawTab(); - _dutyConfigComponent.DrawTab(); - _singlePlayerDutyConfigComponent.DrawTab(); - _stopConditionComponent.DrawTab(); - _blacklistConfigComponent.DrawTab(); - _notificationConfigComponent.DrawTab(); - _debugConfigComponent.DrawTab(); + if (!(!val)) + { + _generalConfigComponent.DrawTab(); + _pluginConfigComponent.DrawTab(); + _dutyConfigComponent.DrawTab(); + _singlePlayerDutyConfigComponent.DrawTab(); + _stopConditionComponent.DrawTab(); + _blacklistConfigComponent.DrawTab(); + _notificationConfigComponent.DrawTab(); + _debugConfigComponent.DrawTab(); + } + } + finally + { + ((TabBarDisposable)(ref val)).Dispose(); } } diff --git a/Questionable/Questionable.Windows/FateSelectionWindow.cs b/Questionable/Questionable.Windows/FateSelectionWindow.cs index 9385541..a9ed0f3 100644 --- a/Questionable/Questionable.Windows/FateSelectionWindow.cs +++ b/Questionable/Questionable.Windows/FateSelectionWindow.cs @@ -41,6 +41,7 @@ internal sealed class FateSelectionWindow : LWindow public FateSelectionWindow(FateController fateController, FateDefinitionRegistry fateDefinitionRegistry, QuestController questController, MovementController movementController, QuestFunctions questFunctions, QuestData questData, TerritoryData territoryData) : base("FATE Farming###QuestionableFateFarming") { + //IL_0097: Unknown result type (might be due to invalid IL or missing references) _fateController = fateController; _fateDefinitionRegistry = fateDefinitionRegistry; _questController = questController; @@ -50,11 +51,11 @@ internal sealed class FateSelectionWindow : LWindow _territoryData = territoryData; base.Size = new Vector2(600f, 400f); base.SizeCondition = ImGuiCond.FirstUseEver; - base.SizeConstraints = new WindowSizeConstraints - { - MinimumSize = new Vector2(500f, 300f), - MaximumSize = new Vector2(900f, 700f) - }; + WindowSizeConstraints value = default(WindowSizeConstraints); + ((WindowSizeConstraints)(ref value))._002Ector(); + ((WindowSizeConstraints)(ref value)).MinimumSize = new Vector2(500f, 300f); + ((WindowSizeConstraints)(ref value)).MaximumSize = new Vector2(900f, 700f); + ((Window)this).SizeConstraints = value; } public override void DrawContent() @@ -90,18 +91,26 @@ internal sealed class FateSelectionWindow : LWindow float num2 = (float)ImGui.GetTime(); float num3 = 0.85f + MathF.Sin(num2 * 3f) * 0.15f; Vector4 col = new Vector4(1f * num3, 0.85f * num3, 0f, 1f); - using (ImRaii.PushFont(UiBuilder.IconFont)) + FontDisposable val = ImRaii.PushFont(UiBuilder.IconFont, true); + try { ImGui.TextColored(in col, FontAwesomeIcon.Star.ToIconString()); } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.SameLine(); ImGui.TextColored(ImGuiColors.ParsedGold, _fateController.CurrentFate.Name); ImGui.SameLine(x - 35f); - using (ImRaii.PushColor(ImGuiCol.Button, Vector4.Zero)) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Button, Vector4.Zero, true); + try { - using (ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.8f, 0.3f, 0.3f, 0.4f))) + ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.8f, 0.3f, 0.3f, 0.4f), true); + try { - using (ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.9f, 0.2f, 0.2f, 0.6f))) + ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.9f, 0.2f, 0.2f, 0.6f), true); + try { if (ImGuiComponents.IconButton(FontAwesomeIcon.Stop)) { @@ -109,7 +118,19 @@ internal sealed class FateSelectionWindow : LWindow _movementController.Stop(); } } + finally + { + ((IDisposable)val4)?.Dispose(); + } } + finally + { + ((IDisposable)val3)?.Dispose(); + } + } + finally + { + ((IDisposable)val2)?.Dispose(); } ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 8f); string value = (_fateController.CycleLimit.HasValue ? $"Cycle {_fateController.CompletedCycles + 1} / {_fateController.CycleLimit}" : $"Cycle {_fateController.CompletedCycles + 1}"); @@ -137,7 +158,8 @@ internal sealed class FateSelectionWindow : LWindow ImGui.TextColored(in col2, text3); } ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 8f); - using (ImRaii.Disabled(disabled: true)) + DisabledDisposable val5 = ImRaii.Disabled(true); + try { ImGui.AlignTextToFramePadding(); ImGui.TextUnformatted("Cycles:"); @@ -145,13 +167,18 @@ internal sealed class FateSelectionWindow : LWindow ImGui.SetNextItemWidth(100f); ImGui.InputInt("##CycleLimitRunning", ref _cycleLimit, 1, 5); } + finally + { + ((IDisposable)val5)?.Dispose(); + } ImGui.SetCursorPosY(cursorScreenPos.Y + num - ImGui.GetCursorScreenPos().Y + ImGui.GetCursorPosY() + 4f); ImGui.Spacing(); } private void DrawControlsStrip() { - using (ImRaii.Disabled(_fateController.IsRunning)) + DisabledDisposable val = ImRaii.Disabled(_fateController.IsRunning); + try { ImGui.AlignTextToFramePadding(); ImGui.TextUnformatted("Cycles:"); @@ -165,6 +192,10 @@ internal sealed class FateSelectionWindow : LWindow ImGui.SameLine(); ImGui.TextColored(ImGuiColors.DalamudGrey, (_cycleLimit == 0) ? "(unlimited)" : ""); } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.Spacing(); } @@ -206,6 +237,9 @@ internal sealed class FateSelectionWindow : LWindow private void DrawFateTable() { + //IL_0097: Unknown result type (might be due to invalid IL or missing references) + //IL_009c: Unknown result type (might be due to invalid IL or missing references) + //IL_009d: Unknown result type (might be due to invalid IL or missing references) List list = _fateDefinitionRegistry.Definitions.Values.OrderBy(delegate(FateDefinition f) { DateTime? eventExpiry = f.EventExpiry; @@ -233,40 +267,49 @@ internal sealed class FateSelectionWindow : LWindow return double.MaxValue; }).ThenBy((FateDefinition f) => f.Name, StringComparer.OrdinalIgnoreCase) .ToList(); - using ImRaii.IEndObject endObject = ImRaii.Table("FateTable", 4, ImGuiTableFlags.SizingStretchProp | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerH | ImGuiTableFlags.ScrollY); - if (!endObject) + TableDisposable val = ImRaii.Table((ImU8String)"FateTable", 4, ImGuiTableFlags.SizingStretchProp | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerH | ImGuiTableFlags.ScrollY); + try { - return; - } - ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.None, 3f); - ImGui.TableSetupColumn("Zone", ImGuiTableColumnFlags.None, 2f); - ImGui.TableSetupColumn("Expiry", ImGuiTableColumnFlags.WidthFixed, 80f); - ImGui.TableSetupColumn("##Actions", ImGuiTableColumnFlags.WidthFixed, 30f); - ImGui.TableHeadersRow(); - foreach (FateDefinition item in list) - { - ImGui.TableNextRow(); - bool flag = _fateController.IsRunning && _fateController.CurrentFate == item; - if (flag) + if (!val) { - float num = (float)ImGui.GetTime(); - float w = 0.1f + MathF.Sin(num * 2.5f) * 0.05f; - ImGui.TableSetBgColor(ImGuiTableBgTarget.RowBg1, ImGui.GetColorU32(new Vector4(1f, 0.85f, 0f, w))); + return; } - ImGui.TableNextColumn(); - DrawFateRowName(item, flag); - ImGui.TableNextColumn(); - ImGui.TextUnformatted(_territoryData.GetName(item.TerritoryId) ?? item.Description); - ImGui.TableNextColumn(); - DrawFateRowExpiry(item); - ImGui.TableNextColumn(); - bool disabled = _fateController.IsRunning || _questController.AutomationType != QuestController.EAutomationType.Manual; - DrawFateRowActions(item, disabled); + ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.None, 3f); + ImGui.TableSetupColumn("Zone", ImGuiTableColumnFlags.None, 2f); + ImGui.TableSetupColumn("Expiry", ImGuiTableColumnFlags.WidthFixed, 80f); + ImGui.TableSetupColumn("##Actions", ImGuiTableColumnFlags.WidthFixed, 30f); + ImGui.TableHeadersRow(); + foreach (FateDefinition item in list) + { + ImGui.TableNextRow(); + bool flag = _fateController.IsRunning && _fateController.CurrentFate == item; + if (flag) + { + float num = (float)ImGui.GetTime(); + float w = 0.1f + MathF.Sin(num * 2.5f) * 0.05f; + ImGui.TableSetBgColor(ImGuiTableBgTarget.RowBg1, ImGui.GetColorU32(new Vector4(1f, 0.85f, 0f, w))); + } + ImGui.TableNextColumn(); + DrawFateRowName(item, flag); + ImGui.TableNextColumn(); + ImGui.TextUnformatted(_territoryData.GetName(item.TerritoryId) ?? item.Description); + ImGui.TableNextColumn(); + DrawFateRowExpiry(item); + ImGui.TableNextColumn(); + bool disabled = _fateController.IsRunning || _questController.AutomationType != QuestController.EAutomationType.Manual; + DrawFateRowActions(item, disabled); + } + } + finally + { + ((TableDisposable)(ref val)).Dispose(); } } private void DrawFateRowName(FateDefinition fate, bool isActive) { + //IL_006f: Unknown result type (might be due to invalid IL or missing references) + //IL_0074: Unknown result type (might be due to invalid IL or missing references) if (isActive) { float num = (float)ImGui.GetTime(); @@ -281,7 +324,8 @@ internal sealed class FateSelectionWindow : LWindow { return; } - using (ImRaii.Tooltip()) + TooltipDisposable val = ImRaii.Tooltip(); + try { ImGui.TextColored(ImGuiColors.DalamudWhite, fate.Name); ImGui.Separator(); @@ -316,6 +360,10 @@ internal sealed class FateSelectionWindow : LWindow } } } + finally + { + ((TooltipDisposable)(ref val)).Dispose(); + } } private static void DrawFateRowExpiry(FateDefinition fate) @@ -344,17 +392,23 @@ internal sealed class FateSelectionWindow : LWindow private void DrawFateRowActions(FateDefinition fate, bool disabled) { bool flag = fate.RequiredQuestId.HasValue && !_questFunctions.IsQuestComplete(new QuestId(fate.RequiredQuestId.Value)); - ImU8String id = new ImU8String(5, 1); - id.AppendLiteral("fate_"); - id.AppendFormatted(fate.Name); - using (ImRaii.PushId(id)) + ImU8String imU8String = new ImU8String(5, 1); + imU8String.AppendLiteral("fate_"); + imU8String.AppendFormatted(fate.Name); + IdDisposable val = ImRaii.PushId(imU8String, true); + try { if (flag) { - using (ImRaii.PushFont(UiBuilder.IconFont)) + FontDisposable val2 = ImRaii.PushFont(UiBuilder.IconFont, true); + try { ImGui.TextColored(ImGuiColors.DalamudRed, FontAwesomeIcon.Times.ToIconString()); } + finally + { + ((IDisposable)val2)?.Dispose(); + } if (ImGui.IsItemHovered()) { IQuestInfo questInfo; @@ -367,7 +421,8 @@ internal sealed class FateSelectionWindow : LWindow } return; } - using (ImRaii.Disabled(disabled)) + DisabledDisposable val3 = ImRaii.Disabled(disabled); + try { if (ImGuiComponents.IconButton(FontAwesomeIcon.Play)) { @@ -377,6 +432,10 @@ internal sealed class FateSelectionWindow : LWindow _fateController.Start(fate, cycleLimit); } } + finally + { + ((IDisposable)val3)?.Dispose(); + } if (disabled && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { if (_fateController.IsRunning) @@ -389,6 +448,10 @@ internal sealed class FateSelectionWindow : LWindow } } } + finally + { + ((IDisposable)val)?.Dispose(); + } } private static string FormatElapsed(TimeSpan elapsed) diff --git a/Questionable/Questionable.Windows/JournalProgressWindow.cs b/Questionable/Questionable.Windows/JournalProgressWindow.cs index 2614037..5c3b782 100644 --- a/Questionable/Questionable.Windows/JournalProgressWindow.cs +++ b/Questionable/Questionable.Windows/JournalProgressWindow.cs @@ -1,5 +1,6 @@ using System; using System.Numerics; +using Dalamud.Bindings.ImGui; using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Windowing; using Dalamud.Plugin.Services; @@ -28,6 +29,7 @@ internal sealed class JournalProgressWindow : LWindow, IDisposable 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; @@ -42,10 +44,10 @@ internal sealed class JournalProgressWindow : LWindow, IDisposable _clientState.Logout += _questJournalComponent.ClearCounts; _clientState.Logout += _gatheringJournalComponent.ClearCounts; _questRegistry.Reloaded += OnQuestsReloaded; - base.SizeConstraints = new WindowSizeConstraints - { - MinimumSize = new Vector2(700f, 500f) - }; + 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) @@ -67,14 +69,24 @@ internal sealed class JournalProgressWindow : LWindow, IDisposable public override void DrawContent() { - using ImRaii.IEndObject endObject = ImRaii.TabBar("Journal"); - if (!(!endObject)) + //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 { - _questJournalComponent.DrawQuests(); - _dutyJournalComponent.DrawDuties(); - _alliedSocietyJournalComponent.DrawAlliedSocietyQuests(); - _questRewardComponent.DrawItemRewards(); - _gatheringJournalComponent.DrawGatheringItems(); + if (!(!val)) + { + _questJournalComponent.DrawQuests(); + _dutyJournalComponent.DrawDuties(); + _alliedSocietyJournalComponent.DrawAlliedSocietyQuests(); + _questRewardComponent.DrawItemRewards(); + _gatheringJournalComponent.DrawGatheringItems(); + } + } + finally + { + ((TabBarDisposable)(ref val)).Dispose(); } } diff --git a/Questionable/Questionable.Windows/OneTimeSetupWindow.cs b/Questionable/Questionable.Windows/OneTimeSetupWindow.cs index c9115ec..11ab0b0 100644 --- a/Questionable/Questionable.Windows/OneTimeSetupWindow.cs +++ b/Questionable/Questionable.Windows/OneTimeSetupWindow.cs @@ -1,3 +1,4 @@ +using System; using Dalamud.Bindings.ImGui; using Dalamud.Interface; using Dalamud.Interface.Colors; @@ -43,7 +44,8 @@ internal sealed class OneTimeSetupWindow : LWindow ImGui.Spacing(); if (allRequiredInstalled) { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen, true); + try { if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Check, "Finish Setup")) { @@ -53,15 +55,29 @@ internal sealed class OneTimeSetupWindow : LWindow base.IsOpen = false; } } + finally + { + ((IDisposable)val)?.Dispose(); + } } else { - using (ImRaii.Disabled()) + DisabledDisposable val2 = ImRaii.Disabled(); + try { - using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed)) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true); + try { ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Check, "Missing required plugins"); } + finally + { + ((IDisposable)val)?.Dispose(); + } + } + finally + { + ((IDisposable)val2)?.Dispose(); } } ImGui.SameLine(); diff --git a/Questionable/Questionable.Windows/PriorityWindow.cs b/Questionable/Questionable.Windows/PriorityWindow.cs index 5478537..a14f7c3 100644 --- a/Questionable/Questionable.Windows/PriorityWindow.cs +++ b/Questionable/Questionable.Windows/PriorityWindow.cs @@ -33,43 +33,80 @@ internal sealed class PriorityWindow : LWindow public PriorityWindow(QuestController questController, QuestFunctions questFunctions, QuestSelector questSelector, QuestTooltipComponent questTooltipComponent, PresetBuilderComponent presetBuilderComponent, SavedPresetsComponent savedPresetsComponent, UiUtils uiUtils, IChatGui chatGui, IDalamudPluginInterface pluginInterface) : base("Quest Priority###QuestionableQuestPriority") { + //IL_0088: Unknown result type (might be due to invalid IL or missing references) _manualPriorityComponent = new ManualPriorityComponent(questController, questFunctions, questSelector, questTooltipComponent, uiUtils, chatGui, pluginInterface); _presetBuilderComponent = presetBuilderComponent; _savedPresetsComponent = savedPresetsComponent; base.Size = new Vector2(500f, 500f); base.SizeCondition = ImGuiCond.Once; - base.SizeConstraints = new WindowSizeConstraints - { - MinimumSize = new Vector2(615f, 500f), - MaximumSize = new Vector2(800f, 1000f) - }; + WindowSizeConstraints value = default(WindowSizeConstraints); + ((WindowSizeConstraints)(ref value))._002Ector(); + ((WindowSizeConstraints)(ref value)).MinimumSize = new Vector2(615f, 500f); + ((WindowSizeConstraints)(ref value)).MaximumSize = new Vector2(800f, 1000f); + ((Window)this).SizeConstraints = value; } public override void DrawContent() { - using ImRaii.IEndObject endObject = ImRaii.TabBar("PriorityTabs"); - if (!endObject) + //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) + //IL_0027: Unknown result type (might be due to invalid IL or missing references) + //IL_002c: Unknown result type (might be due to invalid IL or missing references) + //IL_002d: Unknown result type (might be due to invalid IL or missing references) + //IL_0054: Unknown result type (might be due to invalid IL or missing references) + //IL_0059: Unknown result type (might be due to invalid IL or missing references) + //IL_005a: Unknown result type (might be due to invalid IL or missing references) + //IL_0081: Unknown result type (might be due to invalid IL or missing references) + //IL_0086: Unknown result type (might be due to invalid IL or missing references) + //IL_0087: Unknown result type (might be due to invalid IL or missing references) + TabBarDisposable val = ImRaii.TabBar((ImU8String)"PriorityTabs"); + try { - return; - } - using (ImRaii.IEndObject endObject2 = ImRaii.TabItem("Manual Priority")) - { - if (endObject2) + if (!val) { - _manualPriorityComponent.Draw(); + return; + } + TabItemDisposable val2 = ImRaii.TabItem((ImU8String)"Manual Priority"); + try + { + if (TabItemDisposable.op_Implicit(val2)) + { + _manualPriorityComponent.Draw(); + } + } + finally + { + ((TabItemDisposable)(ref val2)).Dispose(); + } + TabItemDisposable val3 = ImRaii.TabItem((ImU8String)"Quest Presets"); + try + { + if (TabItemDisposable.op_Implicit(val3)) + { + _presetBuilderComponent.Draw(); + } + } + finally + { + ((TabItemDisposable)(ref val3)).Dispose(); + } + TabItemDisposable val4 = ImRaii.TabItem((ImU8String)"Saved Presets"); + try + { + if (TabItemDisposable.op_Implicit(val4)) + { + _savedPresetsComponent.Draw(); + } + } + finally + { + ((TabItemDisposable)(ref val4)).Dispose(); } } - using (ImRaii.IEndObject endObject3 = ImRaii.TabItem("Quest Presets")) + finally { - if (endObject3) - { - _presetBuilderComponent.Draw(); - } - } - using ImRaii.IEndObject endObject4 = ImRaii.TabItem("Saved Presets"); - if (endObject4) - { - _savedPresetsComponent.Draw(); + ((TabBarDisposable)(ref val)).Dispose(); } } diff --git a/Questionable/Questionable.Windows/QuestSelectionWindow.cs b/Questionable/Questionable.Windows/QuestSelectionWindow.cs index 1bc782d..f0c42cd 100644 --- a/Questionable/Questionable.Windows/QuestSelectionWindow.cs +++ b/Questionable/Questionable.Windows/QuestSelectionWindow.cs @@ -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) diff --git a/Questionable/Questionable.Windows/QuestSequenceWindow.cs b/Questionable/Questionable.Windows/QuestSequenceWindow.cs index 7c2e568..f1d2301 100644 --- a/Questionable/Questionable.Windows/QuestSequenceWindow.cs +++ b/Questionable/Questionable.Windows/QuestSequenceWindow.cs @@ -1,3 +1,4 @@ +using System; using System.Numerics; using Dalamud.Bindings.ImGui; using Dalamud.Interface.Utility.Raii; @@ -24,16 +25,17 @@ internal sealed class QuestSequenceWindow : LWindow, IPersistableWindowConfig 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; - base.SizeConstraints = new WindowSizeConstraints - { - MinimumSize = new Vector2(750f, 550f), - MaximumSize = new Vector2(float.MaxValue, float.MaxValue) - }; + 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() @@ -50,42 +52,83 @@ internal sealed class QuestSequenceWindow : LWindow, IPersistableWindowConfig 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(); - using (ImRaii.PushColor(ImGuiCol.Tab, new Vector4(0.15f, 0.13f, 0.2f, 0.7f))) + ColorDisposable val = ImRaii.PushColor(ImGuiCol.Tab, new Vector4(0.15f, 0.13f, 0.2f, 0.7f), true); + try { - using (ImRaii.PushColor(ImGuiCol.TabHovered, new Vector4(0.35f, 0.3f, 0.45f, 0.9f))) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.TabHovered, new Vector4(0.35f, 0.3f, 0.45f, 0.9f), true); + try { - using (ImRaii.PushColor(ImGuiCol.TabActive, new Vector4(0.28f, 0.24f, 0.35f, 1f))) + ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.TabActive, new Vector4(0.28f, 0.24f, 0.35f, 1f), true); + try { - using ImRaii.IEndObject endObject = ImRaii.TabBar("QuestSequenceTabs", ImGuiTabBarFlags.None); - if (!endObject) + TabBarDisposable val4 = ImRaii.TabBar((ImU8String)"QuestSequenceTabs", ImGuiTabBarFlags.None); + try { - return; - } - using (ImRaii.IEndObject endObject2 = ImRaii.TabItem("Current Quest", ImGuiTabItemFlags.None)) - { - if (endObject2) + if (!val4) { - ImGui.Spacing(); - _questSequenceComponent.DrawCurrentQuestTab(); + return; } - } - ImGuiTabItemFlags flags = (_selectLookupTabNextFrame ? ImGuiTabItemFlags.SetSelected : ImGuiTabItemFlags.None); - using (ImRaii.IEndObject endObject3 = ImRaii.TabItem("Quest Lookup", flags)) - { - if (endObject3) + TabItemDisposable val5 = ImRaii.TabItem((ImU8String)"Current Quest", ImGuiTabItemFlags.None); + try { - ImGui.Spacing(); - _questSequenceComponent.DrawQuestLookupTab(); + 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; } - _selectLookupTabNextFrame = false; + finally + { + ((TabBarDisposable)(ref val4)).Dispose(); + } + } + finally + { + ((IDisposable)val3)?.Dispose(); } } + finally + { + ((IDisposable)val2)?.Dispose(); + } + } + finally + { + ((IDisposable)val)?.Dispose(); } QuestSequenceComponent.DrawWindowBorder(); } diff --git a/Questionable/Questionable.Windows/QuestValidationWindow.cs b/Questionable/Questionable.Windows/QuestValidationWindow.cs index 0b75078..c599939 100644 --- a/Questionable/Questionable.Windows/QuestValidationWindow.cs +++ b/Questionable/Questionable.Windows/QuestValidationWindow.cs @@ -20,15 +20,16 @@ internal sealed class QuestValidationWindow : LWindow, IPersistableWindowConfig public QuestValidationWindow(QuestValidationComponent questValidationComponent, IDalamudPluginInterface pluginInterface, Configuration configuration) : base("Quest Validation###QuestionableValidator") { + //IL_0061: Unknown result type (might be due to invalid IL or missing references) _questValidationComponent = questValidationComponent; _pluginInterface = pluginInterface; _configuration = configuration; base.Size = new Vector2(800f, 400f); base.SizeCondition = ImGuiCond.FirstUseEver; - base.SizeConstraints = new WindowSizeConstraints - { - MinimumSize = new Vector2(600f, 300f) - }; + WindowSizeConstraints value = default(WindowSizeConstraints); + ((WindowSizeConstraints)(ref value))._002Ector(); + ((WindowSizeConstraints)(ref value)).MinimumSize = new Vector2(600f, 300f); + ((Window)this).SizeConstraints = value; } public void SaveWindowConfig() diff --git a/Questionable/Questionable.Windows/QuestWindow.cs b/Questionable/Questionable.Windows/QuestWindow.cs index ba096c6..b28e1d9 100644 --- a/Questionable/Questionable.Windows/QuestWindow.cs +++ b/Questionable/Questionable.Windows/QuestWindow.cs @@ -57,6 +57,21 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig public QuestWindow(IDalamudPluginInterface pluginInterface, QuestController questController, IObjectTable objectTable, IClientState clientState, Configuration configuration, TerritoryData territoryData, ActiveQuestComponent activeQuestComponent, ARealmRebornComponent aRealmRebornComponent, EventInfoComponent eventInfoComponent, CreationUtilsComponent creationUtilsComponent, QuickAccessButtonsComponent quickAccessButtonsComponent, RemainingTasksComponent remainingTasksComponent, IFramework framework, InteractionUiController interactionUiController, ConfigWindow configWindow) : base("Questionable v" + PluginVersion.ToString(3) + "###Questionable", ImGuiWindowFlags.AlwaysAutoResize) { + //IL_00d3: Unknown result type (might be due to invalid IL or missing references) + //IL_00ed: Unknown result type (might be due to invalid IL or missing references) + //IL_00f2: Unknown result type (might be due to invalid IL or missing references) + //IL_00fd: Unknown result type (might be due to invalid IL or missing references) + //IL_0108: Unknown result type (might be due to invalid IL or missing references) + //IL_011d: Unknown result type (might be due to invalid IL or missing references) + //IL_012f: Unknown result type (might be due to invalid IL or missing references) + //IL_013b: Expected O, but got Unknown + //IL_0153: Unknown result type (might be due to invalid IL or missing references) + //IL_0158: Unknown result type (might be due to invalid IL or missing references) + //IL_0163: Unknown result type (might be due to invalid IL or missing references) + //IL_0178: Unknown result type (might be due to invalid IL or missing references) + //IL_018a: Unknown result type (might be due to invalid IL or missing references) + //IL_0195: Unknown result type (might be due to invalid IL or missing references) + //IL_01bf: Expected O, but got Unknown QuestWindow questWindow = this; _pluginInterface = pluginInterface; _questController = questController; @@ -72,11 +87,11 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig _remainingTasksComponent = remainingTasksComponent; _framework = framework; _interactionUiController = interactionUiController; - base.SizeConstraints = new WindowSizeConstraints - { - MinimumSize = new Vector2(240f, 30f), - MaximumSize = default(Vector2) - }; + WindowSizeConstraints value = default(WindowSizeConstraints); + ((WindowSizeConstraints)(ref value))._002Ector(); + ((WindowSizeConstraints)(ref value)).MinimumSize = new Vector2(240f, 30f); + ((WindowSizeConstraints)(ref value)).MaximumSize = default(Vector2); + ((Window)this).SizeConstraints = value; base.RespectCloseHotkey = false; base.AllowClickthrough = false; _minimizeButton = new TitleBarButton @@ -91,8 +106,8 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig }, AvailableClickthrough = true }; - base.TitleBarButtons.Insert(0, _minimizeButton); - base.TitleBarButtons.Add(new TitleBarButton + ((Window)this).TitleBarButtons.Insert(0, _minimizeButton); + ((Window)this).TitleBarButtons.Add(new TitleBarButton { Icon = FontAwesomeIcon.Cog, IconOffset = new Vector2(1.5f, 1f), diff --git a/Questionable/Questionable.Windows/SeasonalDutySelectionWindow.cs b/Questionable/Questionable.Windows/SeasonalDutySelectionWindow.cs index d2c6789..93096b7 100644 --- a/Questionable/Questionable.Windows/SeasonalDutySelectionWindow.cs +++ b/Questionable/Questionable.Windows/SeasonalDutySelectionWindow.cs @@ -43,6 +43,7 @@ internal sealed class SeasonalDutySelectionWindow : LWindow public SeasonalDutySelectionWindow(SeasonalDutyController seasonalDutyController, SeasonalDutyDefinitionRegistry seasonalDutyDefinitionRegistry, QuestController questController, FateController fateController, MovementController movementController, QuestFunctions questFunctions, QuestData questData, TerritoryData territoryData) : base("Seasonal Duty Farming###QuestionableSeasonalDutyFarming") { + //IL_009f: Unknown result type (might be due to invalid IL or missing references) _seasonalDutyController = seasonalDutyController; _seasonalDutyDefinitionRegistry = seasonalDutyDefinitionRegistry; _questController = questController; @@ -53,11 +54,11 @@ internal sealed class SeasonalDutySelectionWindow : LWindow _territoryData = territoryData; base.Size = new Vector2(600f, 400f); base.SizeCondition = ImGuiCond.FirstUseEver; - base.SizeConstraints = new WindowSizeConstraints - { - MinimumSize = new Vector2(500f, 300f), - MaximumSize = new Vector2(900f, 700f) - }; + WindowSizeConstraints value = default(WindowSizeConstraints); + ((WindowSizeConstraints)(ref value))._002Ector(); + ((WindowSizeConstraints)(ref value)).MinimumSize = new Vector2(500f, 300f); + ((WindowSizeConstraints)(ref value)).MaximumSize = new Vector2(900f, 700f); + ((Window)this).SizeConstraints = value; } public override void DrawContent() @@ -93,18 +94,26 @@ internal sealed class SeasonalDutySelectionWindow : LWindow float num2 = (float)ImGui.GetTime(); float num3 = 0.85f + MathF.Sin(num2 * 3f) * 0.15f; Vector4 col = new Vector4(0f, 1f * num3, 0.3f * num3, 1f); - using (ImRaii.PushFont(UiBuilder.IconFont)) + FontDisposable val = ImRaii.PushFont(UiBuilder.IconFont, true); + try { ImGui.TextColored(in col, FontAwesomeIcon.Leaf.ToIconString()); } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.SameLine(); ImGui.TextColored(ImGuiColors.ParsedGreen, _seasonalDutyController.CurrentDuty.Name); ImGui.SameLine(x - 35f); - using (ImRaii.PushColor(ImGuiCol.Button, Vector4.Zero)) + ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Button, Vector4.Zero, true); + try { - using (ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.8f, 0.3f, 0.3f, 0.4f))) + ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.8f, 0.3f, 0.3f, 0.4f), true); + try { - using (ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.9f, 0.2f, 0.2f, 0.6f))) + ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.9f, 0.2f, 0.2f, 0.6f), true); + try { if (ImGuiComponents.IconButton(FontAwesomeIcon.Stop)) { @@ -112,7 +121,19 @@ internal sealed class SeasonalDutySelectionWindow : LWindow _movementController.Stop(); } } + finally + { + ((IDisposable)val4)?.Dispose(); + } } + finally + { + ((IDisposable)val3)?.Dispose(); + } + } + finally + { + ((IDisposable)val2)?.Dispose(); } ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 8f); string value = (_seasonalDutyController.CycleLimit.HasValue ? $"Cycle {_seasonalDutyController.CompletedCycles + 1} / {_seasonalDutyController.CycleLimit}" : $"Cycle {_seasonalDutyController.CompletedCycles + 1}"); @@ -140,7 +161,8 @@ internal sealed class SeasonalDutySelectionWindow : LWindow ImGui.TextColored(in col2, text3); } ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 8f); - using (ImRaii.Disabled(disabled: true)) + DisabledDisposable val5 = ImRaii.Disabled(true); + try { ImGui.AlignTextToFramePadding(); ImGui.TextUnformatted("Cycles:"); @@ -148,13 +170,18 @@ internal sealed class SeasonalDutySelectionWindow : LWindow ImGui.SetNextItemWidth(100f); ImGui.InputInt("##CycleLimitRunning", ref _cycleLimit, 1, 5); } + finally + { + ((IDisposable)val5)?.Dispose(); + } ImGui.SetCursorPosY(cursorScreenPos.Y + num - ImGui.GetCursorScreenPos().Y + ImGui.GetCursorPosY() + 4f); ImGui.Spacing(); } private void DrawControlsStrip() { - using (ImRaii.Disabled(_seasonalDutyController.IsRunning)) + DisabledDisposable val = ImRaii.Disabled(_seasonalDutyController.IsRunning); + try { ImGui.AlignTextToFramePadding(); ImGui.TextUnformatted("Cycles:"); @@ -168,6 +195,10 @@ internal sealed class SeasonalDutySelectionWindow : LWindow ImGui.SameLine(); ImGui.TextColored(ImGuiColors.DalamudGrey, (_cycleLimit == 0) ? "(unlimited)" : ""); } + finally + { + ((IDisposable)val)?.Dispose(); + } ImGui.Spacing(); } @@ -209,6 +240,9 @@ internal sealed class SeasonalDutySelectionWindow : LWindow private void DrawDutyTable() { + //IL_0097: Unknown result type (might be due to invalid IL or missing references) + //IL_009c: Unknown result type (might be due to invalid IL or missing references) + //IL_009d: Unknown result type (might be due to invalid IL or missing references) List list = _seasonalDutyDefinitionRegistry.Definitions.Values.OrderBy(delegate(SeasonalDutyDefinition d) { DateTime? eventExpiry = d.EventExpiry; @@ -236,40 +270,49 @@ internal sealed class SeasonalDutySelectionWindow : LWindow return double.MaxValue; }).ThenBy((SeasonalDutyDefinition d) => d.Name, StringComparer.OrdinalIgnoreCase) .ToList(); - using ImRaii.IEndObject endObject = ImRaii.Table("SeasonalDutyTable", 4, ImGuiTableFlags.SizingStretchProp | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerH | ImGuiTableFlags.ScrollY); - if (!endObject) + TableDisposable val = ImRaii.Table((ImU8String)"SeasonalDutyTable", 4, ImGuiTableFlags.SizingStretchProp | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerH | ImGuiTableFlags.ScrollY); + try { - return; - } - ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.None, 3f); - ImGui.TableSetupColumn("Zone", ImGuiTableColumnFlags.None, 2f); - ImGui.TableSetupColumn("Expiry", ImGuiTableColumnFlags.WidthFixed, 80f); - ImGui.TableSetupColumn("##Actions", ImGuiTableColumnFlags.WidthFixed, 30f); - ImGui.TableHeadersRow(); - foreach (SeasonalDutyDefinition item in list) - { - ImGui.TableNextRow(); - bool flag = _seasonalDutyController.IsRunning && _seasonalDutyController.CurrentDuty == item; - if (flag) + if (!val) { - float num = (float)ImGui.GetTime(); - float w = 0.1f + MathF.Sin(num * 2.5f) * 0.05f; - ImGui.TableSetBgColor(ImGuiTableBgTarget.RowBg1, ImGui.GetColorU32(new Vector4(0f, 0.85f, 0.3f, w))); + return; } - ImGui.TableNextColumn(); - DrawDutyRowName(item, flag); - ImGui.TableNextColumn(); - ImGui.TextUnformatted(_territoryData.GetName(item.TerritoryId) ?? item.Name); - ImGui.TableNextColumn(); - DrawDutyRowExpiry(item); - ImGui.TableNextColumn(); - bool disabled = _seasonalDutyController.IsRunning || _fateController.IsRunning || _questController.AutomationType != QuestController.EAutomationType.Manual; - DrawDutyRowActions(item, disabled); + ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.None, 3f); + ImGui.TableSetupColumn("Zone", ImGuiTableColumnFlags.None, 2f); + ImGui.TableSetupColumn("Expiry", ImGuiTableColumnFlags.WidthFixed, 80f); + ImGui.TableSetupColumn("##Actions", ImGuiTableColumnFlags.WidthFixed, 30f); + ImGui.TableHeadersRow(); + foreach (SeasonalDutyDefinition item in list) + { + ImGui.TableNextRow(); + bool flag = _seasonalDutyController.IsRunning && _seasonalDutyController.CurrentDuty == item; + if (flag) + { + float num = (float)ImGui.GetTime(); + float w = 0.1f + MathF.Sin(num * 2.5f) * 0.05f; + ImGui.TableSetBgColor(ImGuiTableBgTarget.RowBg1, ImGui.GetColorU32(new Vector4(0f, 0.85f, 0.3f, w))); + } + ImGui.TableNextColumn(); + DrawDutyRowName(item, flag); + ImGui.TableNextColumn(); + ImGui.TextUnformatted(_territoryData.GetName(item.TerritoryId) ?? item.Name); + ImGui.TableNextColumn(); + DrawDutyRowExpiry(item); + ImGui.TableNextColumn(); + bool disabled = _seasonalDutyController.IsRunning || _fateController.IsRunning || _questController.AutomationType != QuestController.EAutomationType.Manual; + DrawDutyRowActions(item, disabled); + } + } + finally + { + ((TableDisposable)(ref val)).Dispose(); } } private void DrawDutyRowName(SeasonalDutyDefinition duty, bool isActive) { + //IL_006f: Unknown result type (might be due to invalid IL or missing references) + //IL_0074: Unknown result type (might be due to invalid IL or missing references) if (isActive) { float num = (float)ImGui.GetTime(); @@ -284,7 +327,8 @@ internal sealed class SeasonalDutySelectionWindow : LWindow { return; } - using (ImRaii.Tooltip()) + TooltipDisposable val = ImRaii.Tooltip(); + try { ImGui.TextColored(ImGuiColors.DalamudWhite, duty.Name); ImGui.Separator(); @@ -307,6 +351,10 @@ internal sealed class SeasonalDutySelectionWindow : LWindow } } } + finally + { + ((TooltipDisposable)(ref val)).Dispose(); + } } private static void DrawDutyRowExpiry(SeasonalDutyDefinition duty) @@ -335,17 +383,23 @@ internal sealed class SeasonalDutySelectionWindow : LWindow private void DrawDutyRowActions(SeasonalDutyDefinition duty, bool disabled) { bool flag = duty.RequiredQuestId.HasValue && !_questFunctions.IsQuestComplete(new QuestId(duty.RequiredQuestId.Value)); - ImU8String id = new ImU8String(5, 1); - id.AppendLiteral("duty_"); - id.AppendFormatted(duty.Name); - using (ImRaii.PushId(id)) + ImU8String imU8String = new ImU8String(5, 1); + imU8String.AppendLiteral("duty_"); + imU8String.AppendFormatted(duty.Name); + IdDisposable val = ImRaii.PushId(imU8String, true); + try { if (flag) { - using (ImRaii.PushFont(UiBuilder.IconFont)) + FontDisposable val2 = ImRaii.PushFont(UiBuilder.IconFont, true); + try { ImGui.TextColored(ImGuiColors.DalamudRed, FontAwesomeIcon.Times.ToIconString()); } + finally + { + ((IDisposable)val2)?.Dispose(); + } if (ImGui.IsItemHovered()) { IQuestInfo questInfo; @@ -358,7 +412,8 @@ internal sealed class SeasonalDutySelectionWindow : LWindow } return; } - using (ImRaii.Disabled(disabled)) + DisabledDisposable val3 = ImRaii.Disabled(disabled); + try { if (ImGuiComponents.IconButton(FontAwesomeIcon.Play)) { @@ -369,6 +424,10 @@ internal sealed class SeasonalDutySelectionWindow : LWindow _seasonalDutyController.Start(duty, cycleLimit); } } + finally + { + ((IDisposable)val3)?.Dispose(); + } if (disabled && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) { if (_seasonalDutyController.IsRunning) @@ -385,6 +444,10 @@ internal sealed class SeasonalDutySelectionWindow : LWindow } } } + finally + { + ((IDisposable)val)?.Dispose(); + } } private static string FormatElapsed(TimeSpan elapsed) diff --git a/Questionable/Questionable/DalamudInitializer.cs b/Questionable/Questionable/DalamudInitializer.cs index 154f2a9..b3181dd 100644 --- a/Questionable/Questionable/DalamudInitializer.cs +++ b/Questionable/Questionable/DalamudInitializer.cs @@ -57,18 +57,18 @@ internal sealed class DalamudInitializer : IDisposable _configuration = configuration; _partyWatchdog = partyWatchdog; _logger = logger; - _windowSystem.AddWindow(oneTimeSetupWindow); - _windowSystem.AddWindow(questWindow); - _windowSystem.AddWindow(configWindow); - _windowSystem.AddWindow(debugOverlay); - _windowSystem.AddWindow(questSelectionWindow); - _windowSystem.AddWindow(questSequenceWindow); - _windowSystem.AddWindow(questValidationWindow); - _windowSystem.AddWindow(journalProgressWindow); - _windowSystem.AddWindow(priorityWindow); - _windowSystem.AddWindow(fateSelectionWindow); - _windowSystem.AddWindow(seasonalDutySelectionWindow); - _windowSystem.AddWindow(changelogWindow); + _windowSystem.AddWindow((IWindow)(object)oneTimeSetupWindow); + _windowSystem.AddWindow((IWindow)(object)questWindow); + _windowSystem.AddWindow((IWindow)(object)configWindow); + _windowSystem.AddWindow((IWindow)(object)debugOverlay); + _windowSystem.AddWindow((IWindow)(object)questSelectionWindow); + _windowSystem.AddWindow((IWindow)(object)questSequenceWindow); + _windowSystem.AddWindow((IWindow)(object)questValidationWindow); + _windowSystem.AddWindow((IWindow)(object)journalProgressWindow); + _windowSystem.AddWindow((IWindow)(object)priorityWindow); + _windowSystem.AddWindow((IWindow)(object)fateSelectionWindow); + _windowSystem.AddWindow((IWindow)(object)seasonalDutySelectionWindow); + _windowSystem.AddWindow((IWindow)(object)changelogWindow); _pluginInterface.UiBuilder.Draw += _windowSystem.Draw; _pluginInterface.UiBuilder.OpenMainUi += ToggleQuestWindow; _pluginInterface.UiBuilder.OpenConfigUi += _configWindow.Toggle; diff --git a/Questionable/System.Text.RegularExpressions.Generated/-RegexGenerator_g-FBB8301322196CF81C64F1652C2FA6E1D6BF3907141F781E9D97ABED51BF056C4__MultipleWhitespaceRegex_0.cs b/Questionable/System.Text.RegularExpressions.Generated/-RegexGenerator_g-FBB8301322196CF81C64F1652C2FA6E1D6BF3907141F781E9D97ABED51BF056C4__MultipleWhitespaceRegex_0.cs index 38e6923..0e92731 100644 --- a/Questionable/System.Text.RegularExpressions.Generated/-RegexGenerator_g-FBB8301322196CF81C64F1652C2FA6E1D6BF3907141F781E9D97ABED51BF056C4__MultipleWhitespaceRegex_0.cs +++ b/Questionable/System.Text.RegularExpressions.Generated/-RegexGenerator_g-FBB8301322196CF81C64F1652C2FA6E1D6BF3907141F781E9D97ABED51BF056C4__MultipleWhitespaceRegex_0.cs @@ -3,7 +3,7 @@ using System.Runtime.CompilerServices; namespace System.Text.RegularExpressions.Generated; -[GeneratedCode("System.Text.RegularExpressions.Generator", "10.0.14.15411")] +[GeneratedCode("System.Text.RegularExpressions.Generator", "10.0.14.21808")] [SkipLocalsInit] internal sealed class _003CRegexGenerator_g_003EFBB8301322196CF81C64F1652C2FA6E1D6BF3907141F781E9D97ABED51BF056C4__MultipleWhitespaceRegex_0 : Regex { diff --git a/Questionable/System.Text.RegularExpressions.Generated/-RegexGenerator_g-FBB8301322196CF81C64F1652C2FA6E1D6BF3907141F781E9D97ABED51BF056C4__Utilities.cs b/Questionable/System.Text.RegularExpressions.Generated/-RegexGenerator_g-FBB8301322196CF81C64F1652C2FA6E1D6BF3907141F781E9D97ABED51BF056C4__Utilities.cs index a6aa892..7a2aac4 100644 --- a/Questionable/System.Text.RegularExpressions.Generated/-RegexGenerator_g-FBB8301322196CF81C64F1652C2FA6E1D6BF3907141F781E9D97ABED51BF056C4__Utilities.cs +++ b/Questionable/System.Text.RegularExpressions.Generated/-RegexGenerator_g-FBB8301322196CF81C64F1652C2FA6E1D6BF3907141F781E9D97ABED51BF056C4__Utilities.cs @@ -3,7 +3,7 @@ using System.CodeDom.Compiler; namespace System.Text.RegularExpressions.Generated; -[GeneratedCode("System.Text.RegularExpressions.Generator", "10.0.14.15411")] +[GeneratedCode("System.Text.RegularExpressions.Generator", "10.0.14.21808")] internal static class _003CRegexGenerator_g_003EFBB8301322196CF81C64F1652C2FA6E1D6BF3907141F781E9D97ABED51BF056C4__Utilities { internal static readonly TimeSpan s_defaultTimeout = ((AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeSpan) ? timeSpan : Regex.InfiniteMatchTimeout);