Merge pull request #1 from 23rd/master

Looks fine ..
This commit is contained in:
Bluzume 2019-08-24 12:23:04 +12:00 committed by GitHub
commit d07425ed36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 2 deletions

View File

@ -114,8 +114,21 @@ namespace CHOVY
RifPath.Text = ReadSetting("RifPath");
}
private void FREEDOM_EnabledChanged(object sender, EventArgs e)
{
Color red = Color.FromArgb(192, 0, 0);
Color black = Color.Black;
bool enabled = this.FREEDOM.Enabled;
this.FREEDOM.ForeColor = enabled ? red : black;
this.FREEDOM.BackColor = enabled ? black : red;
}
private void FREEDOM_Click(object sender, EventArgs e)
{
Action enable = () => {
this.FREEDOM.Enabled = true;
};
if(RifPath.Text == "" || !File.Exists(RifPath.Text))
{
MessageBox.Show("INVALID RIF PATH!\nPlease try \"Find from CMA\"", "RIF ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
@ -132,6 +145,7 @@ namespace CHOVY
return;
}
this.FREEDOM.Enabled = false;
string CmaDir = ReadSetting("CmaDir");
if(CmaDir == "")
{
@ -222,6 +236,7 @@ namespace CHOVY
if (!File.Exists(EbootSignature) || ChovyGen.ExitCode != 0)
{
MessageBox.Show("CHOVY-GEN.EXE FAILED!\nArguments:\n" + ChovyGen.StartInfo.Arguments + "\nStdOut:\n" + ChovyGen.StandardOutput.ReadToEnd() + "\nStdErr:\n" + ChovyGen.StandardError.ReadToEnd());
enable();
return;
}
@ -242,6 +257,7 @@ namespace CHOVY
if (psvimg_create.ExitCode != 0)
{
MessageBox.Show("PSVIMG-CREATE.EXE FAILED!\nArguments:\n" + psvimg_create.StartInfo.Arguments + "\nStdOut:\n" + psvimg_create.StandardOutput.ReadToEnd() + "\nStdErr:\n" + psvimg_create.StandardError.ReadToEnd());
enable();
return;
}
@ -264,6 +280,7 @@ namespace CHOVY
if(psvimg_create.ExitCode != 0)
{
MessageBox.Show("PSVIMG-CREATE.EXE FAILED!\nArguments:\n" + psvimg_create.StartInfo.Arguments + "\nStdOut:\n" + psvimg_create.StandardOutput.ReadToEnd() + "\nStdErr:\n" + psvimg_create.StandardError.ReadToEnd());
enable();
return;
}
@ -293,7 +310,7 @@ namespace CHOVY
snd.Play();
}
enable();
MessageBox.Show("YOU HAVE MADE A SOCIAL CONTRACT WITH FREEDOM!", "FREEDOM!", MessageBoxButtons.OK, MessageBoxIcon.Information);
}

View File

@ -209,6 +209,7 @@
this.FREEDOM.Text = "FREEDOM";
this.FREEDOM.UseVisualStyleBackColor = true;
this.FREEDOM.Click += new System.EventHandler(this.FREEDOM_Click);
this.FREEDOM.EnabledChanged += new System.EventHandler(this.FREEDOM_EnabledChanged);
//
// groupBox1
//
@ -280,7 +281,7 @@
this.Controls.Add(this.PsmChan);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "CHOVY";
this.Text = "CHOVYMainForm";
this.Text = "CHOVY";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.CHOVY_FormClosing);
this.Load += new System.EventHandler(this.CHOVY_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();