예제 #1
0
파일: Form1.cs 프로젝트: RSoul82/BinMaster
 private void cbConvObjDir_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (chkConvTexInObjDir.Checked)
     {
         AddToComboBox.UpdateItems(cbConvObjDir.Text, cbConvTexDir);
     }
 }
예제 #2
0
파일: Form1.cs 프로젝트: RSoul82/BinMaster
 private void btnBrowseGameDir_Click(object sender, EventArgs e)
 {
     AddToComboBox.UpdateItems(dlgGameDir, cbGameDir);
     if (chkAutoSetResourceDir.Checked)
     {
         AddToComboBox.UpdateItems(cbGameDir.Text, cbResDir);
     }
 }
예제 #3
0
파일: Form1.cs 프로젝트: RSoul82/BinMaster
 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
파일: Form1.cs 프로젝트: RSoul82/BinMaster
        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
파일: Form1.cs 프로젝트: RSoul82/BinMaster
        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
파일: Form1.cs 프로젝트: RSoul82/BinMaster
        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
파일: Form1.cs 프로젝트: RSoul82/BinMaster
 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
파일: Form1.cs 프로젝트: RSoul82/BinMaster
        /// <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
파일: Form1.cs 프로젝트: RSoul82/BinMaster
        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
파일: Form1.cs 프로젝트: RSoul82/BinMaster
        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
파일: Form1.cs 프로젝트: RSoul82/BinMaster
 private void btnBrowseResDir_Click(object sender, EventArgs e)
 {
     AddToComboBox.UpdateItems(dlgAltResDir, cbResDir);
 }
예제 #12
0
파일: Form1.cs 프로젝트: RSoul82/BinMaster
 private void btnBrowseTexConvProg_Click(object sender, EventArgs e)
 {
     AddToComboBox.UpdateItems(dlgTexConvProgPath, cbTexConvProg);
 }
예제 #13
0
파일: Form1.cs 프로젝트: RSoul82/BinMaster
 private void btnBrowseEto3ds_Click(object sender, EventArgs e)
 {
     AddToComboBox.UpdateItems(dlgEto3dsPath, cbEto3ds);
 }
예제 #14
0
파일: Form1.cs 프로젝트: RSoul82/BinMaster
 private void btnBrowseBintoe_Click(object sender, EventArgs e)
 {
     AddToComboBox.UpdateItems(dlgBinToEPath, cbBintoE);
 }
예제 #15
0
파일: Form1.cs 프로젝트: RSoul82/BinMaster
 private void btnObjBrowse_Click(object sender, EventArgs e)
 {
     AddToComboBox.UpdateItems(dlgSelObject, cbObjModel);
 }
예제 #16
0
파일: Form1.cs 프로젝트: RSoul82/BinMaster
 private void btnBrowseResMod_Click(object sender, EventArgs e)
 {
     AddToComboBox.UpdateItems(dlgResMod, cbResMod);
 }
예제 #17
0
파일: Form1.cs 프로젝트: RSoul82/BinMaster
 private void btnBrowseConvTexDir_Click(object sender, EventArgs e)
 {
     AddToComboBox.UpdateItems(dlgConvTexDir, cbConvTexDir);
 }