Пример #1
0
        private void engineButton_Click(object sender, EventArgs e)
        {
            // Apply changes to mainData
            MainData.ApplyChanges(enOutputlog.Checked, resDialogCheck.Checked);

            // check if everything is ok
            MainData.LoadMainData(OutputlogLabel, resDialogLabel, resDialogCheck);
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            button1.Enabled = false;
            if (AssemblyFullPath != null)
            {
                if (MDradio.Checked)
                {
                    InitMethod = "Init_MD";
                    try
                    {
                        modPath = mdPath;
                        PatchStarter();
                        if (!Directory.Exists(mdPath))
                        {
                            //if mods folder not exists, create it.
                            Directory.CreateDirectory(mdPath);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(string.Format("Error:{1}{0}{1}{1}Please restart patcher!", ex.Message, Environment.NewLine), "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else if (GFradio.Checked)
                {
                    InitMethod = "Init_GF";
                    try
                    {
                        modPath = gfPath;
                        PatchStarter();
                        if (!Directory.Exists(gfPath))
                        {
                            //if mods folder not exists, create it.
                            Directory.CreateDirectory(gfPath);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(string.Format("Error:{1}{0}{1}{1}Please restart patcher!", ex.Message, Environment.NewLine), "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else if (ADradio.Checked)
                {
                    InitMethod = "Init_AD";
                    try
                    {
                        modPath = adPath;
                        PatchStarter();
                        if (!Directory.Exists(adPath))
                        {
                            //if mods folder not exists, create it.
                            Directory.CreateDirectory(adPath);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(string.Format("Error:{1}{0}{1}{1}Please restart patcher!", ex.Message, Environment.NewLine), "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                //Apply changes to mainData
                MainData.ApplyChanges(enOutputlog.Checked, resDialogCheck.Checked, false);

                //check if everything is ok
                MainData.LoadMainData(OutputlogLabel, resDialogLabel, resDialogCheck);
            }
            else
            {
                MessageBox.Show("Select game path first", "Error path unknown", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            button1.Enabled = false;
            if (AssemblyFullPath != null)
            {
                if (MDradio.Checked)
                {
                    InitMethod = "Init_MD";
                    bool isCloudIgnore = true;
                    if (Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)).ToString() == "OneDrive")
                    {
                        if (MessageBox.Show($"You are about to set your mods folder to a directory that is part of OneDrive cloud.{Environment.NewLine}This is not supported due to On-Demand files that may cause issues.{Environment.NewLine}{Environment.NewLine}Do you want to continue?", "Cloud folder warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
                        {
                            isCloudIgnore = false;
                        }
                    }
                    if (isCloudIgnore)
                    {
                        try
                        {
                            modPath = mdPath;
                            PatchStarter();
                            if (!Directory.Exists(mdPath))
                            {
                                //if mods folder not exists, create it.
                                Directory.CreateDirectory(mdPath);
                            }
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(string.Format("Error:{1}{0}", ex.Message, Environment.NewLine), "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            Log.Write("Error", true, true);
                            Log.Write(ex.Message);
                            Log.Write(ex.ToString());
                        }
                    }
                }
                else if (GFradio.Checked)
                {
                    InitMethod = "Init_GF";
                    try
                    {
                        modPath = gfPath;
                        PatchStarter();
                        if (!Directory.Exists(gfPath))
                        {
                            //if mods folder not exists, create it.
                            Directory.CreateDirectory(gfPath);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(string.Format("Error:{1}{0}", ex.Message, Environment.NewLine), "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        Log.Write("Error", true, true);
                        Log.Write(ex.Message);
                        Log.Write(ex.ToString());
                    }
                }
                else if (ADradio.Checked)
                {
                    InitMethod = "Init_AD";
                    try
                    {
                        modPath = adPath;
                        PatchStarter();
                        if (!Directory.Exists(adPath))
                        {
                            //if mods folder not exists, create it.
                            Directory.CreateDirectory(adPath);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(string.Format("Error:{1}{0}", ex.Message, Environment.NewLine), "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        Log.Write("Error", true, true);
                        Log.Write(ex.Message);
                        Log.Write(ex.ToString());
                    }
                }
                //Apply changes to mainData
                MainData.ApplyChanges(enOutputlog.Checked, resDialogCheck.Checked, false);

                //check if everything is ok
                MainData.LoadMainData(OutputlogLabel, resDialogLabel, resDialogCheck);
            }
            else
            {
                MessageBox.Show("Select game path first", "Error path unknown", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }