예제 #1
0
 public AdvBacklogDataInPage(AdvCommandText dataInPage, AdvCharacterInfo characterInfo)
 {
     LogText       = "";
     VoiceFileName = "";
     if (characterInfo != null)
     {
         CharacterLabel    = characterInfo.Label;
         CharacterNameText = characterInfo.LocalizeNameText;
     }
     else
     {
         CharacterLabel    = "";
         CharacterNameText = "";
     }
     LogText = TextParser.MakeLogText(dataInPage.ParseCellLocalizedText());
     if (dataInPage.VoiceFile != null)
     {
         VoiceFileName = dataInPage.VoiceFile.FileName;
         LogText       = TextParser.AddTag(LogText, TextParser.TagSound, dataInPage.VoiceFile.FileName);
     }
     else
     {
         VoiceFileName = "";
     }
     if (dataInPage.IsNextBr)
     {
         LogText += "\n";
     }
 }
예제 #2
0
 public AdvBacklogDataInPage(AdvScenarioTextDataInPage dataInPage)
 {
     LogText       = "";
     VoiceFileName = "";
     if (dataInPage.CharacterInfo != null)
     {
         CharacterLabel    = dataInPage.CharacterInfo.Label;
         CharacterNameText = TextParser.MakeLogText(LanguageManager.Instance.LocalizeText(dataInPage.CharacterInfo.NameText));
     }
     else
     {
         CharacterLabel    = "";
         CharacterNameText = "";
     }
     LogText = TextParser.MakeLogText(dataInPage.Command.ParseCellLocalizedText());
     if (dataInPage.VoiceFile != null)
     {
         VoiceFileName = dataInPage.VoiceFile.FileName;
         LogText       = TextParser.AddTag(LogText, TextParser.TagSound, dataInPage.VoiceFile.FileName);
     }
     else
     {
         VoiceFileName = "";
     }
     if (dataInPage.IsNextBr)
     {
         LogText += "\n";
     }
 }
예제 #3
0
        //文字が範囲外かどうかのチェック
        public bool EditorCheckRect(string text, out int len, out string errorString)
        {
            this.NovelText.text = text;
            ChangeAll();
            Refresh();
            errorString = "";
            bool isOver = false;

            foreach (var item in Info.LineDataList)
            {
                if (item.IsOver)
                {
                    isOver = true;
                    break;
                }
            }

            if (isOver)
            {
                System.Text.StringBuilder normalText = new System.Text.StringBuilder();
                System.Text.StringBuilder overedText = new System.Text.StringBuilder();
                System.Text.StringBuilder builder    = normalText;
                int overLineCount = 0;
                foreach (var line in Info.LineDataList)
                {
                    if (line.IsOver)
                    {
                        builder = overedText;
                        ++overLineCount;
                        if (overLineCount > 10)
                        {
                            builder.AppendLine("...");
                            break;
                        }
                    }
                    foreach (var c in line.Characters)
                    {
                        builder.Append(c.Char);
                        if (c.isAutoLineBreak)
                        {
                            builder.AppendLine();
                        }
                    }
                }
                errorString += normalText.ToString() + TextParser.AddTag(overedText.ToString(), "color", "red");
            }

            len = Info.TextData.Length;
            return(!isOver);
        }