Example #1
0
        private void loadButton_Click(object sender, EventArgs e)
        {
            // Request image filename
            if (openFlagsFileDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            try
            {
                string[] lines = System.IO.File.ReadAllLines(openFlagsFileDialog.FileName);

                List <string> flagWarningLog = new List <string>();
                for (int i = 0; i < lines.Length; i++)
                {
                    string[] line = lines[i].Split();
                    if (line.Length == 2)
                    {
                        switch (line[0])
                        {
                        case FLAGS:
                            this.flagsTextBox.Text = line[1];
                            break;

                        case TEXTURE_INDEX:
                            this.textureIndexTextBox.Text = line[1];
                            break;

                        case UNKNOWN_6:
                            this.unknown6TextBox.Text = line[1];
                            break;

                        case ANISOTROPY:
                            this.anistropyTextBox.Text = line[1];
                            break;

                        case UNKNOWN_C:
                            this.unknownCTextBox.Text = line[1];
                            break;

                        case UNKNOWN_10:
                            this.unknown10TextBox.Text = line[1];
                            break;

                        default:
                            flagWarningLog.Add("Warning Unknown Flag: " + lines[i]);
                            break;
                        }
                    }
                    else
                    {
                        flagWarningLog.Add("Warning Invalid Flag Format: " + lines[i]);
                    }
                }

                if (flagWarningLog.Count != 0)
                {
                    FlagsWarningLogDialog warningDlg = new FlagsWarningLogDialog(flagWarningLog, "Material Flag Import Warnings", "The following warnings were issued while importing the material flags:");
                    if (warningDlg.ShowDialog() != DialogResult.Yes)
                    {
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error loading the Flags file. " + ex.Message, "Error loading the Flags file.",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }
Example #2
0
        private void loadButton_Click(object sender, EventArgs e)
        {
            // Request image filename
            if (openFlagsFileDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            try
            {
                string[] lines = System.IO.File.ReadAllLines(openFlagsFileDialog.FileName);

                List <string> flagWarningLog = new List <string>();
                for (int i = 0; i < lines.Length; i++)
                {
                    string[] line = lines[i].Split();
                    if (line.Length == 2)
                    {
                        switch (line[0])
                        {
                        case RENDER_FLAGS:
                            this.renderFlagsTextBox.Text = line[1];
                            break;

                        case LAYER:
                            this.layerTextBox.Text = line[1];
                            break;

                        case UNKNOWN_4:
                            this.unknown4TextBox.Text = line[1];
                            break;

                        case UNKNOWN_8:
                            this.unknown8TextBox.Text = line[1];
                            break;

                        case UNKNOWN_C:
                            this.unknownCTextBox.Text = line[1];
                            break;

                        case UNKNOWN_10:
                            this.unknown10TextBox.Text = line[1];
                            break;

                        case UNKNOWN_14:
                            this.unknown14TextBox.Text = line[1];
                            break;

                        case "UNKNOWN_16":
                            this.unknown16TextBox.Text = line[1];
                            break;

                        case "UNKNOWN_18":
                            this.unknown18TextBox.Text = line[1];
                            break;

                        case "UNKNOWN_1A":
                            this.unknown1ATextBox.Text = line[1];
                            break;

                        case MATRIX_SPECIFIC_IDS_ONE:
                            this.matrixId1TextBox.Text = line[1];
                            break;

                        case MATRIX_SPECIFIC_IDS_TWO:
                            this.matrixId2TextBox.Text = line[1];
                            break;

                        case MATRIX_SPECIFIC_IDS_THREE:
                            this.matrixId3TextBox.Text = line[1];
                            break;

                        case MATRIX_SPECIFIC_IDS_FOUR:
                            this.matrixId4TextBox.Text = line[1];
                            break;

                        case MATRIX_SPECIFIC_IDS_FIVE:
                            this.matrixId5TextBox.Text = line[1];
                            break;

                        case MATRIX_SPECIFIC_IDS_SIX:
                            this.matrixId6TextBox.Text = line[1];
                            break;

                        case MATRIX_SPECIFIC_IDS_SEVEN:
                            this.matrixId7TextBox.Text = line[1];
                            break;

                        case MATRIX_SPECIFIC_IDS_EIGHT:
                            this.matrixId8TextBox.Text = line[1];
                            break;

                        case BOUNDING_SPHERE_CENTER_X:
                            this.boundingSphereCenterXTextBox.Text = line[1];
                            break;

                        case BOUNDING_SPHERE_CENTER_Y:
                            this.boundingSphereCenterYTextBox.Text = line[1];
                            break;

                        case BOUNDING_SPHERE_CENTER_Z:
                            this.boundingSphereCenterZTextBox.Text = line[1];
                            break;

                        case UNKNOWN_3C:
                            this.unknown3CTextBox.Text = line[1];
                            break;

                        case UNKNOWN_40:
                            this.unknown40TextBox.Text = line[1];
                            break;

                        default:
                            flagWarningLog.Add("Warning Unknown Flag: " + lines[i]);
                            break;
                        }
                    }
                    else
                    {
                        flagWarningLog.Add("Warning Invalid Flag Format: " + lines[i]);
                    }
                }

                if (flagWarningLog.Count != 0)
                {
                    FlagsWarningLogDialog warningDlg = new FlagsWarningLogDialog(flagWarningLog, "Mesh Flag Import Warnings", "The following warnings were issued while importing the mesh flags:");
                    if (warningDlg.ShowDialog() != DialogResult.Yes)
                    {
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error loading the Flags file. " + ex.Message, "Error loading the Flags file.",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }
Example #3
0
        private void loadButton_Click(object sender, EventArgs e)
        {
            // Request image filename
            if (openFlagsFileDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            try {
                string[] lines = System.IO.File.ReadAllLines(openFlagsFileDialog.FileName);

                List <string> flagWarningLog = new List <string>();
                for (int i = 0; i < lines.Length; i++)
                {
                    string[] line = lines[i].Split();
                    if (line.Length == 2)
                    {
                        switch (line[0])
                        {
                        case SECTION_FLAGS:
                            this.sectionFlagsTextBox.Text = line[1];
                            break;

                        case BOUNDING_SPHERE_CENTER_X:
                            this.boundingSphereCenterX.Text = line[1];
                            break;

                        case BOUNDING_SPHERE_CENTER_Y:
                            this.boundingSphereCenterY.Text = line[1];
                            break;

                        case BOUNDING_SPHERE_CENTER_Z:
                            this.boundingSphereCenterZ.Text = line[1];
                            break;

                        case BOUNDING_SPHERE_RADIUS:
                            this.boundingSphereRadius.Text = line[1];
                            break;

                        case TRANSFORMATION_MATRIX_DEFAULT_ID_ONE:
                            this.transformationMatrixDefaultIdOne.Text = line[1];
                            break;

                        case TRANSFORMATION_MATRIX_DEFAULT_ID_TWO:
                            this.transformationMatrixDefaultIdTwo.Text = line[1];
                            break;

                        case TRANSFORMATION_MATRIX_DEFAULT_ID_THREE:
                            this.transformationMatrixDefaultIdThree.Text = line[1];
                            break;

                        case TRANSFORMATION_MATRIX_DEFAULT_ID_FOUR:
                            this.transformationMatrixDefaultIdFour.Text = line[1];
                            break;

                        case TRANSFORMATION_MATRIX_DEFAULT_ID_FIVE:
                            this.transformationMatrixDefaultIdFive.Text = line[1];
                            break;

                        case TRANSFORMATION_MATRIX_DEFAULT_ID_SIX:
                            this.transformationMatrixDefaultIdSix.Text = line[1];
                            break;

                        case TRANSFORMATION_MATRIX_DEFAULT_ID_SEVEN:
                            this.transformationMatrixDefaultIdSeven.Text = line[1];
                            break;

                        case TRANSFORMATION_MATRIX_DEFAULT_ID_EIGHT:
                            this.transformationMatrixDefaultIdEight.Text = line[1];
                            break;

                        default:
                            flagWarningLog.Add("Warning Unknown Flag: " + lines[i]);
                            break;
                        }
                    }
                    else
                    {
                        flagWarningLog.Add("Warning Invalid Flag Format: " + lines[i]);
                    }
                }

                if (flagWarningLog.Count != 0)
                {
                    FlagsWarningLogDialog warningDlg = new FlagsWarningLogDialog(flagWarningLog, "Model Flag Import Warnings", "The following warnings were issued while importing the model flags:");
                    if (warningDlg.ShowDialog() != DialogResult.Yes)
                    {
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error loading the Flags file. " + ex.Message, "Error loading the Flags file.",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }