Exemplo n.º 1
0
        private void buttonSave_Click(object sender, EventArgs e)
        {
            m_project.m_name             = textProjectName.Text;
            m_project.m_author           = textProjectAuthor.Text;
            m_project.m_bundleIdentifier = textProjectBundleIdentifier.Text;
            m_project.m_iconFile         = textGameIcon.Text;
            m_project.SaveJson();

            UpdateInfo();
            ShowInfoSave(false);

            Program.MainForm.ReloadProjects();
        }
Exemplo n.º 2
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            if (textProjectName.Text == "")
            {
                MessageBox.Show(this, "You have to enter a project name!", Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            var projectId   = GetProperFolderName(textProjectName.Text);
            var projectPath = Path.Combine(Settings.Default.Path_Projects, projectId);

            if (Directory.Exists(projectPath))
            {
                MessageBox.Show(this, "The foler \"" + projectPath + "\" already exists. Delete or move it to create a project with this name.", Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            Directory.CreateDirectory(projectPath);

            var project = new ProjectInfo(projectPath);

            project.m_name             = textProjectName.Text;
            project.m_author           = textProjectAuthor.Text;
            project.m_bundleIdentifier = textProjectBundleIdentifier.Text;
            if (radioLove2D.Checked)
            {
                project.m_type = LoveType.Love2D;
            }
            else if (radioLovr.Checked)
            {
                project.m_type = LoveType.Lovr;
            }
            project.SaveJson();

            Program.MainForm.ReloadProjects();

            new FormProject(project).Show(Program.MainForm);
            Close();
        }