private void btnSQFFile_Click(object sender, RoutedEventArgs e) { var file = SaveDialog("script", ".sqf", "SQF Datei (*.sqf)|*.sqf|Text Datei (*.txt)|*.txt|All files (*.*)|*.*"); _sqfFile = file; if (file != null) { TxtSqfFile.Text = file.ToString(); } }
private void btnSQMFile_Click(object sender, RoutedEventArgs e) { FileContainer file = openDialog("mission", ".sqm", "SQM Datein (*.sqm)|*.sqm"); sqmFile = file; if (file != null) { txtSQMFile.Text = file.ToString(); } }
private void btnSQMFile_Click(object sender, RoutedEventArgs e) { var file = OpenDialog("mission", ".sqm", "SQM Datein (*.sqm)|*.sqm"); _sqmFile = file; if (file != null) { TxtSqmFile.Text = file.ToString(); } }
private void btnCreateInitFiles_Click(object sender, RoutedEventArgs e) { if (!checkFiles()) { return; } string scriptCode = ""; scriptCode = "if !(hasInterface or isServer) then\n" + "{\n" + "\tHeadlessVariable = true;\n" + "\tpublicVariable \"HeadlessVariable\";\n" + "\texecVM \"" + sqfFile.fileName + "\";\n" + "};"; FileContainer initHCFile = new FileContainer(sqfFile.fileName, sqfFile.filePath); initHCFile.fileName = "initHC.sqf"; saveFile(initHCFile.ToString(), scriptCode); string initCode = "if (isServer) then\n" + "{\n" + "\tif (isNil \"HeadlessVariable\") then\n" + "\t{\n" + "\t\texecVM \"" + sqfFile.fileName + "\";\n" + "\t};\n" + "};"; string descriptionCode = "class CfgFunctions\n" + "{\n" + "\tclass myTag\n" + "\t{\n" + "\t\tclass myCategory\n" + "\t\t{\n" + "\t\t\tclass myFunction\n" + "\t\t\t{\n" + "\t\t\t\tpostInit = 1;\n" + "\t\t\t\tfile = \"initHC.sqf\";\n" + "\t\t\t};\n" + "\t\t};\n" + "\t};\n" + "};\n"; ShowCode sc = new ShowCode(initCode, descriptionCode); sc.Show(); }