Add alert sound theme support

This commit is contained in:
azakhi
2018-08-26 20:24:13 +03:00
parent bc5a005ee7
commit d92d34af05
22 changed files with 262 additions and 53 deletions

View File

@@ -236,7 +236,7 @@ namespace Filtration.Parser.Services
RemoveExistingBlockItemsOfType<SoundBlockItem>(block);
RemoveExistingBlockItemsOfType<PositionalSoundBlockItem>(block);
var match = Regex.Match(trimmedLine, @"\S+\s+(\S+)\s?(\d+)?");
var match = Regex.Match(trimmedLine, @"\S+\s+(\S+)\s?(\d+)?\s*([#]?)(.*)");
if (match.Success)
{
@@ -250,6 +250,12 @@ namespace Filtration.Parser.Services
else
{
secondValue = 79;
}
ThemeComponent themeComponent = null;
if(match.Groups[3].Value == "#" && !string.IsNullOrWhiteSpace(match.Groups[4].Value))
{
themeComponent = _masterComponentCollection.AddComponent(ThemeComponentType.AlertSound, match.Groups[4].Value.Trim(), firstValue, secondValue);
}
if (lineOption == "PlayAlertSound")
@@ -259,6 +265,7 @@ namespace Filtration.Parser.Services
Value = firstValue,
SecondValue = secondValue
};
blockItemValue.ThemeComponent = themeComponent;
block.BlockItems.Add(blockItemValue);
}
else
@@ -268,6 +275,7 @@ namespace Filtration.Parser.Services
Value = firstValue,
SecondValue = secondValue
};
blockItemValue.ThemeComponent = themeComponent;
block.BlockItems.Add(blockItemValue);
}
}