Ejemplo n.º 1
0
        // Handles Testing Mods on the Main Form (when Elsword (the game window) closes).
        private void TestMods2(object sender, EventArgs e)
        {
            var executing = ExecutionManager.ExecutingElsword;

            if (!executing)
            {
                if (ExecutionManager.RunningElswordDirectly)
                {
                    ExecutionManager.DeployCallBack();
                    if (string.Equals(this.Label2.Text, string.Empty))
                    {
                        this.Label2.Text = "Testing Mods...";
                    }
                }
                else
                {
                    var di = new DirectoryInfo(Application.StartupPath + "\\koms");
                    foreach (var fi in di.GetFiles("*.kom"))
                    {
                        var kom_file = fi.Name;
                        KOMManager.MoveOriginalKomFilesBack(kom_file, this.elsDir + "\\data\\backup", this.elsDir + "\\data");
                    }

                    this.Command1.Enabled = true;
                    this.Command2.Enabled = true;
                    this.Command4.Enabled = true;
                    this.Command5.Enabled = true;
                    this.packToolStripMenuItem.Enabled     = true;
                    this.unpackToolStripMenuItem.Enabled   = true;
                    this.testModsToolStripMenuItem.Enabled = true;
                    this.launcherToolStripMenuItem.Enabled = true;
                    this.Label2.Text = string.Empty;

                    // restore window state from before testing mods.
                    this.FindForm().WindowState = FormWindowState.Normal;
                    this.FindForm().Show();
                    this.testModsTmr.Enabled = false;
                }
            }
        }