private void AddNewFromClipboardToolStripMenuItem_Click(object sender, EventArgs e) { BCAMEntry NewFromClipboard = new BCAMEntry(); if (NewFromClipboard.FromClipboard(Clipboard.GetText())) { if (Cameras == null) { Console.WriteLine(Program.ConsoleHalfSplitter); Console.WriteLine("Failed to add the camera!\nNo camera file is active"); Console.WriteLine(Program.ConsoleHalfSplitter); return; } AddCamera(NewFromClipboard); Console.WriteLine("Camera Added from Clipboard!"); } else { Console.WriteLine("Clipboard doesn't contain a Valid LCP Camera!" + (Cameras == null ? "\nAnd there is no camera file currently active":"")); } }
private void SelectButton_Click(object sender, EventArgs e) { if (((CameraEditorForm)ParentForm).Cameras == null) { Console.WriteLine(Program.ConsoleHalfSplitter); Console.WriteLine("Failed to add the preset!\nNo camera file is active"); Console.WriteLine(Program.ConsoleHalfSplitter); return; } try { string full = ((FileInfo)PresetsTreeView.SelectedNode.Tag).FullName; if (!File.Exists(full)) { PresetsTreeView.SelectedNode.Remove(); throw new FileNotFoundException($"Could not find file '{full}'."); } Console.WriteLine("Loading preset..."); LCPP CurrentPreset = new LCPP(full); for (int i = 0; i < CurrentPreset.Count; i++) { BCAMEntry entry = new BCAMEntry(); entry.FromClipboard(CurrentPreset[i]); ((CameraEditorForm)ParentForm).AddCamera(entry); Console.Write($"\r{Math.Min(((float)(i + 1) / (float)CurrentPreset.Count) * 100.0f, 100.0f)}% "); } Console.WriteLine(); Console.WriteLine("Preset loaded successfully!"); if (CurrentPreset.Count == 0) { Console.WriteLine("(Though the preset has no cameras...)"); } } catch (Exception ex) { Console.WriteLine(Program.ConsoleHalfSplitter); Console.WriteLine("Preset Failed to load!\n" + ex.GetType().FullName + ": " + ex.Message); Console.WriteLine(Program.ConsoleHalfSplitter); } }