Esempio n. 1
0
        private void UpdateGameplayData(ref string tmpFile)
        {
            int statusPos = -1;

            while (true)
            {
                statusPos++;

                if (statusPos > gameplaySubtitleList.Count - 1)
                {
                    break;
                }

                GSubtitle tmpSub   = gameplaySubtitleList[statusPos];
                byte[]    subBytes = ConvIntToPos(tmpSub.SubtitlePosition);
                string    subPos   = Encoding.Default.GetString(subBytes);
                string    madeLine = subPos + "\x01";

                if (statusPos + 1 < gameplaySubtitleList.Count - 1 && gameplaySubtitleList[statusPos + 1].SubtitleId == 1)
                {
                    GSubtitle tmpSub2   = gameplaySubtitleList[statusPos + 1];
                    byte[]    subBytes2 = ConvIntToPos(tmpSub2.SubtitlePosition);
                    string    subPos2   = Encoding.Default.GetString(subBytes2);
                    madeLine += subPos2 + "\x01";
                    statusPos++;
                }

                if (statusPos + 2 < gameplaySubtitleList.Count - 1 && gameplaySubtitleList[statusPos + 2].SubtitleId == 2)
                {
                    GSubtitle tmpSub3   = gameplaySubtitleList[statusPos + 2];
                    byte[]    subBytes3 = ConvIntToPos(tmpSub3.SubtitlePosition);
                    string    subPos3   = Encoding.Default.GetString(subBytes3);
                    madeLine += subPos3 + "\x01";
                    statusPos++;
                }

                if (statusPos + 3 < gameplaySubtitleList.Count - 1 && gameplaySubtitleList[statusPos + 3].SubtitleId == 3)
                {
                    GSubtitle tmpSub4   = gameplaySubtitleList[statusPos + 3];
                    byte[]    subBytes4 = ConvIntToPos(tmpSub4.SubtitlePosition);
                    string    subPos4   = Encoding.Default.GetString(subBytes4);
                    madeLine += subPos4 + "\x01";
                    statusPos++;
                }

                if (statusPos + 4 < gameplaySubtitleList.Count - 1 && gameplaySubtitleList[statusPos + 4].SubtitleId == 4)
                {
                    GSubtitle tmpSub5   = gameplaySubtitleList[statusPos + 4];
                    byte[]    subBytes5 = ConvIntToPos(tmpSub5.SubtitlePosition);
                    string    subPos5   = Encoding.Default.GetString(subBytes5);
                    madeLine += subPos5 + "\x01";
                    statusPos++;
                }

                testtime2.Start();
                tmpFile = tmpFile.Patch(madeLine, tmpSub.DataPosition);
                testtime2.Stop();
            }
        }
        private void geditButton_Click(object sender, EventArgs e)
        {
            if (gCurItem == -1)
            {
                return;
            }

            GSubtitle curSub  = decryptUtil.gameplaySubtitleList[gCurItem - 1];
            int       tmpDiff = gameplayEditText.Text.Length - gameplayView.FindItemWithText(gCurItem.ToString()).SubItems[1].Text.Length;
            int       tmpPos  = curSub.SubtitlePosition;

            decryptUtil.fixList.Add(new ModPoint(tmpPos, tmpDiff, gCurItem - 1, true));
            decryptUtil.FixStrings(tmpPos, tmpDiff);

            ListViewItem tmp = gameplayView.FindItemWithText(gCurItem.ToString());

            tmp.SubItems[1].Text = gameplayEditText.Text;

            decryptUtil.gameplaySubtitleList[gCurItem - 1].SubtitleText = gameplayEditText.Text;
        }