Пример #1
0
 private void cbConvObjDir_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (chkConvTexInObjDir.Checked)
     {
         AddToComboBox.UpdateItems(cbConvObjDir.Text, cbConvTexDir);
     }
 }
Пример #2
0
 private void btnBrowseGameDir_Click(object sender, EventArgs e)
 {
     AddToComboBox.UpdateItems(dlgGameDir, cbGameDir);
     if (chkAutoSetResourceDir.Checked)
     {
         AddToComboBox.UpdateItems(cbGameDir.Text, cbResDir);
     }
 }
Пример #3
0
 private void chkConvTexInObjDir_CheckedChanged(object sender, EventArgs e)
 {
     cbConvTexDir.Enabled        = !chkConvTexInObjDir.Checked;
     btnBrowseConvTexDir.Enabled = !chkConvTexInObjDir.Checked;
     if (chkConvTexInObjDir.Checked && cbConvObjDir.Items.Count != 0)
     {
         AddToComboBox.UpdateItems(cbConvObjDir.Text, cbConvTexDir);
     }
 }
Пример #4
0
        private void btnModelName_Click(object sender, EventArgs e)
        {
            ModelName    mN = new ModelName();
            DialogResult dR = mN.ShowDialog();

            if (!mN.ShapeModelName.StartsWith("."))
            {
                AddToComboBox.UpdateItems(modelNamePrefix + mN.ShapeModelName, cbObjModel);
            }
        }
Пример #5
0
        private void chkAutoSetResourceDir_CheckedChanged(object sender, EventArgs e)
        {
            cbResDir.Enabled        = !chkAutoSetResourceDir.Checked;
            btnBrowseResDir.Enabled = !chkAutoSetResourceDir.Checked;

            if (allowSetResFolder && chkAutoSetResourceDir.Checked)
            {
                AddToComboBox.UpdateItems(cbGameDir.Text, cbResDir);
            }
        }
Пример #6
0
        private void btnSetTexConvCmd_Click(object sender, EventArgs e)
        {
            TexConvCmd   tcc = new TexConvCmd();
            DialogResult dR  = tcc.ShowDialog();

            if (dR == DialogResult.OK)
            {
                AddToComboBox.UpdateItems(tcc.TexConvCommand, cbTexConvCmd);
            }
        }
Пример #7
0
 private void btnBrowseConvObjDir_Click(object sender, EventArgs e)
 {
     AddToComboBox.UpdateItems(dlgConvObjOutput, cbConvObjDir);
     if (chkConvTexInObjDir.Checked)
     {
         if (cbConvObjDir.Items.Count != 0)
         {
             AddToComboBox.UpdateItems(cbConvObjDir.Items[0].ToString(), cbConvTexDir);
         }
     }
 }
Пример #8
0
        /// <summary>
        /// Converts the items in a ComboBox to a string array which can be saved to a JSON file.
        /// </summary>
        /// <param name="cBtoSave"></param>
        /// <returns></returns>
        private string[] saveComboBox(ComboBox cBtoSave)
        {
            //Add the 'text' item as if it were a user selection, which puts it at the top of the list of items
            if (cBtoSave.Text != "")
            {
                AddToComboBox.UpdateItems(cBtoSave.Text, cBtoSave);
            }

            string[] cbItems = new string[cBtoSave.Items.Count];
            cBtoSave.Items.CopyTo(cbItems, 0);
            return(cbItems);
        }
Пример #9
0
        private void tabControl1_Selected(object sender, TabControlEventArgs e)
        {
            //add typed text to game dir combo box to make it official
            AddToComboBox.UpdateItems(cbGameDir.Text, cbGameDir);
            TabControl tC = (TabControl)sender;

            if (tC.SelectedIndex == 2) //3rd page selected, resource paths (for finding original CRF files)
            {
                if (chkAutoSetResourceDir.Checked)
                {
                    AddToComboBox.UpdateItems(cbGameDir.Text, cbResDir);
                }
            }
        }
Пример #10
0
        private void convertObject()
        {
            //Ensure res dir matches game dir if 'auto set' is checked
            if (chkAutoSetResourceDir.Checked)
            {
                AddToComboBox.UpdateItems(cbGameDir.Text, cbResDir);
            }
            //Ensure conv tex dir matches obj dir if checkbox is selected
            if (chkConvTexInObjDir.Checked)
            {
                AddToComboBox.UpdateItems(cbConvObjDir.Text, cbConvTexDir);
            }

            errorCheck();
            modelExtracted = false;         //initialise value
            ObjectType obType      = getObjectType(cbObjModel.Text);
            string     modelFolder = "obj"; //obj or mesh, depending on object type

            if (obType == ObjectType.Mesh)
            {
                modelFolder = "mesh";
            }

            if (checkList.Count == 0)                       //checks that relevant things have been filled in, but not if they're any good.
            {
                if (openCRFs(obType) && checkWriteAccess()) //checks that conversion can probably be done.
                {
                    string shortName       = Path.GetFileName(cbObjModel.Text).Trim();
                    string chosenModelPath = findModelFile(cbObjModel.Text, modelFolder, shortName);
                    if (chosenModelPath != "")
                    {
                        string noExt = Path.GetFileNameWithoutExtension(shortName);

                        string eFilePath = Path.Combine(cbConvObjDir.Text, noExt + ".e");

                        if (chosenModelPath.ToLower().EndsWith(".bin"))
                        {
                            string binToECommand = "\"" + cbBintoE.Text + "\" \"" + chosenModelPath + "\" \"" + eFilePath + "\"";
                            RunCommand.Execute(binToECommand);
                        }
                        else
                        {
                            File.Copy(chosenModelPath, eFilePath, true);
                        }
                        if (modelExtracted)
                        {
                            File.Delete(chosenModelPath); //delete source file if it was extracted from a CRF.
                        }
                        if (checkEFile(eFilePath))
                        {
                            if (!chkNoTextures.Checked)
                            {
                                convertETextures(eFilePath, modelFolder);
                            }

                            editEFile(eFilePath);

                            if (rdo3dsConv.Checked)
                            {
                                string eto3dsCommand = generate3dsCommand(eFilePath);
                                RunCommand.Execute(eto3dsCommand);
                                File.Delete(eFilePath);
                            }
                        }
                        else
                        {
                            MessageBox.Show(".e file not created or bintoe failed.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        }
                    }
                    else
                    {
                        MessageBox.Show(cbObjModel.Text + " cannot be found.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    }
                }
            }

            else
            {
                StringBuilder sB = new StringBuilder();
                foreach (string error in checkList)
                {
                    sB.AppendLine(error);
                }
                MessageBox.Show(sB.ToString(), "Errors", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Пример #11
0
 private void btnBrowseResDir_Click(object sender, EventArgs e)
 {
     AddToComboBox.UpdateItems(dlgAltResDir, cbResDir);
 }
Пример #12
0
 private void btnBrowseTexConvProg_Click(object sender, EventArgs e)
 {
     AddToComboBox.UpdateItems(dlgTexConvProgPath, cbTexConvProg);
 }
Пример #13
0
 private void btnBrowseEto3ds_Click(object sender, EventArgs e)
 {
     AddToComboBox.UpdateItems(dlgEto3dsPath, cbEto3ds);
 }
Пример #14
0
 private void btnBrowseBintoe_Click(object sender, EventArgs e)
 {
     AddToComboBox.UpdateItems(dlgBinToEPath, cbBintoE);
 }
Пример #15
0
 private void btnObjBrowse_Click(object sender, EventArgs e)
 {
     AddToComboBox.UpdateItems(dlgSelObject, cbObjModel);
 }
Пример #16
0
 private void btnBrowseResMod_Click(object sender, EventArgs e)
 {
     AddToComboBox.UpdateItems(dlgResMod, cbResMod);
 }
Пример #17
0
 private void btnBrowseConvTexDir_Click(object sender, EventArgs e)
 {
     AddToComboBox.UpdateItems(dlgConvTexDir, cbConvTexDir);
 }