예제 #1
0
        public void UpdateRawWithNewDialogue()
        {
            if (SpokenText != string.Empty)
            {
                SpokenText = SpokenText.Replace('’', '\'').Replace('~', '~').Replace("  ", " ");

                //Find where the end of the old dialogue text should be
                int lineIndex;
                if (RawLine.Contains("$Nu"))
                {
                    lineIndex = RawLine.IndexOf("$",
                                                RawLine.IndexOf("$Nu", StringComparison.Ordinal) + 2,
                                                StringComparison.Ordinal);
                }
                else
                {
                    lineIndex = RawLine.IndexOf("$", SpeechIndex, StringComparison.Ordinal);
                }

                var oldDialogue = lineIndex > SpeechIndex
                    ? RawLine.Substring(SpeechIndex, lineIndex - SpeechIndex)
                    : RawLine.Substring(SpeechIndex);

                RawLine = RawLine.Substring(0, SpeechIndex) + SpokenText +
                          RawLine.Substring(SpeechIndex + oldDialogue.Length);
            }

            RawLine = RawLine.Replace(Environment.NewLine, "\\n");
        }
예제 #2
0
 internal string GetTextValue()
 {
     return(RawLine.Substring(3 + Tag.Length).Trim());
 }