public static LocalizedDialogueEntry[] ParseLocalizedDialogueEntries(string[] dialogueEntryTexts)
        {
            var results = new LocalizedDialogueEntry[dialogueEntryTexts.Length];

            for (int i = 0; i < dialogueEntryTexts.Length; ++i)
            {
                var    text = dialogueEntryTexts[i];
                var    m = Regex.Match(text, @"(.*?)(?:::|::)(.*)");
                string characterName, dialogue;
                if (m.Success)
                {
                    characterName = m.Groups[1].Value;
                    dialogue      = m.Groups[2].Value;
                }
                else
                {
                    characterName = "";
                    dialogue      = text;
                }

                results[i] = new LocalizedDialogueEntry {
                    displayName = characterName, dialogue = dialogue
                };
            }

            return(results);
        }
Esempio n. 2
0
 public void AddLocalized(SystemLanguage locale, LocalizedDialogueEntry entry)
 {
     displayNames[locale] = entry.displayName;
     dialogues[locale]    = entry.dialogue;
 }