Fix Infobox Shenanigans

first commit in a LONG TIME
This commit is contained in:
AShifter 2018-12-25 20:55:21 -07:00
parent 87546f325f
commit 60a158a21f
2 changed files with 16 additions and 9 deletions

View file

@ -85,7 +85,6 @@
this.btnOpt2.TabIndex = 5; this.btnOpt2.TabIndex = 5;
this.btnOpt2.Text = "button2"; this.btnOpt2.Text = "button2";
this.btnOpt2.UseVisualStyleBackColor = false; this.btnOpt2.UseVisualStyleBackColor = false;
this.btnOpt1.Click += new System.EventHandler(this.btnOpt1_Click);
// //
// InfoboxTemplate // InfoboxTemplate
// //
@ -108,8 +107,8 @@
#endregion #endregion
public System.Windows.Forms.PictureBox pictureBox1; public System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Timer changeSize; private System.Windows.Forms.Timer changeSize;
private System.Windows.Forms.Button btnOpt1;
private System.Windows.Forms.Button btnOpt2;
public System.Windows.Forms.Label label1; public System.Windows.Forms.Label label1;
public System.Windows.Forms.Button btnOpt1;
public System.Windows.Forms.Button btnOpt2;
} }
} }

View file

@ -75,14 +75,22 @@ namespace ShiftOS.Main.Apps
gameTimer.Stop(); gameTimer.Stop();
var infoBox = ShiftWM.StartInfoboxSession("Breakout - You Lose! ", "It appears that you have lost the game, meaning\nall codepoints won were lost. Would you\nlike to try again?", InfoboxTemplate.ButtonType.YesNo); var infoBox = ShiftWM.StartInfoboxSession("Breakout - You Lose! ", "It appears that you have lost the game, meaning\nall codepoints won were lost. Would you\nlike to try again?", InfoboxTemplate.ButtonType.YesNo);
ShiftWM.StartInfoboxSession(null, infoBox.isOK.ToString(), InfoboxTemplate.ButtonType.Ok); ShiftWM.StartInfoboxSession(null, infoBox.isOK.ToString(), InfoboxTemplate.ButtonType.Ok);
if (infoBox.isOK) infoBox.btnOpt1.Click += InfoboxYes;
{ infoBox.btnOpt2.Click += InfoboxYes;
DrawBlocks();
ResetToRest();
gameTimer.Start();
}
} }
} }
private void InfoboxYes(object sender, EventArgs e)
{
DrawBlocks();
ResetToRest();
gameTimer.Start();
}
private void InfoboxNo(object sender, EventArgs e)
{
// When user clicks No
}
private void DrawBlocks() private void DrawBlocks()
{ {
int h = 20; int h = 20;