using System.Numerics; using Dalamud.Bindings.ImGui; using Dalamud.Interface; using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Windowing; using Dalamud.Plugin; using LLib.ImGui; using Questionable.Windows.ConfigComponents; namespace Questionable.Windows; internal sealed class ConfigWindow : LWindow, IPersistableWindowConfig { private readonly IDalamudPluginInterface _pluginInterface; private readonly GeneralConfigComponent _generalConfigComponent; private readonly PluginConfigComponent _pluginConfigComponent; private readonly DutyConfigComponent _dutyConfigComponent; private readonly SinglePlayerDutyConfigComponent _singlePlayerDutyConfigComponent; private readonly StopConditionComponent _stopConditionComponent; private readonly BlacklistConfigComponent _blacklistConfigComponent; private readonly NotificationConfigComponent _notificationConfigComponent; private readonly DebugConfigComponent _debugConfigComponent; private readonly Configuration _configuration; public WindowConfig WindowConfig => _configuration.ConfigWindowConfig; 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; _dutyConfigComponent = dutyConfigComponent; _singlePlayerDutyConfigComponent = singlePlayerDutyConfigComponent; _stopConditionComponent = stopConditionComponent; _blacklistConfigComponent = blacklistConfigComponent; _notificationConfigComponent = notificationConfigComponent; _debugConfigComponent = debugConfigComponent; _configuration = configuration; ((Window)this).TitleBarButtons.Add(new TitleBarButton { Icon = FontAwesomeIcon.FileAlt, IconOffset = new Vector2(1.5f, 1f), Click = delegate { changelogWindow.IsOpenAndUncollapsed = true; }, ShowTooltip = delegate { ImGui.BeginTooltip(); ImGui.Text("View Changelog"); ImGui.EndTooltip(); } }); } public override void DrawContent() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) TabBarDisposable val = ImRaii.TabBar((ImU8String)"QuestionableConfigTabs"); try { if (!(!val)) { _generalConfigComponent.DrawTab(); _pluginConfigComponent.DrawTab(); _dutyConfigComponent.DrawTab(); _singlePlayerDutyConfigComponent.DrawTab(); _stopConditionComponent.DrawTab(); _blacklistConfigComponent.DrawTab(); _notificationConfigComponent.DrawTab(); _debugConfigComponent.DrawTab(); } } finally { ((TabBarDisposable)(ref val)).Dispose(); } } public void SaveWindowConfig() { _pluginInterface.SavePluginConfig(_configuration); } }