From 10c201381a709675cfcd3f500e6f840fd357a30e Mon Sep 17 00:00:00 2001 From: Ethan Henderson Date: Fri, 15 Nov 2024 21:29:18 -0700 Subject: [PATCH 1/7] Add Content Difficulty Filtering, UI components to select it, and updated `UserBoolArray` to support default values --- XIVSlothCombo/CustomCombo/Functions/Config.cs | 16 +- XIVSlothCombo/Data/ContentCheck.cs | 320 ++++++++++++++++++ XIVSlothCombo/Window/Functions/UserConfig.cs | 123 +++++++ 3 files changed, 457 insertions(+), 2 deletions(-) create mode 100644 XIVSlothCombo/Data/ContentCheck.cs diff --git a/XIVSlothCombo/CustomCombo/Functions/Config.cs b/XIVSlothCombo/CustomCombo/Functions/Config.cs index a318e502c..93072d7f7 100644 --- a/XIVSlothCombo/CustomCombo/Functions/Config.cs +++ b/XIVSlothCombo/CustomCombo/Functions/Config.cs @@ -132,8 +132,21 @@ public int this[int index] } } - internal class UserBoolArray(string v) : UserData(v) + internal class UserBoolArray : UserData { + // Constructor with only the string parameter + public UserBoolArray(string v) : this(v, []) { } + + // Constructor with both string and bool array parameters + public UserBoolArray(string v, bool[] defaults) : base(v) + { + if (!PluginConfiguration.CustomBoolArrayValues.ContainsKey(this.pName)) + { + PluginConfiguration.SetCustomBoolArrayValue(this.pName, defaults); + Service.Configuration.Save(); + } + } + public int Count => PluginConfiguration.GetCustomBoolArrayValue(this.pName).Length; public static implicit operator bool[](UserBoolArray o) => PluginConfiguration.GetCustomBoolArrayValue(o.pName); public bool this[int index] @@ -156,7 +169,6 @@ public bool All(Func predicate) { var array = PluginConfiguration.GetCustomBoolArrayValue(this.pName); return array.All(predicate); - } } diff --git a/XIVSlothCombo/Data/ContentCheck.cs b/XIVSlothCombo/Data/ContentCheck.cs new file mode 100644 index 000000000..34bf2eda8 --- /dev/null +++ b/XIVSlothCombo/Data/ContentCheck.cs @@ -0,0 +1,320 @@ +#region + +using System.Collections.Generic; +using System.Linq; +using ECommons.GameHelpers; + +#endregion + +namespace XIVSlothCombo.Data; + +public class ContentCheck +{ + /// + /// Whether the current content is considered casual. + /// + /// + /// If the + /// + /// determined difficulty + /// + /// is in the list of . + /// + /// + /// The rest of the list set would be checked by + /// . + /// + /// + public static bool IsInCasualContent() => + CasualContent.Contains( + Content.ContentDifficulty ?? ContentDifficulty.Unknown + ); + + /// + /// Whether the current content is considered hard. + /// + /// + /// If the + /// + /// determined difficulty + /// + /// is in the list of . + /// + /// + /// The rest of the list set would be checked by + /// . + /// + /// + public static bool IsInHardContent() => + HardContent.Contains( + Content.ContentDifficulty ?? ContentDifficulty.Unknown + ); + + /// + /// Whether the current content is in the bottom half of the list of content + /// difficulties. + /// + /// + /// If the + /// + /// determined difficulty + /// + /// is in the list of . + /// + /// + /// The rest of the list set would be checked by + /// . + /// + /// + public static bool IsInBottomHalfContent() => + BottomHalfContent.Contains( + Content.ContentDifficulty ?? ContentDifficulty.Unknown + ); + + /// + /// Whether the current content is in the top half of the list of content + /// difficulties. + /// + /// + /// If the + /// + /// determined difficulty + /// + /// is in the list of . + /// + /// + /// The rest of the list set would be checked by + /// . + /// + /// + public static bool IsInTopHalfContent() => + TopHalfContent.Contains( + Content.ContentDifficulty ?? ContentDifficulty.Unknown + ); + + /// + /// Whether the current content is considered soft-core. + /// + /// + /// If the + /// + /// determined difficulty + /// + /// is in the list of . + /// + /// + /// The rest of the list set would be and + /// . + /// + /// + public static bool IsInSoftCoreContent() => + SoftCoreContent.Contains( + Content.ContentDifficulty ?? ContentDifficulty.Unknown + ); + + /// + /// Whether the current content is considered mid-core. + /// + /// + /// If the + /// + /// determined difficulty + /// + /// is in the list of . + /// + /// + /// The rest of the list set would be and + /// . + /// + /// + public static bool IsInMidCoreContent() => + MidCoreContent.Contains( + Content.ContentDifficulty ?? ContentDifficulty.Unknown + ); + + /// + /// Whether the current content is considered hard-core. + /// + /// + /// If the + /// + /// determined difficulty + /// + /// is in the list of . + /// + /// + /// The rest of the list set would be and + /// . + /// + /// + public static bool IsInHardCoreContent() => + HardCoreContent.Contains( + Content.ContentDifficulty ?? ContentDifficulty.Unknown + ); + + #region Halved Content Lists + + /// + /// Roughly the bottom half of the list of content difficulties. + /// + /// + /// The rest of the list set would be . + /// + private static readonly List BottomHalfContent = + [ + ContentDifficulty.Normal, + ContentDifficulty.Hard, + ContentDifficulty.Unreal, + ContentDifficulty.FieldRaidsSavage, + ]; + + /// + /// A string representation of the bottom half of the list of content + /// difficulties. + /// + /// + public static readonly string BottomHalfContentList = + string.Join(", ", BottomHalfContent.Select(x => x.ToString())); + + /// + /// Roughly the top half of the list of content difficulties. + /// + /// + /// The rest of the list set would be . + /// + private static readonly List TopHalfContent = + [ + ContentDifficulty.Chaotic, + ContentDifficulty.Criterion, + ContentDifficulty.Extreme, + ContentDifficulty.Savage, + ContentDifficulty.CriterionSavage, + ContentDifficulty.Ultimate + ]; + + /// + /// A string representation of the top half of the list of content + /// difficulties. + /// + /// + public static readonly string TopHalfContentList = + string.Join(", ", TopHalfContent.Select(x => x.ToString())); + + #endregion + + #region Casual vs Hard Content Lists + + /// + /// A list of content difficulties that are considered casual. + /// + /// + /// The rest of the list set would be . + /// + private static readonly List CasualContent = + [ + ContentDifficulty.Normal, + ContentDifficulty.Hard, + ]; + + /// + /// A string representation of the list of casual content difficulties. + /// + /// + public static readonly string CasualContentList = + string.Join(", ", CasualContent.Select(x => x.ToString())); + + /// + /// A list of content difficulties that are considered not casual. + /// + /// + /// The rest of the list set would be . + /// + private static readonly List HardContent = + [ + ContentDifficulty.Unreal, + ContentDifficulty.FieldRaidsSavage, + ContentDifficulty.Chaotic, + ContentDifficulty.Criterion, + ContentDifficulty.Extreme, + ContentDifficulty.Savage, + ContentDifficulty.CriterionSavage, + ContentDifficulty.Ultimate + ]; + + /// + /// A string representation of the list of hard content difficulties. + /// + /// + public static readonly string HardContentList = + string.Join(", ", HardContent.Select(x => x.ToString())); + + #endregion + + #region Cored Content Lists + + /// + /// A list of content difficulties that are considered soft-core. + /// + /// + /// The rest of the list set would be and + /// . + /// + private static readonly List SoftCoreContent = + [ + ContentDifficulty.Normal, + ContentDifficulty.Hard, + ]; + + /// + /// A string representation of the list of soft-core content difficulties. + /// + /// + public static readonly string SoftCoreContentList = + string.Join(", ", SoftCoreContent.Select(x => x.ToString())); + + /// + /// A list of content difficulties that are considered mid-core. + /// + /// + /// The rest of the list set would be and + /// . + /// + private static readonly List MidCoreContent = + [ + ContentDifficulty.Unreal, + ContentDifficulty.FieldRaidsSavage, + ContentDifficulty.Extreme, + ContentDifficulty.Chaotic, + ]; + + /// + /// A string representation of the list of mid-core content difficulties. + /// + /// + public static readonly string MidCoreContentList = + string.Join(", ", MidCoreContent.Select(x => x.ToString())); + + /// + /// A list of content difficulties that are considered hard-core. + /// + /// + /// The rest of the list set would be and + /// . + /// + private static List HardCoreContent = + [ + ContentDifficulty.Criterion, + ContentDifficulty.Savage, + ContentDifficulty.CriterionSavage, + ContentDifficulty.Ultimate, + ]; + + /// + /// A string representation of the list of hard-core content difficulties. + /// + /// + public static readonly string HardCoreContentList = + string.Join(", ", HardCoreContent.Select(x => x.ToString())); + + #endregion +} diff --git a/XIVSlothCombo/Window/Functions/UserConfig.cs b/XIVSlothCombo/Window/Functions/UserConfig.cs index 5ae5f8b16..a846f0311 100644 --- a/XIVSlothCombo/Window/Functions/UserConfig.cs +++ b/XIVSlothCombo/Window/Functions/UserConfig.cs @@ -1107,6 +1107,129 @@ public static void DrawJobGridSingleChoice(string config) ImGui.Spacing(); } + /// + /// Draws a multi choice checkbox in a horizontal configuration, + /// with values for Content Difficulty filtering's Halved Difficulty + /// list set. + /// + /// + /// [0]true if + /// is enabled.
+ /// [1]true if + /// is enabled. + ///
+ /// + /// The config variable for this setting. + /// + /// + /// + public static void DrawHalvedDifficultyMultiChoice(string config) + { + ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudYellow); + ImGui.Indent(); + ImGui.TextUnformatted("Select what difficulty the above should apply to:"); + ImGui.PopStyleColor(); + ImGui.Unindent(); + + DrawHorizontalMultiChoice( + config, "Easiest Content", + ContentCheck.BottomHalfContentList, + totalChoices: 2, choice: 0, + descriptionColor: ImGuiColors.DalamudYellow + ); + DrawHorizontalMultiChoice( + config, "Hardest Content", + ContentCheck.TopHalfContentList, + totalChoices: 2, choice: 1, + descriptionColor: ImGuiColors.DalamudYellow + ); + } + + /// + /// Draws a multi choice checkbox in a horizontal configuration, + /// with values for Content Difficulty filtering's Casual vs Hard + /// difficulty list set. + /// + /// + /// [0]true if + /// is enabled.
+ /// [1]true if + /// is enabled. + ///
+ /// + /// The config variable for this setting. + /// + /// + /// + public static void DrawCasualVSHardDifficultyMultiChoice(string config) + { + ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudYellow); + ImGui.Indent(); + ImGui.TextUnformatted("Select what difficulty the above should apply to:"); + ImGui.PopStyleColor(); + ImGui.Unindent(); + + DrawHorizontalMultiChoice( + config, "Casual Content", + ContentCheck.CasualContentList, + totalChoices: 2, choice: 0, + descriptionColor: ImGuiColors.DalamudYellow + ); + DrawHorizontalMultiChoice( + config, "'Hard' Content", + ContentCheck.HardContentList, + totalChoices: 2, choice: 1, + descriptionColor: ImGuiColors.DalamudYellow + ); + } + + /// + /// Draws a multi choice checkbox in a horizontal configuration, + /// with values for Content Difficulty filtering's Cored Difficulty + /// list set. + /// + /// + /// [0]true if + /// is enabled.
+ /// [1]true if + /// is enabled.
+ /// [2]true if + /// is enabled. + ///
+ /// + /// The config variable for this setting. + /// + /// + /// + /// + public static void DrawCoredDifficultyMultiChoice(string config) + { + ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudYellow); + ImGui.Indent(); + ImGui.TextUnformatted("Select what difficulty the above should apply to:"); + ImGui.PopStyleColor(); + ImGui.Unindent(); + + DrawHorizontalMultiChoice( + config, "SoftCore Content", + ContentCheck.SoftCoreContentList, + totalChoices: 3, choice: 0, + descriptionColor: ImGuiColors.DalamudYellow + ); + DrawHorizontalMultiChoice( + config, "MidCore Content", + ContentCheck.MidCoreContentList, + totalChoices: 3, choice: 1, + descriptionColor: ImGuiColors.DalamudYellow + ); + DrawHorizontalMultiChoice( + config, "HardCore Content", + ContentCheck.HardCoreContentList, + totalChoices: 3, choice: 2, + descriptionColor: ImGuiColors.DalamudYellow + ); + } + internal static void DrawPriorityInput(UserIntArray config, int maxValues, int currentItem, string customLabel = "") { if (config.Count != maxValues || config.Any(x => x == 0)) From 9830b3563c65d2ffa199e0c85fd7eb7dbe16854c Mon Sep 17 00:00:00 2001 From: Ethan Henderson Date: Sat, 16 Nov 2024 12:37:35 -0700 Subject: [PATCH 2/7] Bump ECommons to include Content Difficulty/Type determination, NightmareXIV/ECommons#79 --- ECommons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ECommons b/ECommons index c4e980ec0..71ee09f7c 160000 --- a/ECommons +++ b/ECommons @@ -1 +1 @@ -Subproject commit c4e980ec0435aa7931e12d8a62aaf79cc4cb2105 +Subproject commit 71ee09f7cc2230a73503b945422760da1368405c From 9edc6c15a596ecc0e72dc1ac734cbf2ac6090db3 Mon Sep 17 00:00:00 2001 From: Ethan Henderson Date: Sat, 16 Nov 2024 13:20:27 -0700 Subject: [PATCH 3/7] Reorganize methods --- XIVSlothCombo/Data/ContentCheck.cs | 202 ++++++++++++++--------------- 1 file changed, 101 insertions(+), 101 deletions(-) diff --git a/XIVSlothCombo/Data/ContentCheck.cs b/XIVSlothCombo/Data/ContentCheck.cs index 34bf2eda8..ddde72fd4 100644 --- a/XIVSlothCombo/Data/ContentCheck.cs +++ b/XIVSlothCombo/Data/ContentCheck.cs @@ -10,45 +10,7 @@ namespace XIVSlothCombo.Data; public class ContentCheck { - /// - /// Whether the current content is considered casual. - /// - /// - /// If the - /// - /// determined difficulty - /// - /// is in the list of . - /// - /// - /// The rest of the list set would be checked by - /// . - /// - /// - public static bool IsInCasualContent() => - CasualContent.Contains( - Content.ContentDifficulty ?? ContentDifficulty.Unknown - ); - - /// - /// Whether the current content is considered hard. - /// - /// - /// If the - /// - /// determined difficulty - /// - /// is in the list of . - /// - /// - /// The rest of the list set would be checked by - /// . - /// - /// - public static bool IsInHardContent() => - HardContent.Contains( - Content.ContentDifficulty ?? ContentDifficulty.Unknown - ); + #region Halved Content Lists /// /// Whether the current content is in the bottom half of the list of content @@ -92,68 +54,6 @@ public static bool IsInTopHalfContent() => Content.ContentDifficulty ?? ContentDifficulty.Unknown ); - /// - /// Whether the current content is considered soft-core. - /// - /// - /// If the - /// - /// determined difficulty - /// - /// is in the list of . - /// - /// - /// The rest of the list set would be and - /// . - /// - /// - public static bool IsInSoftCoreContent() => - SoftCoreContent.Contains( - Content.ContentDifficulty ?? ContentDifficulty.Unknown - ); - - /// - /// Whether the current content is considered mid-core. - /// - /// - /// If the - /// - /// determined difficulty - /// - /// is in the list of . - /// - /// - /// The rest of the list set would be and - /// . - /// - /// - public static bool IsInMidCoreContent() => - MidCoreContent.Contains( - Content.ContentDifficulty ?? ContentDifficulty.Unknown - ); - - /// - /// Whether the current content is considered hard-core. - /// - /// - /// If the - /// - /// determined difficulty - /// - /// is in the list of . - /// - /// - /// The rest of the list set would be and - /// . - /// - /// - public static bool IsInHardCoreContent() => - HardCoreContent.Contains( - Content.ContentDifficulty ?? ContentDifficulty.Unknown - ); - - #region Halved Content Lists - /// /// Roughly the bottom half of the list of content difficulties. /// @@ -204,6 +104,46 @@ public static bool IsInHardCoreContent() => #region Casual vs Hard Content Lists + /// + /// Whether the current content is considered casual. + /// + /// + /// If the + /// + /// determined difficulty + /// + /// is in the list of . + /// + /// + /// The rest of the list set would be checked by + /// . + /// + /// + public static bool IsInCasualContent() => + CasualContent.Contains( + Content.ContentDifficulty ?? ContentDifficulty.Unknown + ); + + /// + /// Whether the current content is considered hard. + /// + /// + /// If the + /// + /// determined difficulty + /// + /// is in the list of . + /// + /// + /// The rest of the list set would be checked by + /// . + /// + /// + public static bool IsInHardContent() => + HardContent.Contains( + Content.ContentDifficulty ?? ContentDifficulty.Unknown + ); + /// /// A list of content difficulties that are considered casual. /// @@ -252,6 +192,66 @@ public static bool IsInHardCoreContent() => #region Cored Content Lists + /// + /// Whether the current content is considered soft-core. + /// + /// + /// If the + /// + /// determined difficulty + /// + /// is in the list of . + /// + /// + /// The rest of the list set would be and + /// . + /// + /// + public static bool IsInSoftCoreContent() => + SoftCoreContent.Contains( + Content.ContentDifficulty ?? ContentDifficulty.Unknown + ); + + /// + /// Whether the current content is considered mid-core. + /// + /// + /// If the + /// + /// determined difficulty + /// + /// is in the list of . + /// + /// + /// The rest of the list set would be and + /// . + /// + /// + public static bool IsInMidCoreContent() => + MidCoreContent.Contains( + Content.ContentDifficulty ?? ContentDifficulty.Unknown + ); + + /// + /// Whether the current content is considered hard-core. + /// + /// + /// If the + /// + /// determined difficulty + /// + /// is in the list of . + /// + /// + /// The rest of the list set would be and + /// . + /// + /// + public static bool IsInHardCoreContent() => + HardCoreContent.Contains( + Content.ContentDifficulty ?? ContentDifficulty.Unknown + ); + /// /// A list of content difficulties that are considered soft-core. /// From 92955f11764bb54942a78c7de50134c7c70b550e Mon Sep 17 00:00:00 2001 From: Ethan Henderson Date: Sat, 16 Nov 2024 13:29:32 -0700 Subject: [PATCH 4/7] Simplify Difficulty List Set config drawing --- XIVSlothCombo/Data/ContentCheck.cs | 26 ++++++++++++++ XIVSlothCombo/Window/Functions/UserConfig.cs | 38 ++++++++++++++++++-- 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/XIVSlothCombo/Data/ContentCheck.cs b/XIVSlothCombo/Data/ContentCheck.cs index ddde72fd4..917ec837a 100644 --- a/XIVSlothCombo/Data/ContentCheck.cs +++ b/XIVSlothCombo/Data/ContentCheck.cs @@ -10,6 +10,32 @@ namespace XIVSlothCombo.Data; public class ContentCheck { + /// + /// Valid selections for list sets to use. + /// + public enum ListSet + { + /// + /// + /// + /// + Halved, + + /// + /// + /// + /// + CasualVSHard, + + /// + /// + /// + /// + /// + /// + Cored, + } + #region Halved Content Lists /// diff --git a/XIVSlothCombo/Window/Functions/UserConfig.cs b/XIVSlothCombo/Window/Functions/UserConfig.cs index a846f0311..dc668fc1a 100644 --- a/XIVSlothCombo/Window/Functions/UserConfig.cs +++ b/XIVSlothCombo/Window/Functions/UserConfig.cs @@ -1107,6 +1107,38 @@ public static void DrawJobGridSingleChoice(string config) ImGui.Spacing(); } + /// + /// Draws the correct multi choice checkbox method based on the given + /// . + /// + /// + /// The config variable for this setting. + /// + /// + /// Which difficulty list set to draw. + /// + /// + /// + /// + public static void DrawDifficultyMultiChoice + (string config, ContentCheck.ListSet configListSet) + { + switch (configListSet) + { + case ContentCheck.ListSet.Halved: + DrawHalvedDifficultyMultiChoice(config); + break; + case ContentCheck.ListSet.CasualVSHard: + DrawCasualVSHardDifficultyMultiChoice(config); + break; + case ContentCheck.ListSet.Cored: + DrawCoredDifficultyMultiChoice(config); + break; + default: + throw new ArgumentOutOfRangeException(nameof(configListSet), configListSet, null); + } + } + /// /// Draws a multi choice checkbox in a horizontal configuration, /// with values for Content Difficulty filtering's Halved Difficulty @@ -1123,7 +1155,7 @@ public static void DrawJobGridSingleChoice(string config) /// /// /// - public static void DrawHalvedDifficultyMultiChoice(string config) + private static void DrawHalvedDifficultyMultiChoice(string config) { ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudYellow); ImGui.Indent(); @@ -1161,7 +1193,7 @@ public static void DrawHalvedDifficultyMultiChoice(string config) /// /// /// - public static void DrawCasualVSHardDifficultyMultiChoice(string config) + private static void DrawCasualVSHardDifficultyMultiChoice(string config) { ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudYellow); ImGui.Indent(); @@ -1202,7 +1234,7 @@ public static void DrawCasualVSHardDifficultyMultiChoice(string config) /// /// /// - public static void DrawCoredDifficultyMultiChoice(string config) + private static void DrawCoredDifficultyMultiChoice(string config) { ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudYellow); ImGui.Indent(); From f2645be91586dce363b02d9b40a68f7b60ce9106 Mon Sep 17 00:00:00 2001 From: Ethan Henderson Date: Sat, 16 Nov 2024 13:40:35 -0700 Subject: [PATCH 5/7] Added a method to be able to check difficulty filtering settings in a single line --- XIVSlothCombo/Data/ContentCheck.cs | 55 ++++++++++++++++++++ XIVSlothCombo/Window/Functions/UserConfig.cs | 1 + 2 files changed, 56 insertions(+) diff --git a/XIVSlothCombo/Data/ContentCheck.cs b/XIVSlothCombo/Data/ContentCheck.cs index 917ec837a..69c6b5135 100644 --- a/XIVSlothCombo/Data/ContentCheck.cs +++ b/XIVSlothCombo/Data/ContentCheck.cs @@ -1,8 +1,10 @@ #region +using System; using System.Collections.Generic; using System.Linq; using ECommons.GameHelpers; +using XIVSlothCombo.CustomComboNS.Functions; #endregion @@ -36,6 +38,59 @@ public enum ListSet Cored, } + /// + /// Check if the current content the user was in matches the content in the + /// given configuration. + /// + /// + /// The User Config variable of selected + /// valid content difficulties to check against. + /// + /// + /// The List Set that the variable is set to. + /// + /// + /// Whether the current content is matches the selected difficulties. + /// + /// + internal static bool IsInConfiguredContent + (UserBoolArray configuredContent, ListSet configListSet) + { + { + switch (configListSet) + { + case ListSet.Halved: + if (configuredContent[0] && IsInBottomHalfContent()) + return true; + if (configuredContent[1] && IsInTopHalfContent()) + return true; + break; + + case ListSet.CasualVSHard: + if (configuredContent[0] && IsInCasualContent()) + return true; + if (configuredContent[1] && IsInHardContent()) + return true; + break; + + case ListSet.Cored: + if (configuredContent[0] && IsInSoftCoreContent()) + return true; + if (configuredContent[1] && IsInMidCoreContent()) + return true; + if (configuredContent[2] && IsInHardCoreContent()) + return true; + break; + + default: + throw new ArgumentOutOfRangeException + (nameof(configListSet), configListSet, null); + } + + return false; + } + } + #region Halved Content Lists /// diff --git a/XIVSlothCombo/Window/Functions/UserConfig.cs b/XIVSlothCombo/Window/Functions/UserConfig.cs index dc668fc1a..26ef8bf32 100644 --- a/XIVSlothCombo/Window/Functions/UserConfig.cs +++ b/XIVSlothCombo/Window/Functions/UserConfig.cs @@ -1120,6 +1120,7 @@ public static void DrawJobGridSingleChoice(string config) /// /// /// + /// public static void DrawDifficultyMultiChoice (string config, ContentCheck.ListSet configListSet) { From b1133a7c67dd6d768d562e5eb3b9a0602fae6655 Mon Sep 17 00:00:00 2001 From: Ethan Henderson Date: Sun, 17 Nov 2024 19:25:32 -0700 Subject: [PATCH 6/7] Added `overrideText` to Content Filtering UI --- XIVSlothCombo/Window/Functions/UserConfig.cs | 41 +++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/XIVSlothCombo/Window/Functions/UserConfig.cs b/XIVSlothCombo/Window/Functions/UserConfig.cs index 26ef8bf32..eaf5f8744 100644 --- a/XIVSlothCombo/Window/Functions/UserConfig.cs +++ b/XIVSlothCombo/Window/Functions/UserConfig.cs @@ -1117,23 +1117,26 @@ public static void DrawJobGridSingleChoice(string config) /// /// Which difficulty list set to draw. /// + /// + /// Optional text to override the default description. + /// /// /// /// /// public static void DrawDifficultyMultiChoice - (string config, ContentCheck.ListSet configListSet) + (string config, ContentCheck.ListSet configListSet, string overrideText = "") { switch (configListSet) { case ContentCheck.ListSet.Halved: - DrawHalvedDifficultyMultiChoice(config); + DrawHalvedDifficultyMultiChoice(config, overrideText); break; case ContentCheck.ListSet.CasualVSHard: - DrawCasualVSHardDifficultyMultiChoice(config); + DrawCasualVSHardDifficultyMultiChoice(config, overrideText); break; case ContentCheck.ListSet.Cored: - DrawCoredDifficultyMultiChoice(config); + DrawCoredDifficultyMultiChoice(config, overrideText); break; default: throw new ArgumentOutOfRangeException(nameof(configListSet), configListSet, null); @@ -1154,13 +1157,19 @@ public static void DrawDifficultyMultiChoice /// /// The config variable for this setting. /// + /// + /// Optional text to override the default description. + /// /// /// - private static void DrawHalvedDifficultyMultiChoice(string config) + private static void DrawHalvedDifficultyMultiChoice + (string config, string overrideText = "") { ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudYellow); ImGui.Indent(); - ImGui.TextUnformatted("Select what difficulty the above should apply to:"); + ImGui.TextUnformatted(overrideText.IsNullOrEmpty() + ? "Select what difficulty the above should apply to:" + : overrideText); ImGui.PopStyleColor(); ImGui.Unindent(); @@ -1192,13 +1201,19 @@ private static void DrawHalvedDifficultyMultiChoice(string config) /// /// The config variable for this setting. /// + /// + /// Optional text to override the default description. + /// /// /// - private static void DrawCasualVSHardDifficultyMultiChoice(string config) + private static void DrawCasualVSHardDifficultyMultiChoice + (string config, string overrideText = "") { ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudYellow); ImGui.Indent(); - ImGui.TextUnformatted("Select what difficulty the above should apply to:"); + ImGui.TextUnformatted(overrideText.IsNullOrEmpty() + ? "Select what difficulty the above should apply to:" + : overrideText); ImGui.PopStyleColor(); ImGui.Unindent(); @@ -1232,14 +1247,20 @@ private static void DrawCasualVSHardDifficultyMultiChoice(string config) /// /// The config variable for this setting. /// + /// + /// Optional text to override the default description. + /// /// /// /// - private static void DrawCoredDifficultyMultiChoice(string config) + private static void DrawCoredDifficultyMultiChoice + (string config, string overrideText = "") { ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudYellow); ImGui.Indent(); - ImGui.TextUnformatted("Select what difficulty the above should apply to:"); + ImGui.TextUnformatted(overrideText.IsNullOrEmpty() + ? "Select what difficulty the above should apply to:" + : overrideText); ImGui.PopStyleColor(); ImGui.Unindent(); From 40fe926adb080a6cb3bc1303023327f24accae1e Mon Sep 17 00:00:00 2001 From: Ethan Henderson Date: Sun, 17 Nov 2024 21:29:39 -0700 Subject: [PATCH 7/7] Update CREFs to the new ECommons content to try to remove build warnings --- XIVSlothCombo/Data/ContentCheck.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/XIVSlothCombo/Data/ContentCheck.cs b/XIVSlothCombo/Data/ContentCheck.cs index 69c6b5135..677f261fa 100644 --- a/XIVSlothCombo/Data/ContentCheck.cs +++ b/XIVSlothCombo/Data/ContentCheck.cs @@ -99,7 +99,7 @@ internal static bool IsInConfiguredContent /// /// /// If the - /// + /// /// determined difficulty /// /// is in the list of . @@ -120,7 +120,7 @@ public static bool IsInBottomHalfContent() => /// /// /// If the - /// + /// /// determined difficulty /// /// is in the list of . @@ -190,7 +190,7 @@ public static bool IsInTopHalfContent() => /// /// /// If the - /// + /// /// determined difficulty /// /// is in the list of . @@ -210,7 +210,7 @@ public static bool IsInCasualContent() => /// /// /// If the - /// + /// /// determined difficulty /// /// is in the list of . @@ -278,7 +278,7 @@ public static bool IsInHardContent() => /// /// /// If the - /// + /// /// determined difficulty /// /// is in the list of . @@ -298,7 +298,7 @@ public static bool IsInSoftCoreContent() => /// /// /// If the - /// + /// /// determined difficulty /// /// is in the list of . @@ -318,7 +318,7 @@ public static bool IsInMidCoreContent() => /// /// /// If the - /// + /// /// determined difficulty /// /// is in the list of .