private void cbConvObjDir_SelectedIndexChanged(object sender, EventArgs e) { if (chkConvTexInObjDir.Checked) { AddToComboBox.UpdateItems(cbConvObjDir.Text, cbConvTexDir); } }
private void btnBrowseGameDir_Click(object sender, EventArgs e) { AddToComboBox.UpdateItems(dlgGameDir, cbGameDir); if (chkAutoSetResourceDir.Checked) { AddToComboBox.UpdateItems(cbGameDir.Text, cbResDir); } }
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); } }
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); } }
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); } }
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); } }
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); } } }
/// <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); }
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); } } }
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); } }
private void btnBrowseResDir_Click(object sender, EventArgs e) { AddToComboBox.UpdateItems(dlgAltResDir, cbResDir); }
private void btnBrowseTexConvProg_Click(object sender, EventArgs e) { AddToComboBox.UpdateItems(dlgTexConvProgPath, cbTexConvProg); }
private void btnBrowseEto3ds_Click(object sender, EventArgs e) { AddToComboBox.UpdateItems(dlgEto3dsPath, cbEto3ds); }
private void btnBrowseBintoe_Click(object sender, EventArgs e) { AddToComboBox.UpdateItems(dlgBinToEPath, cbBintoE); }
private void btnObjBrowse_Click(object sender, EventArgs e) { AddToComboBox.UpdateItems(dlgSelObject, cbObjModel); }
private void btnBrowseResMod_Click(object sender, EventArgs e) { AddToComboBox.UpdateItems(dlgResMod, cbResMod); }
private void btnBrowseConvTexDir_Click(object sender, EventArgs e) { AddToComboBox.UpdateItems(dlgConvTexDir, cbConvTexDir); }