Fixed #32 - PlayAlertSound ignored on Paste Block Style

This commit is contained in:
Ben Wallis
2016-09-01 20:56:58 +01:00
parent 0b791f5747
commit af08cdfed6
4 changed files with 67 additions and 24 deletions

View File

@@ -318,7 +318,7 @@ namespace Filtration.Parser.Services
return blockItem;
}
public void ReplaceColorBlockItemsFromString(ObservableCollection<IItemFilterBlockItem> blockItems, string inputString)
public void ReplaceAudioVisualBlockItemsFromString(ObservableCollection<IItemFilterBlockItem> blockItems, string inputString)
{
// Reverse iterate to remove existing IAudioVisualBlockItems
for (var idx = blockItems.Count - 1; idx >= 0; idx--)
@@ -335,6 +335,13 @@ namespace Filtration.Parser.Services
switch (matches.Value)
{
case "PlayAlertSound":
{
var match = Regex.Match(line, @"\s+(\d+) (\d+)");
if (!match.Success) break;
blockItems.Add(new SoundBlockItem(Convert.ToInt16(match.Groups[1].Value), Convert.ToInt16(match.Groups[2].Value)));
break;
}
case "SetTextColor":
{
blockItems.Add(GetColorBlockItemFromString<TextColorBlockItem>(line));