Beispiel #1
0
        public void UpdateText(String[] Textlines)
        {
            if (Textlines == null)
            {
                return;
            }

            StringBuilder sb = new StringBuilder();

            foreach (String line in Textlines)
            {
                sb.AppendLine(line);
            }

            String Text = sb.ToString();

            Text = VesperiaUtil.RemoveTags(Text);

            if (BoxByBox)
            {
                List <string> lst = new List <string>();

                int Last = 0;

                for (int i = 0; i < Text.Length; i++)
                {
                    if (Text[i] == '\n')
                    {
                        if (!(i + 1 < Text.Length && Text[i + 1] == '\n'))
                        {
                            continue;
                        }

                        int This = i;

                        lst.Add(Text.Substring(Last, i - Last));

                        while (i + 1 < Text.Length && Text[i + 1] == '\n')
                        {
                            i++;
                        }

                        Last = i + 1;
                    }
                }
                lst.Add(Text.Substring(Last, Text.Length - Last));

                int count = 0;
                foreach (string s in lst)
                {
                    textBoxDisplayDelay.Text = s;
                    UpdateAny();
                    SaveAsPng("textbox_" + String.Format("{0:0000}", count) + ".png");
                    count++;
                }
            }

            textBoxDisplayDelay.Text = Text;
        }
Beispiel #2
0
        public string GetDataAsHtml(GameVersion version, TSS.TSSFile stringDic, Dictionary <uint, TSS.TSSEntry> inGameIdDict)
        {
            StringBuilder sb = new StringBuilder();

            var    synopsisEntry = inGameIdDict[TextStringDicId];
            string jp            = synopsisEntry.StringJpn != null ? synopsisEntry.StringJpn : "";

            jp = Website.GenerateWebsite.ReplaceIconsWithHtml(new StringBuilder(jp), version, true).ToString();
            string en = synopsisEntry.StringEng != null ? synopsisEntry.StringEng : "";

            en = Website.GenerateWebsite.ReplaceIconsWithHtml(new StringBuilder(en), version, false).ToString();

            string[] textJpn = jp.Split('\f');
            string[] textEng = en.Split('\f');
            for (int i = 0; i < textJpn.Length; ++i)
            {
                textJpn[i] = VesperiaUtil.RemoveTags(textJpn[i], true, true).Replace("\n", "<br />");
            }
            for (int i = 0; i < textEng.Length; ++i)
            {
                textEng[i] = VesperiaUtil.RemoveTags(textEng[i], false, true).Replace("\n", "<br />");
            }

            //sb.Append( "Unlocks between " + StoryIdMin + " and " + StoryIdMax + "<br>" );

            sb.Append("<table class=\"synopsis\">");
            sb.Append("<tr id=\"synopsis" + ID + "\"><td class=\"synopsistitle\" colspan=\"" + textJpn.Length + "\">");
            if (version == GameVersion.PS3)
            {
                sb.Append("<img src=\"synopsis/U_" + RefString1 + ".png\"><br><br>");
            }
            sb.Append(inGameIdDict[NameStringDicId].StringJpnHtml(version) + "</td></tr><tr>");
            foreach (string s in textJpn)
            {
                sb.Append("<td>" + s + "</td>");
            }
            sb.Append("</tr>");
            sb.Append("</table>");
            sb.Append("<br>");

            sb.Append("<table class=\"synopsis\">");
            sb.Append("<tr id=\"synopsis" + ID + "\"><td class=\"synopsistitle\" colspan=\"" + textEng.Length + "\">");
            sb.Append(inGameIdDict[NameStringDicId].StringEngHtml(version) + "</td></tr><tr>");
            foreach (string s in textEng)
            {
                sb.Append("<td>" + s + "</td>");
            }
            sb.Append("</tr>");
            sb.Append("</table>");

            return(sb.ToString());
        }
Beispiel #3
0
        public string StringEngHtml(GameVersion version, Dictionary <uint, TSS.TSSEntry> inGameIdDict)
        {
            string en = StringEng != null ? StringEng : "";

            return(VesperiaUtil.RemoveTags(Website.WebsiteGenerator.ReplaceIconsWithHtml(new StringBuilder(en), inGameIdDict, version, false).ToString(), inGameIdDict, false, true).Replace("\n", "<br />"));
        }
Beispiel #4
0
        public void UpdateText(string Text)
        {
            Text = VesperiaUtil.RemoveTags(Text);
            if (LastText == Text)
            {
                return;
            }
            LastText = Text;

            int CurrentFontInfoToUse = (int)numericUpDownTileNumber.Value;
            int CharacterIDSelected  = (int)TownMapIDBox.Value;

            int x     = 0;
            int y     = 0;
            int xsize = 0;
            int ysize = 0;

            for (int i = 0; i < Text.Length; i++)
            {
                if (Text[i] == '\n')
                {
                    xsize = Math.Max(xsize, x + 34);
                    x     = 0;
                    y    += 43;
                    continue;
                }
                int CharacterID = FontInfos[CurrentFontInfoToUse].GetCharacterIdFromCharacter(Text[i]);
                int Length      = FontInfos[CurrentFontInfoToUse].CharacterLengths[CharacterID];
                x += Length + 2;
            }

            xsize = Math.Max(xsize, x + 34);
            ysize = y + 43;

            //if (xsize > 10000) xsize = 10000;
            //if (ysize > 10000) ysize = 40000;

            Image img = new System.Drawing.Bitmap(xsize, ysize);
            Color cc;

            if (this.checkBoxApproxDialogue.Checked)
            {
                cc = bgcolor;
            }
            else
            {
                cc = Color.Black;
            }
            Graphics.FromImage(img).Clear(cc);
            pictureBox2.Image = img;

            x = 0;
            y = 0;

            for (int i = 0; i < Text.Length; i++)
            {
                if (Text[i] == '\n')
                {
                    x  = 0;
                    y += 43;
                    continue;
                }
                int CharacterID = FontInfos[CurrentFontInfoToUse].GetCharacterIdFromCharacter(Text[i]);
                int Length      = FontInfos[CurrentFontInfoToUse].CharacterLengths[CharacterID];
                Draw(CharacterID, x, y);
                if (CharacterID == CharacterIDSelected)
                {
                    DrawLineBelowLetter(x, y, Length);
                }
                x += Length;
                x += 2;
            }
        }
Beispiel #5
0
        public string StringEngHtml(GameVersion version)
        {
            string en = StringEng != null ? StringEng : "";

            return(VesperiaUtil.RemoveTags(Website.GenerateWebsite.ReplaceIconsWithHtml(new StringBuilder(en), version, false).ToString(), false, true).Replace("\n", "<br />"));
        }
Beispiel #6
0
        public string StringJpnHtml(GameVersion version)
        {
            string jp = StringJpn != null ? StringJpn : "";

            return(VesperiaUtil.RemoveTags(Website.GenerateWebsite.ReplaceIconsWithHtml(new StringBuilder(jp), version, true).ToString(), true, true).Replace("\n", "<br />"));
        }