Skip to content

Commit

Permalink
Merge pull request #39 from zbee/contentDifficultyFiltering
Browse files Browse the repository at this point in the history
[Core] Content difficulty filtering
  • Loading branch information
Taurenkey authored Nov 19, 2024
2 parents b94de19 + 40fe926 commit 7f845b1
Show file tree
Hide file tree
Showing 3 changed files with 592 additions and 2 deletions.
16 changes: 14 additions & 2 deletions XIVSlothCombo/CustomCombo/Functions/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -156,7 +169,6 @@ public bool All(Func<bool, bool> predicate)
{
var array = PluginConfiguration.GetCustomBoolArrayValue(this.pName);
return array.All(predicate);

}
}

Expand Down
Loading

0 comments on commit 7f845b1

Please sign in to comment.