private void CreateProject_Button_Click(object sender, EventArgs e)
        {
            string projectJet = Environment.CurrentDirectory + "\\" + CurrentProjectVariables.GameName + "_Original.jet";

            bool result = GeneralMethods.Bad_JetPass(projectJet, Password_TextBox.Text);

            if (!result)
            {
                ConsoleHandler.append("Password correct");
                CurrentProjectVariables.JetPassword = Password_TextBox.Text;
                ProjectHandler.SaveProject();

                if (Dont_Ask_Again_Checkbox.Checked)
                {
                    ZipForm.rememberedPassword = Password_TextBox.Text;
                    Serializer.SaveSettings();
                }

                var zip = new ZipForm();
                zip.password = Password_TextBox.Text;
                zip.Show();

                if (isExtracting)
                {
                    zip.Extract();
                }
                else
                {
                    zip.launch = launch;
                    zip.Compile();
                }
                this.Close();
            }
            else
            {
                ConsoleHandler.append_Force("You entered a bad password. Please check your password and try again");
            }

            /*
             * string projectJet = CurrentProjectVariables.PathToProjectClassFile + "\\" + CurrentProjectVariables.ProjectName + ".jet";
             *
             * if (File.Exists(projectJet))
             * {
             *
             * }
             * else
             * {
             *  ConsoleHandler.append_Force("Your project file was not detected...");
             * }*/

            //GetPass();
        }
        public void GetPass()
        {
            string password = Password_TextBox.Text.ToString();

            if (password.Length < 3)
            {
                ConsoleHandler.append("The password you entered was too short...");
                MessageBox.Show("The password you entered was too short...");
            }
            else
            {
                ConsoleHandler.append("You entered the password:  "******"BTDB";
                zip.password     = password;
                zip.projName     = projName;
                zip.Show();

                if (Dont_Ask_Again_Checkbox.Checked)
                {
                    rememberPass = true;
                    ConsoleHandler.append("Program will remember your password for the rest of this session.");
                    ZipForm.rememberedPassword = Password_TextBox.Text;
                }
                else
                {
                    rememberPass = false;
                    ZipForm.rememberedPassword = "";
                }
                if (isExtracting == true)
                {
                    zip.Extract();
                }
                else
                {
                    zip.destPath = destPath;
                    zip.launch   = launch;
                    zip.Compile();
                }
                this.Close();
            }
        }
Beispiel #3
0
        public static void CompileJet(string switchCase)
        {
            if (New_JsonEditor.isJsonError != true)
            {
                if (JetProps.get().Count == 1)
                {
                    string dest         = "";
                    bool   isOutputting = false;
                    bool   abort        = false;

                    var zip = new ZipForm();

                    if (switchCase.Contains("output"))
                    {
                        isOutputting = true;
                        string exPath = CurrentProjectVariables.ExportPath;
                        if (exPath != "" && exPath != null)
                        {
                            DialogResult diag = MessageBox.Show("Do you want export to the same place as last time?", "Export to the same place?", MessageBoxButtons.YesNo);
                            if (diag == DialogResult.Yes)
                            {
                                dest = exPath;
                            }
                            else
                            {
                                exPath = "";
                            }
                        }
                        if (exPath == "" || exPath == null)
                        {
                            ConsoleHandler.append("Select where you want to export your jet file. Make sure to give it a name..");
                            dest = OutputJet();

                            CurrentProjectVariables.ExportPath = dest;
                            ProjectHandler.SaveProject();

                            //ZipForm.savedExportPath = dest;
                            //Serializer.SaveSmallSettings("export path");
                        }
                        zip.destPath = dest;
                    }


                    else if (switchCase.Contains("launch"))
                    {
                        if (switchCase.Contains("nkh"))
                        {
                            zip.launchNKH = true;
                        }

                        if (CurrentProjectVariables.GamePath != null && CurrentProjectVariables.GamePath != "")
                        {
                            zip.launch   = true;
                            zip.destPath = CurrentProjectVariables.GamePath + "\\Assets\\" + ReturnJetName(CurrentProjectVariables.GameName);
                        }
                        else
                        {
                            ConsoleHandler.force_append_Notice("Unable to find your game directory, and therefore, unable to launch. Do you want to try browsing for your game?");
                            DialogResult diag = MessageBox.Show("Unable to find your game directory, and therefore, unable to launch. Do you want to try browsing for your game?", "Browse for game?", MessageBoxButtons.YesNoCancel);
                            if (diag == DialogResult.Yes)
                            {
                                browseForExe(CurrentProjectVariables.GameName);
                            }
                            if (diag == DialogResult.No)
                            {
                                DialogResult diag2 = MessageBox.Show("Do you want to just save your jet file instead?", "Save jet instead?", MessageBoxButtons.YesNo);
                                {
                                    if (diag2 == DialogResult.Yes)
                                    {
                                        isOutputting = true;
                                        string exPath = CurrentProjectVariables.ExportPath;
                                        if (exPath != "" && exPath != null)
                                        {
                                            DialogResult diagz = MessageBox.Show("Do you want export to the same place as last time?", "Export to the same place?", MessageBoxButtons.YesNo);
                                            if (diagz == DialogResult.Yes)
                                            {
                                                dest = exPath;
                                            }
                                            else
                                            {
                                                exPath = "";
                                            }
                                        }
                                        if (exPath == "" || exPath == null)
                                        {
                                            ConsoleHandler.append("Select where you want to export your jet file. Make sure to give it a name..");
                                            dest = OutputJet();
                                            CurrentProjectVariables.ExportPath = dest;
                                            ProjectHandler.SaveProject();

                                            /*ZipForm.savedExportPath = dest;
                                             * Serializer.SaveSmallSettings("export path");*/
                                        }
                                        zip.destPath = dest;
                                    }
                                }
                            }
                            else
                            {
                                abort = true;
                            }
                        }
                    }
                    if (!abort)
                    {
                        if (isOutputting)
                        {
                            if (dest != null && dest != "")
                            {
                                zip.destPath = dest;
                                zip.Show();
                                zip.Compile();
                            }
                            else
                            {
                                ConsoleHandler.append("Export cancelled...");
                            }
                        }
                        else
                        {
                            zip.Show();
                            zip.Compile();
                        }
                    }
                }
                else
                {
                    if (JetProps.get().Count < 1)
                    {
                        MessageBox.Show("You have no .jets or projects open, you need one to launch.");
                        ConsoleHandler.append("You need to open a project to continue...");
                    }
                    else
                    {
                        MessageBox.Show("You have multiple .jets or projects open, only one can be launched.");
                        ConsoleHandler.append("You need to close projects to continue...");
                    }
                }
            }
        }