using System; using System.Collections.Generic; using Dalamud.Configuration; using Dalamud.Game.Text; using FFXIVClientStructs.FFXIV.Client.UI.Agent; using LLib.GameData; using LLib.ImGui; using Newtonsoft.Json; using Questionable.Model.Questing; namespace Questionable; internal sealed class Configuration : IPluginConfiguration { internal sealed class GeneralConfiguration { public ECombatModule CombatModule { get; set; } public uint MountId { get; set; } = 71u; public GrandCompany GrandCompany { get; set; } public EClassJob CombatJob { get; set; } public bool HideInAllInstances { get; set; } = true; public bool UseEscToCancelQuesting { get; set; } = true; public bool ShowIncompleteSeasonalEvents { get; set; } = true; public bool SkipLowPriorityDuties { get; set; } public bool ConfigureTextAdvance { get; set; } = true; public bool CinemaMode { get; set; } public bool AutoStepRefreshEnabled { get; set; } = true; public int AutoStepRefreshDelaySeconds { get; set; } = 60; public bool HideSeasonalEventsFromJournalProgress { get; set; } public bool ClearPriorityQuestsOnLogout { get; set; } public bool ClearPriorityQuestsOnCompletion { get; set; } public bool ShowChangelogOnUpdate { get; set; } = true; public bool StopOnPlayerInput { get; set; } } internal sealed class StopConfiguration { public bool Enabled { get; set; } [JsonProperty(ItemConverterType = typeof(ElementIdNConverter))] public List QuestsToStopAfter { get; set; } = new List(); public Dictionary QuestSequences { get; set; } = new Dictionary(); public Dictionary QuestStopModes { get; set; } = new Dictionary(); public EStopConditionMode LevelStopMode { get; set; } public int TargetLevel { get; set; } = 50; public EStopConditionMode SequenceStopMode { get; set; } public int TargetSequence { get; set; } = 1; } internal sealed class DutyConfiguration { public bool RunInstancedContentWithAutoDuty { get; set; } public HashSet WhitelistedDutyCfcIds { get; set; } = new HashSet(); public HashSet BlacklistedDutyCfcIds { get; set; } = new HashSet(); public EDutyMode DefaultDutyMode { get; set; } public Dictionary DutyModeOverrides { get; set; } = new Dictionary(); public Dictionary ExpansionHeaderStates { get; set; } = new Dictionary(); public bool RunLevelingModeWhenUnderleveled { get; set; } } internal sealed class SinglePlayerDutyConfiguration { public bool RunSoloInstancesWithBossMod { get; set; } public byte RetryDifficulty => 0; public HashSet WhitelistedSinglePlayerDutyCfcIds { get; set; } = new HashSet(); public HashSet BlacklistedSinglePlayerDutyCfcIds { get; set; } = new HashSet(); public Dictionary HeaderStates { get; set; } = new Dictionary(); } internal sealed class NotificationConfiguration { public bool Enabled { get; set; } = true; public XivChatType ChatType { get; set; } = XivChatType.Debug; } internal sealed class AdvancedConfiguration { public bool DebugOverlay { get; set; } public bool CombatDataOverlay { get; set; } public bool NeverFly { get; set; } public bool AdditionalStatusInformation { get; set; } public bool DisablePartyWatchdog { get; set; } public bool DisableAutoDutyBareMode { get; set; } public bool SkipAetherCurrents { get; set; } public bool SkipClassJobQuests { get; set; } public bool SkipARealmRebornHardModePrimals { get; set; } public bool SkipCrystalTowerRaids { get; set; } public bool PreventQuestCompletion { get; set; } } internal enum ECombatModule { None, BossMod, WrathCombo, RotationSolverReborn } internal enum EStopConditionMode { Off, Pause, Stop } public sealed class ElementIdNConverter : JsonConverter { public override void WriteJson(JsonWriter writer, ElementId? value, JsonSerializer serializer) { writer.WriteValue(value?.ToString()); } public override ElementId? ReadJson(JsonReader reader, Type objectType, ElementId? existingValue, bool hasExistingValue, JsonSerializer serializer) { string text = reader.Value?.ToString(); if (text == null) { return null; } return ElementId.FromString(text); } } public const int PluginSetupVersion = 5; public int Version { get; set; } = 1; public int PluginSetupCompleteVersion { get; set; } public string? LastViewedChangelogVersion { get; set; } public GeneralConfiguration General { get; } = new GeneralConfiguration(); public StopConfiguration Stop { get; } = new StopConfiguration(); public DutyConfiguration Duties { get; } = new DutyConfiguration(); public SinglePlayerDutyConfiguration SinglePlayerDuties { get; } = new SinglePlayerDutyConfiguration(); public NotificationConfiguration Notifications { get; } = new NotificationConfiguration(); public AdvancedConfiguration Advanced { get; } = new AdvancedConfiguration(); public WindowConfig DebugWindowConfig { get; } = new WindowConfig(); public WindowConfig ConfigWindowConfig { get; } = new WindowConfig(); public WindowConfig QuestValidationWindowConfig { get; set; } = new WindowConfig(); public WindowConfig QuestSequenceWindowConfig { get; set; } = new WindowConfig(); internal bool IsPluginSetupComplete() { return PluginSetupCompleteVersion == 5; } internal void MarkPluginSetupComplete() { PluginSetupCompleteVersion = 5; } }