aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/Applications/ShiftSweeper.cs
diff options
context:
space:
mode:
authorlempamo <[email protected]>2017-02-27 10:50:00 -0500
committerGitHub <[email protected]>2017-02-27 10:50:00 -0500
commit8ceef636cdaed24cb9a1a8196b6f287397923e83 (patch)
tree810cc99d228f55cb5ac6883cfa18a8a3b8f41749 /ShiftOS.WinForms/Applications/ShiftSweeper.cs
parent496b0cbf8659c99203f48210fd39c572400ae623 (diff)
parent83f87a3893b4bc96a9de6cee27680ff63ab01ffe (diff)
downloadshiftos_thereturn-8ceef636cdaed24cb9a1a8196b6f287397923e83.tar.gz
shiftos_thereturn-8ceef636cdaed24cb9a1a8196b6f287397923e83.tar.bz2
shiftos_thereturn-8ceef636cdaed24cb9a1a8196b6f287397923e83.zip
Merge pull request #100 from lempamo/master
shiftsweeper prettied up
Diffstat (limited to 'ShiftOS.WinForms/Applications/ShiftSweeper.cs')
-rw-r--r--ShiftOS.WinForms/Applications/ShiftSweeper.cs22
1 files changed, 11 insertions, 11 deletions
diff --git a/ShiftOS.WinForms/Applications/ShiftSweeper.cs b/ShiftOS.WinForms/Applications/ShiftSweeper.cs
index c746017..6c64d30 100644
--- a/ShiftOS.WinForms/Applications/ShiftSweeper.cs
+++ b/ShiftOS.WinForms/Applications/ShiftSweeper.cs
@@ -1,4 +1,4 @@
-/*
+/*
* MIT License
*
* Copyright (c) 2017 Michael VanOverbeek and ShiftOS devs
@@ -192,14 +192,14 @@ namespace ShiftOS.WinForms.Applications
}
}
- private Button makeButton(int col, int row)
+ private PictureBox makeButton(int col, int row)
{
- Button bttn = new Button();
+ PictureBox bttn = new PictureBox();
bttn.Text = "";
bttn.Name = col.ToString() + " " + row.ToString();
Controls.AddRange(new System.Windows.Forms.Control[] { bttn, });
- bttn.Size = new System.Drawing.Size(minefieldPanel.Width / minefieldPanel.ColumnCount, (minefieldPanel.Height / minefieldPanel.RowCount) + 10);
+ bttn.Size = new System.Drawing.Size(minefieldPanel.Width / minefieldPanel.ColumnCount, minefieldPanel.Height / minefieldPanel.RowCount);
bttn.Click += new System.EventHandler(bttnOnclick);
bttn.BackgroundImage = Properties.Resources.SweeperTileBlock;
bttn.BackgroundImageLayout = ImageLayout.Stretch;
@@ -211,9 +211,9 @@ namespace ShiftOS.WinForms.Applications
{
if (!ticking.Enabled) return;
- Button bttnClick = sender as Button;
+ PictureBox bttnClick = sender as PictureBox;
- if (bttnClick == null) return; //not a button.
+ if (bttnClick == null) return;
string[] split = bttnClick.Name.Split(new Char[] { ' ' });
@@ -299,10 +299,10 @@ namespace ShiftOS.WinForms.Applications
Int32 cp = 0;
origminecount = origminecount * 10;
if (minetimer < 31) cp = (origminecount * 3);
- if (minetimer < 61) cp = (Int32)(origminecount * 2.5);
- if (minetimer < 91) cp = (origminecount * 2);
- if (minetimer < 121) cp = (Int32)(origminecount * 1.5);
- if (minetimer > 120) cp = (origminecount * 1);
+ else if (minetimer < 61) cp = (Int32)(origminecount * 2.5);
+ else if (minetimer < 91) cp = (origminecount * 2);
+ else if (minetimer < 121) cp = (Int32)(origminecount * 1.5);
+ else if (minetimer > 120) cp = (origminecount * 1);
SaveSystem.TransferCodepointsFrom("shiftsweeper", cp);
pictureBox1.Image = Properties.Resources.SweeperWinFace;
}
@@ -337,7 +337,7 @@ namespace ShiftOS.WinForms.Applications
private void trueform(int x, int y)
{
- Button bttn = (Button)minefieldPanel.GetControlFromPosition(x, y);
+ PictureBox bttn = (PictureBox)minefieldPanel.GetControlFromPosition(x, y);
if (minemap[x,y] == 0) bttn.BackgroundImage = Properties.Resources.SweeperTile0;
else if (minemap[x, y] == 1) bttn.BackgroundImage = Properties.Resources.SweeperTile1;
else if (minemap[x, y] == 2) bttn.BackgroundImage = Properties.Resources.SweeperTile2;