private void GenerateReport_Load(object sender, EventArgs e)
        {
            Show();

            origFile = GameFile.Get(pf.project.type);
            tranFile = GameFile.Get(pf.project.type);

            OrderProjectFile();
            Generate();
        }
Example #2
0
        public LineEditor(LineData lineData, string projectType)
        {
            InitializeComponent();

            toolStrip.Renderer = new ToolStripOverride();
            toolStripContainer1.TopToolStripPanel.RowMargin = new Padding(0);
            toolStrip.Location = new Point(0, 0);
            toolStrip.Size     = new Size(toolStrip.Size.Width + 3, toolStrip.Size.Height);

            ld = lineData;
            this.projectType = projectType;

            origFile = GameFile.Get(projectType);
            tranFile = GameFile.Get(projectType);
            ReadFiles("\\" + ld.currentFile);

            if (ld.fc != null && ld.fc.prevLineId != "-1")
            {
                prevLinesBtn.Text         = ld.fc.prevLineId;
                prevLinesBtn.Image        = Properties.Resources.Add_previous_lines;
                prevLinesBtn.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
            }
        }
Example #3
0
        private void copyLineBtn_Click(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder();
            string        currentLine;
            IFile         gmd = GameFile.Get(projectType);

            if (tranLines.Count() == 1)
            {
                currentLine = tranLines[0].Item2;

                if (!colorCheckBox.Checked)
                {
                    currentLine = gmd.RemoveColors(currentLine);
                }

                if (commentCheckBox.Checked)
                {
                    sb.Append("<n>" + currentLine + "</n>");
                }
                else
                {
                    sb.Append(currentLine);
                }
            }
            else
            {
                string lastChar = "";
                bool   sameChar = false;

                foreach (var line in tranLines)
                {
                    sameChar = (line.Item1 == lastChar);

                    if (sameChar)
                    {
                        if (!sb.ToString().EndsWith("\n"))
                        {
                            sb.AppendLine();
                        }
                    }
                    else
                    {
                        lastChar = line.Item1;

                        if (commentCheckBox.Checked)
                        {
                            sb.AppendLine("<n>**" + line.Item1 + ":**</n>");
                        }
                        else
                        {
                            sb.AppendLine("**" + line.Item1 + ":**");
                        }
                    }

                    currentLine = line.Item2;

                    if (!colorCheckBox.Checked)
                    {
                        currentLine = gmd.RemoveColors(currentLine);
                    }

                    if (commentCheckBox.Checked)
                    {
                        sb.AppendLine("<n>" + currentLine + "</n>");
                    }
                    else
                    {
                        sb.AppendLine(currentLine);
                    }

                    if (tranLines.Last() != line)
                    {
                        sb.AppendLine();
                    }
                }

                if (sameChar)
                {
                    sb.Remove(0, sb.ToString().Split('\n').FirstOrDefault().Length + 1);
                }
            }

            commentBox.SelectedText = sb.ToString();
            commentBox.Select(commentBox.SelectionStart + sb.Length, 0);
            commentBox.Focus();
        }