Event scrape seems to work!

This commit is contained in:
2018-08-19 11:23:01 -07:00
parent 3184888152
commit d881946f67
2 changed files with 19 additions and 12 deletions

View File

@ -195,9 +195,13 @@ namespace Vocalization.Framework
string[] files = Directory.GetFiles(dir); string[] files = Directory.GetFiles(dir);
foreach(var file in files) foreach(var file in files)
{ {
string eventFileName = Path.GetFileNameWithoutExtension(file)+".xnb"; string eventFileName = Path.GetFileNameWithoutExtension(file);
if (eventFileNames.Contains(eventFileName)) continue;
else eventFileNames.Add(eventFileName); string actualName = eventFileName.Split('.').ElementAt(0)+".xnb";
//Gte first position of . and split it. The 0 element will be teh actual filename.
if (eventFileNames.Contains(actualName)) continue;
else eventFileNames.Add(actualName);
} }
} }
} }

View File

@ -1743,18 +1743,19 @@ namespace Vocalization
foreach (KeyValuePair<string, string> pair in DialogueDict) foreach (KeyValuePair<string, string> pair in DialogueDict)
{ {
string key = pair.Key; string key = pair.Key;
if (key != cue.name) continue;
string rawDialogue = pair.Value; string rawDialogue = pair.Value;
List<string> speakingLines = getEventSpeakerLines(rawDialogue, cue.name); List<string> speakingLines = getEventSpeakerLines(rawDialogue, cue.name);
//Sanitize Event info here! //Sanitize Event info here!
foreach (var line in speakingLines)
List<string> cleanDialogues = new List<string>();
cleanDialogues = sanitizeDialogueFromDictionaries(rawDialogue, cue);
foreach (var str in cleanDialogues)
{ {
cue.addDialogue(str, new VoiceAudioOptions()); //Make a new dialogue line based off of the text, but have the .wav value as empty. List<string> cleanDialogues = new List<string>();
cleanDialogues = sanitizeDialogueFromDictionaries(line, cue);
foreach (var str in cleanDialogues)
{
cue.addDialogue(str, new VoiceAudioOptions()); //Make a new dialogue line based off of the text, but have the .wav value as empty.
}
} }
} }
} }
@ -1987,10 +1988,12 @@ namespace Vocalization
List<string> speakingData = new List<string>(); List<string> speakingData = new List<string>();
foreach(var dia in dialogueSplit) foreach(var dia in dialogueSplit)
{ {
if (!dia.Contains("speak") && !dia.Contains("textAboveHead") && !dia.Contains(speakerName)) continue; //ModMonitor.Log(dia);
if (!dia.Contains("speak") && !dia.Contains("textAboveHead")) continue;
string[] actualDialogue = dia.Split(new string[] { "\"" }, StringSplitOptions.None); string[] actualDialogue = dia.Split(new string[] { "\"" }, StringSplitOptions.None);
//Check to make sure this is the speaker's line.
ModMonitor.Log(actualDialogue[1]); if (!actualDialogue[0].Contains(speakerName)) continue;
//ModMonitor.Log(actualDialogue[1],LogLevel.Alert);
//Get the actual dialogue line from this npc. //Get the actual dialogue line from this npc.
speakingData.Add(actualDialogue[1]); speakingData.Add(actualDialogue[1]);
} }