private void buttonSelectCore_Click(object sender, EventArgs e) { var config = ConfigBusiness.GetFolder(Folder.Retroarch); OpenFileDialog dialog = new OpenFileDialog(); if (!string.IsNullOrEmpty(config)) { config = config + "\\" + "cores"; if (Directory.Exists(config)) { dialog.InitialDirectory = config; } } dialog.Filter = "Libreto Core | *.dll"; if (dialog.ShowDialog() == DialogResult.OK) { var corename = RomFunctions.GetFileName(dialog.FileName); textBoxCommand.Text = Values.RetroarchCommand.Replace("[CORE]", corename); textBoxEmuName.Text = RomFunctions.FillEmuName(textBoxEmuName.Text, textBoxPath.Text, checkBoxUseRetroarch.Checked, corename); } }
private void checkBoxUseRetroarch_Click(object sender, EventArgs e) { //buttonSelectCore.Enabled = checkBoxUseRetroarch.Checked; //textBoxPath.Enabled = !checkBoxUseRetroarch.Checked; //textBoxCommand.Enabled = !checkBoxUseRetroarch.Checked; if (!checkBoxUseRetroarch.Checked) { textBoxPath.Text = ""; textBoxCommand.Text = ""; return; } var config = ConfigBusiness.GetFolder(Folder.Retroarch); if (string.IsNullOrEmpty(config)) { FormCustomMessage.ShowError("Retroarch folder not added. Please add on Settings menu."); return; } textBoxPath.Text = config + "\\" + "retroarch.exe"; if (!File.Exists(textBoxPath.Text)) { FormCustomMessage.ShowError("Retroarch exe not found"); return; } textBoxCommand.Text = Values.RetroarchCommand; if (textBoxCommand.Text.Contains("[CORE]")) { buttonSelectCore_Click(sender, e); } }
private void FormSettings_Load(object sender, EventArgs e) { buttonSave.Click += buttonSave_Click; textBoxMameFolder.Text = ConfigBusiness.GetFolder(Folder.MAME); textBoxRetroarchFolder.Text = ConfigBusiness.GetFolder(Folder.Retroarch); }