private void generateIdReportButton_Click(object sender, EventArgs e)
        {
            string path_to_files = "";

            if (inputRadioButton.Checked)
            {
                if (!Directory.Exists(inputTextBox.Text))
                {
                    MessageBox.Show("The path to input files does not exist. Make sure you put it in the correct place and try again.",
                                    "Input folder error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                path_to_files = inputTextBox.Text;
            }
            else if (outputRadioButton.Checked)
            {
                if (!Directory.Exists(outputTextBox.Text))
                {
                    MessageBox.Show("The path to output files does not exist. Make sure you put it in the correct place and try again.",
                                    "Output folder error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                path_to_files = outputTextBox.Text;
            }

            List <string> ide = Settings.GetAllFilesFrom(path_to_files, "*.ide"),
                          ipl = Settings.GetAllFilesFrom(path_to_files, "*.ipl");

            List <string> ipl_raw = Raw.Get(ipl), ide_raw = Raw.Get(ide);

            Editor.Ids = Editor.GetAllIds(ide, ide_raw);

            int startID = Editor.GetStartID(Editor.Ids),
                finalID = Editor.GetFinalID(Editor.Ids);

            Editor.Interval            = finalID - startID;
            Editor.Progress            = startID;
            Editor.PercentageCompleted = 0;

            LogIds.Init();
            LogIds.Log(String.Format("Map '{0}' Ids Report:\r\n=================",
                                     Settings.Data["Map" + Settings.GetSelected()]["name"]));

            if (ignoreMissingCheckBox.Checked)
            {
                LogIds.Log(Editor.Ids);
            }
            else
            {
                LogIds.LogWithMissingIds(Editor.Ids);
            }

            LogIds.EndLogging("id_report.log");

            MessageBox.Show(String.Format("Report File '{0}' successfully generated.", "id_report.log"),
                            "IDE/IPL logging", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        private void bgWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            List <string> ide = Settings.GetAllFilesFrom(inputTextBox.Text, "*.ide"),
                          ipl = Settings.GetAllFilesFrom(inputTextBox.Text, "*.ipl");

            List <string> out_ide = Editor.CreateOutputPaths(ide, inputTextBox.Text, outputTextBox.Text),
                          out_ipl = Editor.CreateOutputPaths(ipl, inputTextBox.Text, outputTextBox.Text);

            List <string> ipl_raw = Raw.Get(ipl), ide_raw = Raw.Get(ide);

            Editor.Ids = Editor.GetAllIds(ide, ide_raw);

            int startID = Editor.GetStartID(Editor.Ids),
                finalID = Editor.GetFinalID(Editor.Ids);

            Editor.Interval            = finalID - startID;
            Editor.Progress            = startID;
            Editor.PercentageCompleted = 0;

            LogIds.Log("Before editing");
            LogIds.Log(Editor.Ids);

            // Fix Ide Subroutine
            if (Editor.PatchIDEs)
            {
                for (int i = 0; i < ide_raw.Count; i++)
                {
                    ide_raw[i] = Editor.FixIde(ide_raw[i]);
                }
            }

            // Batch Id re-conversion in IDE / IPL files
            Editor.BatchIdsReConversion(ide, ide_raw, ipl_raw, startID, bgWorker);

            // Checking if IPL is in diferent format than output, and converting if necessary
            // And also, re-assigning LODs (if format is San Andreas)
            Editor.PatchAllIpl(ipl, ipl_raw, bgWorker);

            // Editing IPL coordinates
            if (Editor.xOff != 0 || Editor.yOff != 0 || Editor.zOff != 0)
            {
                Editor.FixIplCoordinates(ipl, ipl_raw, bgWorker);
            }

            Editor.Ids = Editor.GetAllIds(ide, ide_raw);
            LogIds.Log("After editing");
            LogIds.Log(Editor.Ids);
            //LogIds.EndLogging("editor_ids.log");

            // Building new IDE / IPL files
            bgWorker.ReportProgress(100, "100 %\nStoring.");
            for (int i = 0; i < ide_raw.Count; i++)
            {
                Editor.CreateDirectoryOf(out_ide[i]);
                Raw.Store(out_ide[i], ide_raw[i]);
            }
            for (int i = 0; i < ipl_raw.Count; i++)
            {
                Editor.CreateDirectoryOf(out_ipl[i]);
                Raw.Store(out_ipl[i], ipl_raw[i]);
            }
        }