private void buttonAddEmulator_Click(object sender, EventArgs e) { textBoxEmuName.Text = RomFunctions.FillEmuName(textBoxEmuName.Text, textBoxPath.Text, checkBoxUseRetroarch.Checked); if (textBoxEmuName.Text == "" || textBoxPath.Text == "" || textBoxCommand.Text == "") { FormCustomMessage.ShowError("Fill the name, path and command first."); return; } if (emulators.Any(x => x.Name.ToLower() == textBoxEmuName.Text.ToLower())) { FormCustomMessage.ShowError("There is an emulator using the name " + textBoxEmuName.Text); return; } emulators.Add(new Emulator() { Name = textBoxEmuName.Text, Path = textBoxPath.Text, Command = textBoxCommand.Text }); FillGridEmulators(); textBoxEmuName.Text = ""; textBoxPath.Text = ""; textBoxCommand.Text = ""; checkBoxUseRetroarch.CheckState = CheckState.Unchecked; }
private void buttonPath_Click(object sender, EventArgs e) { OpenFileDialog open = new OpenFileDialog(); open.InitialDirectory = Environment.CurrentDirectory; open.Filter = "EXE | *.exe"; open.ShowDialog(); if (string.IsNullOrEmpty(open.FileName)) { return; } textBoxPath.Text = open.FileName; if (string.IsNullOrEmpty(open.FileName)) { return; } if (textBoxDefaultRomExtensions.Text == string.Empty) { textBoxDefaultRomExtensions.Text = "zip"; } if (string.IsNullOrEmpty(textBoxCommand.Text)) { textBoxCommand.Text = Values.DefaultCommand; } textBoxEmuName.Text = RomFunctions.FillEmuName(textBoxEmuName.Text, textBoxPath.Text, checkBoxUseRetroarch.Checked); }
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); } }