private void showFileInExplorerToolStripMenuItem_Click(object sender, EventArgs e) { if (modFileList.SelectedNode != null) { Commonfunctions.ShowFileInExplorer(ActiveMod.FileDirectory + "\\" + modFileList.SelectedNode.FullPath); } }
private void ExecuteGame(string args = "") { if (MainController.Get().Configuration == null) { return; } if (Process.GetProcessesByName("Witcher3").Length != 0) { Commonfunctions.SendNotification("Game is already running!"); return; } var config = MainController.Get().Configuration; var proc = new ProcessStartInfo(config.ExecutablePath) { Arguments = args == "" ? "-net -debugscripts" : args, UseShellExecute = false, RedirectStandardOutput = true }; AddOutput("Executing " + proc.FileName + " " + proc.Arguments + "\n"); var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); var scriptlog = Path.Combine(documents, @"The Witcher 3\scriptslog.txt"); if (File.Exists(scriptlog)) { File.Delete(scriptlog); } Process.Start(proc); }
/// <summary> /// Saves the package to the specified output path. /// </summary> /// <param name="OutputPath">The path to save the file to.</param> public void Save(string OutputPath) { FileStream fsOut = File.Create(OutputPath); ZipOutputStream zipStream = new ZipOutputStream(fsOut); int folderOffset = RootFolder.Length + (RootFolder.EndsWith("\\") ? 0 : 1); Commonfunctions.CompressFolder(RootFolder, zipStream, folderOffset); Commonfunctions.CompressFile(Icon, zipStream, "Icon" + Path.GetExtension(Icon)); Commonfunctions.CompressStream(Commonfunctions.XDocToByteArray(Assembly), "Assembly.xml", zipStream); zipStream.IsStreamOwner = true; zipStream.Close(); }
private void connectButton_Click(object sender, EventArgs e) { if (GameSocket.Connected) { Commonfunctions.SendNotification("Already connected!"); } else { Connect(DebugProtoclAdress, GameSocket); if (GameSocket.Connected) { statusLabel.Text = "Status: Connected"; Commonfunctions.SendNotification("Connected!"); DataRecieveWorker.RunWorkerAsync(); } else { statusLabel.Text = "Status: Error"; Commonfunctions.SendNotification("Failed to connect!"); } } }