Ejemplo n.º 1
0
        private void button_add_to_game2_Click(object sender, EventArgs e)
        {
            if (this.textBox_game_path2.Text.Length != 0) //if string length is not 0
            {
                //check if files already exist
                string destination_path = this.textBox_game_path2.Text;
                string config_path      = "/Base/Assets/Configuration/Data/Civ6_Map_Utility/Map_Scripts/";
                string file1            = this.textBox_script_name.Text + ".lua";
                string file2            = this.textBox_script_name.Text + "_MapSettings.xml";
                string file3            = this.textBox_script_name.Text + "_StandardMaps.xml";

                string user_message        = "";
                bool   proceed_file_saving = false;
                if (System.IO.File.Exists(destination_path + config_path + file1) == true)
                {
                    user_message += "File " + file1 + " already exists.\n";
                }
                if (System.IO.File.Exists(destination_path + config_path + file2) == true)
                {
                    user_message += "File " + file2 + " already exists.\n";
                }
                if (System.IO.File.Exists(destination_path + config_path + file3) == true)
                {
                    user_message += "File " + file3 + " already exists.\n";
                }
                if (user_message.Length != 0)
                {
                    user_message       += "\nDo you want to overwrite them?";
                    proceed_file_saving = File_Handler.yes_no_message_box("Overwrite", user_message);
                }
                else
                {
                    proceed_file_saving = true;
                }

                if (proceed_file_saving)
                {
                    Dictionary <string, string> map_scripts_dictionary = generate_dictionary_from_map_scripts();
                    string out_path    = this.textBox_game_path2.Text;
                    string script_path = this.textBox_script_path.Text;

                    List <Dictionary <string, string> > map_scripts_options = generate_dictionary_lists_map_settings();

                    File_Handler.create_map_script_files(out_path, map_scripts_dictionary, map_scripts_options);
                    MessageBox.Show("Files added to the Game path!");
                }
            }
        }
Ejemplo n.º 2
0
        private void button_add_to_game_Click(object sender, EventArgs e)
        {
            if (this.textBox_game_path.Text.Length != 0) //if string length is not 0
            {
                //check if files already exist
                string destination_path = this.textBox_game_path.Text;
                string config_path      = "/Base/Assets/Configuration/Data/Civ6_Map_Utility/Map_Sizes/";
                string file1            = this.textBox_size_name.Text + "_MapSizes.xml";

                string gameplay_path = "/Base/Assets/Gameplay/Data/Civ6_Map_Utility/Map_Sizes/";
                string file2         = this.textBox_size_name.Text + "_Maps.xml";

                string user_message        = "";
                bool   proceed_file_saving = false;

                if (System.IO.File.Exists(destination_path + config_path + file1) == true)
                {
                    user_message += "File " + file1 + " already exists.\n";
                }
                if (System.IO.File.Exists(destination_path + gameplay_path + file2) == true)
                {
                    user_message += "File " + file2 + " already exists.\n"; //didn't get detected. check if made
                }
                if (user_message.Length != 0)
                {
                    user_message       += "\nDo you want to overwrite them?";
                    proceed_file_saving = File_Handler.yes_no_message_box("Overwrite", user_message);
                }
                else
                {
                    proceed_file_saving = true;
                }

                if (proceed_file_saving)
                {
                    if (this.textBox_game_path.Text.Length != 0) //if string length is not 0
                    {
                        Dictionary <string, string> map_sizes_dictionary = generate_dictionary_from_map_size();
                        string path = this.textBox_game_path.Text;

                        File_Handler.create_map_size_files(path, map_sizes_dictionary);

                        MessageBox.Show("Files added to the Game path!");
                    }
                }
            }
        }