private void scripts_button_Click(object sender, EventArgs e) { String init_TAW_View_Distance = this.parameters["init_TAW_View_Distance"].ToString(); // Setup parameters if (disableNone_checkbox.Checked) { init_TAW_View_Distance += "tawvd_disablenone = true;\n"; } if (enableMaxRange_checkBox.Checked) { init_TAW_View_Distance += "tawvd_maxRange = " + maxRange.Value.ToString() + ";\n"; } this.parameters["init_TAW_View_Distance"] = init_TAW_View_Distance; // Go to Form 5 this.Hide(); Form5_Debrief new_form = new Form5_Debrief(this.missionDirectory, this.parameters); new_form.ShowDialog(); }
private void scripts_button_Click(object sender, EventArgs e) { using (System.IO.StreamWriter sw = new System.IO.StreamWriter(System.IO.Path.Combine(this.missionDirectory, FOLDER_SCRIPTS, WEATHER_SCRIPTS), true)) { sw.WriteLine("if (hasInterface) then {"); sw.WriteLine(" _handle = ["); sw.WriteLine(" cameraOn,"); sw.WriteLine(" ["); if (fog_checkbox.Checked) { sw.Write(" [\"fog\", {true}]"); firstItemAdded = true; } if (sand_checkbox.Checked) { if (firstItemAdded) { sw.WriteLine(","); } sw.Write(" [\"sand\", {true}]"); firstItemAdded = true; } if (snow_checkbox.Checked) { if (firstItemAdded) { sw.WriteLine(","); } sw.Write(" [\"snow\", {true}]"); firstItemAdded = true; } if (wind_checkbox.Checked) { if (firstItemAdded) { sw.WriteLine(","); } sw.Write(" [\"wind\", {true}]"); firstItemAdded = true; } sw.WriteLine(""); sw.WriteLine(" ]"); sw.WriteLine(" ] call FHQ_fnc_weatherEffect;"); sw.WriteLine(" FHQ_weather = _handle;"); if (fog_checkbox.Checked) { sw.WriteLine(" [_handle, \"fogInterval\", " + fogInterval.Value.ToString() + "] call FHQ_fnc_setWeatherEffect;"); } if (sand_checkbox.Checked) { sw.WriteLine(" [_handle, \"sandInterval\", " + sandInterval.Value.ToString() + "] call FHQ_fnc_setWeatherEffect;"); } if (snow_checkbox.Checked) { sw.WriteLine(" [_handle, \"snowInterval\", " + snowInterval.Value.ToString() + "] call FHQ_fnc_setWeatherEffect;"); } if (wind_checkbox.Checked) { sw.WriteLine(" [_handle, \"windInterval\", " + windInterval.Value.ToString() + "] call FHQ_fnc_setWeatherEffect;"); } sw.WriteLine("};"); } // Go to Form 5 or next Form 4 Scripts this.Hide(); if (this.parameters.ContainsKey("init_TAW_View_Distance")) { Form4a_TAW_View_Distance new_form = new Form4a_TAW_View_Distance(this.missionDirectory, this.parameters); new_form.ShowDialog(); } else { Form5_Debrief new_form = new Form5_Debrief(this.missionDirectory, this.parameters); new_form.ShowDialog(); } }
private void scripts_button_Click(object sender, EventArgs e) { // Create functions folder to put scripts in System.IO.Directory.CreateDirectory(System.IO.Path.Combine(this.missionDirectory, FOLDER_FUNCTION)); using (System.IO.StreamWriter sw = new System.IO.StreamWriter(System.IO.Path.Combine(this.missionDirectory, FOLDER_FUNCTION, COMMON_HPP))) { // Initialize Default common.hpp sw.WriteLine("#define INTERNAL_FUNCTION(x) \\"); sw.WriteLine(" class x \\"); sw.WriteLine(" { \\"); sw.WriteLine(" description = \"Internal Function\"; \\"); sw.WriteLine(" };"); sw.WriteLine(""); sw.WriteLine("#define EXPORTED_FUNCTION(x,y) \\"); sw.WriteLine(" class x \\"); sw.WriteLine(" { \\"); sw.WriteLine(" description = y; \\"); sw.WriteLine(" };"); sw.WriteLine(""); // Generate TAW View Distance if (TAW_view_distance_checkbox.Checked) { sw.WriteLine("#include \"taw_vd\\CfgFunctions.hpp\""); sw.WriteLine(""); copyFolder(SCRIPT_FOLDER_TAW_VD); this.parameters.Add("init_TAW_View_Distance", ""); } sw.WriteLine("class FHQ"); sw.WriteLine("{"); // Generate FHQ Force Tracker if (FHQ_force_tracker_checkbox.Checked) { sw.WriteLine(" #include \"fhq_forcetracker.hpp\""); generateScript(SCRIPT_FHQ_FORCETRACKER, SCRIPT_FOLDER_FHQ_FORCETRACKER); } // Generate FHQ Marker Patrol if (FHQ_marker_patrol_checkbox.Checked) { sw.WriteLine(" #include \"fhq_markerPatrol.hpp\""); generateScript(SCRIPT_FHQ_MARKERPATROL, SCRIPT_FOLDER_FHQ_MARKERPATROL); } // Generate FHQ Safe Add Loadout if (FHQ_safe_add_loadout_checkbox.Checked) { sw.WriteLine(" #include \"fhq_safeAddLoadout.hpp\""); generateScript(SCRIPT_FHQ_SAFEADDLOADOUT, SCRIPT_FOLDER_FHQ_SAFEADDLOADOUT); } // Generate FHQ Weather Effect if (FHQ_weather_effect_checkbox.Checked) { sw.WriteLine(" #include \"fhq_weatherEffect.hpp\""); generateScript(SCRIPT_FHQ_WEATHEREFFECT, SCRIPT_FOLDER_FHQ_WEATHEREFFECT); copyFile(SCRIPT_FHQ_WEATHEREFFECT_FSM); this.parameters.Add("init_FHQ_Weather_Script", "call compile preProcessFileLineNumbers \"scripts\\weatherScript.sqf\";"); } // Generate FHQ Task Tracker by default sw.WriteLine(" #include \"fhq_tasktracker.hpp\""); generateScript(SCRIPT_FHQ_TASKTRACKER, SCRIPT_FOLDER_FHQ_TASKTRACKER); sw.WriteLine("};"); } // Load parameters to add into init if needed if (FHQ_detected_by_checkbox.Checked) { this.parameters.Add("init_FHQ_Detected_By", "// FHQ detection script\n" + "FHQ_fnc_detectedBy = {\n" + " private _detectList = _this select 0;\n"+ " private _triggerList = _this select 1;\n"+ "\n" + " private _knowledge = 0;"+ "\n" + " {\n"+ " private _unit = _x;\n"+ " if (alive _unit) then {\n"+ " _knowledge = _knowledge + ({(_unit knowsAbout _x) > 0} count _detectList);\n"+ " };\n"+ " } forEach _triggerList;\n"+ "\n" + " _knowledge > 0\n"+ "};"); } // Go to Form 5 Debriefing Page or scripts settings this.Hide(); if (FHQ_weather_effect_checkbox.Checked) { Form4a_FHQ_Weather_Effect new_form = new Form4a_FHQ_Weather_Effect(this.missionDirectory, this.parameters); new_form.ShowDialog(); } else { Form5_Debrief new_form = new Form5_Debrief(this.missionDirectory, this.parameters); new_form.ShowDialog(); } }