aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAShifter <[email protected]>2018-12-25 20:55:21 -0700
committerAShifter <[email protected]>2018-12-25 20:55:21 -0700
commit60a158a21f24187bd1dd03eb302015f8ae3b6dea (patch)
tree4fb2aa721eec29a0d6bc14be3b4e40c2c567c11b
parent87546f325f6fb24dcc5ab34851cc06b074d79984 (diff)
downloadshiftos-rewind-60a158a21f24187bd1dd03eb302015f8ae3b6dea.tar.gz
shiftos-rewind-60a158a21f24187bd1dd03eb302015f8ae3b6dea.tar.bz2
shiftos-rewind-60a158a21f24187bd1dd03eb302015f8ae3b6dea.zip
Fix Infobox ShenanigansHEADmaster
first commit in a LONG TIME
-rw-r--r--ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs5
-rw-r--r--ShiftOS.Main/Apps/Breakout.cs20
2 files changed, 16 insertions, 9 deletions
diff --git a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs
index 1f4af1b..901e3ba 100644
--- a/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs
+++ b/ShiftOS.Engine/WindowManager/InfoboxTemplate.Designer.cs
@@ -85,7 +85,6 @@
this.btnOpt2.TabIndex = 5;
this.btnOpt2.Text = "button2";
this.btnOpt2.UseVisualStyleBackColor = false;
- this.btnOpt1.Click += new System.EventHandler(this.btnOpt1_Click);
//
// InfoboxTemplate
//
@@ -108,8 +107,8 @@
#endregion
public System.Windows.Forms.PictureBox pictureBox1;
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.Button btnOpt1;
+ public System.Windows.Forms.Button btnOpt2;
}
}
diff --git a/ShiftOS.Main/Apps/Breakout.cs b/ShiftOS.Main/Apps/Breakout.cs
index db10962..4e41a14 100644
--- a/ShiftOS.Main/Apps/Breakout.cs
+++ b/ShiftOS.Main/Apps/Breakout.cs
@@ -75,14 +75,22 @@ namespace ShiftOS.Main.Apps
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);
ShiftWM.StartInfoboxSession(null, infoBox.isOK.ToString(), InfoboxTemplate.ButtonType.Ok);
- if (infoBox.isOK)
- {
- DrawBlocks();
- ResetToRest();
- gameTimer.Start();
- }
+ infoBox.btnOpt1.Click += InfoboxYes;
+ infoBox.btnOpt2.Click += InfoboxYes;
}
}
+
+ 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()
{
int h = 20;