made shiftsweeper look a bit nicer

This commit is contained in:
lempamo 2017-02-27 09:53:39 -05:00
parent ba1519e3ce
commit 750ee14486
2 changed files with 44 additions and 44 deletions

View file

@ -169,9 +169,9 @@ namespace ShiftOS.WinForms.Applications
this.lblinfo2.AutoSize = true;
this.lblinfo2.Location = new System.Drawing.Point(4, 22);
this.lblinfo2.Name = "lblinfo2";
this.lblinfo2.Size = new System.Drawing.Size(128, 13);
this.lblinfo2.Size = new System.Drawing.Size(233, 13);
this.lblinfo2.TabIndex = 8;
this.lblinfo2.Text = "Right Button: Toggle Flag";
this.lblinfo2.Text = "Click the button on the right to toggle flag mode.";
//
// flagButton
//
@ -228,36 +228,36 @@ namespace ShiftOS.WinForms.Applications
// hardPanel
//
this.hardPanel.ColumnCount = 30;
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249042F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249044F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249044F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249044F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249044F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249044F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249044F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249044F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249044F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 3.448275F));
this.hardPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.hardPanel.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
this.hardPanel.Location = new System.Drawing.Point(4, 40);
this.hardPanel.Name = "hardPanel";
@ -298,7 +298,7 @@ namespace ShiftOS.WinForms.Applications
this.Controls.Add(this.easyPanel);
this.Controls.Add(this.pictureBox1);
this.Name = "ShiftSweeper";
this.Size = new System.Drawing.Size(624, 426);
this.Size = new System.Drawing.Size(596, 426);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.flagButton)).EndInit();
this.ResumeLayout(false);

View file

@ -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;