aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/Applications
diff options
context:
space:
mode:
authorlempamo <[email protected]>2017-02-26 13:36:01 -0500
committerlempamo <[email protected]>2017-02-26 13:36:01 -0500
commit4fba2d86af9c960fb78b1c0a912b6371f21b487d (patch)
tree4df4d34284ca6a629d9a2f5f0991277faff9edaa /ShiftOS.WinForms/Applications
parentca703e314d596b7c44f83e1a5ca416ded9576673 (diff)
downloadshiftos_thereturn-4fba2d86af9c960fb78b1c0a912b6371f21b487d.tar.gz
shiftos_thereturn-4fba2d86af9c960fb78b1c0a912b6371f21b487d.tar.bz2
shiftos_thereturn-4fba2d86af9c960fb78b1c0a912b6371f21b487d.zip
setting up minefield
Diffstat (limited to 'ShiftOS.WinForms/Applications')
-rw-r--r--ShiftOS.WinForms/Applications/ShiftSweeper.Designer.cs64
-rw-r--r--ShiftOS.WinForms/Applications/ShiftSweeper.cs27
2 files changed, 71 insertions, 20 deletions
diff --git a/ShiftOS.WinForms/Applications/ShiftSweeper.Designer.cs b/ShiftOS.WinForms/Applications/ShiftSweeper.Designer.cs
index 1b75d75..f5d7ddd 100644
--- a/ShiftOS.WinForms/Applications/ShiftSweeper.Designer.cs
+++ b/ShiftOS.WinForms/Applications/ShiftSweeper.Designer.cs
@@ -29,10 +29,11 @@
private void InitializeComponent()
{
this.pictureBox1 = new System.Windows.Forms.PictureBox();
- this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.minefieldPanel = new System.Windows.Forms.TableLayoutPanel();
this.buttonE = new System.Windows.Forms.Button();
this.buttonM = new System.Windows.Forms.Button();
this.buttonH = new System.Windows.Forms.Button();
+ this.lblmines = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
@@ -40,24 +41,38 @@
//
this.pictureBox1.BackgroundImage = global::ShiftOS.WinForms.Properties.Resources.SweeperNormalFace;
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
- this.pictureBox1.Location = new System.Drawing.Point(110, 3);
+ this.pictureBox1.Location = new System.Drawing.Point(150, 3);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(32, 32);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
- // tableLayoutPanel1
+ // minefieldPanel
//
- this.tableLayoutPanel1.ColumnCount = 2;
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
- this.tableLayoutPanel1.Location = new System.Drawing.Point(4, 39);
- this.tableLayoutPanel1.Name = "tableLayoutPanel1";
- this.tableLayoutPanel1.RowCount = 2;
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
- this.tableLayoutPanel1.Size = new System.Drawing.Size(244, 215);
- this.tableLayoutPanel1.TabIndex = 1;
+ this.minefieldPanel.ColumnCount = 9;
+ this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.Location = new System.Drawing.Point(4, 40);
+ this.minefieldPanel.Name = "minefieldPanel";
+ this.minefieldPanel.RowCount = 9;
+ this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.minefieldPanel.Size = new System.Drawing.Size(329, 215);
+ this.minefieldPanel.TabIndex = 1;
//
// buttonE
//
@@ -67,10 +82,11 @@
this.buttonE.TabIndex = 2;
this.buttonE.Text = "Easy";
this.buttonE.UseVisualStyleBackColor = true;
+ this.buttonE.Click += new System.EventHandler(this.buttonE_Click);
//
// buttonM
//
- this.buttonM.Location = new System.Drawing.Point(86, 261);
+ this.buttonM.Location = new System.Drawing.Point(129, 261);
this.buttonM.Name = "buttonM";
this.buttonM.Size = new System.Drawing.Size(75, 23);
this.buttonM.TabIndex = 3;
@@ -79,35 +95,47 @@
//
// buttonH
//
- this.buttonH.Location = new System.Drawing.Point(168, 261);
+ this.buttonH.Location = new System.Drawing.Point(258, 261);
this.buttonH.Name = "buttonH";
this.buttonH.Size = new System.Drawing.Size(75, 23);
this.buttonH.TabIndex = 4;
this.buttonH.Text = "Hard";
this.buttonH.UseVisualStyleBackColor = true;
//
+ // lblmines
+ //
+ this.lblmines.AutoSize = true;
+ this.lblmines.Location = new System.Drawing.Point(188, 3);
+ this.lblmines.Name = "lblmines";
+ this.lblmines.Size = new System.Drawing.Size(47, 13);
+ this.lblmines.TabIndex = 5;
+ this.lblmines.Text = "Mines: 0";
+ //
// ShiftSweeper
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.lblmines);
this.Controls.Add(this.buttonH);
this.Controls.Add(this.buttonM);
this.Controls.Add(this.buttonE);
- this.Controls.Add(this.tableLayoutPanel1);
+ this.Controls.Add(this.minefieldPanel);
this.Controls.Add(this.pictureBox1);
this.Name = "ShiftSweeper";
- this.Size = new System.Drawing.Size(275, 333);
+ this.Size = new System.Drawing.Size(366, 328);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
+ this.PerformLayout();
}
#endregion
private System.Windows.Forms.PictureBox pictureBox1;
- private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
+ private System.Windows.Forms.TableLayoutPanel minefieldPanel;
private System.Windows.Forms.Button buttonE;
private System.Windows.Forms.Button buttonM;
private System.Windows.Forms.Button buttonH;
+ private System.Windows.Forms.Label lblmines;
}
}
diff --git a/ShiftOS.WinForms/Applications/ShiftSweeper.cs b/ShiftOS.WinForms/Applications/ShiftSweeper.cs
index c61f3eb..d7c22b4 100644
--- a/ShiftOS.WinForms/Applications/ShiftSweeper.cs
+++ b/ShiftOS.WinForms/Applications/ShiftSweeper.cs
@@ -11,13 +11,14 @@ using ShiftOS.Engine;
namespace ShiftOS.WinForms.Applications
{
- [Launcher("ShiftSweeper", false, null, "Games")]
+ [Launcher("ShiftSweeper", true, "shiftsweeper", "Games")]
[RequiresUpgrade("shiftsweeper")]
[WinOpen("shiftsweeper")]
[DefaultIcon("iconShiftSweeper")]
public partial class ShiftSweeper : UserControl, IShiftOSWindow
{
private bool gameplayed = false;
+ private int mineCount = 0;
public ShiftSweeper()
{
@@ -26,7 +27,9 @@ namespace ShiftOS.WinForms.Applications
public void OnLoad()
{
-
+ buttonE.Visible = true;
+ buttonM.Visible = ShiftoriumFrontend.UpgradeInstalled("shiftsweeper_medium");
+ buttonH.Visible = ShiftoriumFrontend.UpgradeInstalled("shiftsweeper_hard");
}
public void OnSkinLoad() { }
@@ -37,5 +40,25 @@ namespace ShiftOS.WinForms.Applications
{
}
+
+ private void buttonE_Click(object sender, EventArgs e)
+ {
+ startGame(0);
+ }
+
+ private void startGame(int d)
+ {
+ switch (d)
+ {
+ case 0:
+ mineCount = 10;
+ minefieldPanel.ColumnCount = 9;
+ minefieldPanel.RowCount = 9;
+ break;
+
+ default:
+ throw new NullReferenceException();
+ }
+ }
}
}