mirror of
https://github.com/openbullet/openbullet.git
synced 2023-10-21 07:33:42 -05:00
Added Remove Duplicates to the List Group in Utility block.
This commit is contained in:
@@ -71,6 +71,9 @@ namespace RuriLib
|
||||
/// <summary>Removes an element from a list variable.</summary>
|
||||
Remove,
|
||||
|
||||
/// <summary>Removes duplicate elements from a list variable, keeping only the first one.</summary>
|
||||
RemoveDuplicates,
|
||||
|
||||
/// <summary>Picks a random element from a list variable.</summary>
|
||||
Random
|
||||
}
|
||||
@@ -489,6 +492,10 @@ namespace RuriLib
|
||||
variable.Value.RemoveAt(index);
|
||||
break;
|
||||
|
||||
case ListAction.RemoveDuplicates:
|
||||
data.Variables.Set(new CVar(variableName, list.Distinct().ToList(), isCapture));
|
||||
break;
|
||||
|
||||
case ListAction.Random:
|
||||
data.Variables.Set(new CVar(variableName, list[data.rand.Next(list.Count)], isCapture));
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user