aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/Applications
diff options
context:
space:
mode:
authorwilliam341 <[email protected]>2017-02-26 19:58:03 -0700
committerGitHub <[email protected]>2017-02-26 19:58:03 -0700
commit843143b86a55390172e20565ddbd1bbde9d5892e (patch)
tree7608d8dc4284f283d53c94e866cfb1937027cf38 /ShiftOS.WinForms/Applications
parente9acecf0deada4b3adb54000900d26b40fa1d930 (diff)
parentba1519e3ce1c9710befcb4b36e0a2da21005ef31 (diff)
downloadshiftos_thereturn-843143b86a55390172e20565ddbd1bbde9d5892e.tar.gz
shiftos_thereturn-843143b86a55390172e20565ddbd1bbde9d5892e.tar.bz2
shiftos_thereturn-843143b86a55390172e20565ddbd1bbde9d5892e.zip
Merge pull request #98 from lempamo/master
shiftsweeper
Diffstat (limited to 'ShiftOS.WinForms/Applications')
-rw-r--r--ShiftOS.WinForms/Applications/About.Designer.cs26
-rw-r--r--ShiftOS.WinForms/Applications/About.cs26
-rw-r--r--ShiftOS.WinForms/Applications/AudioPlayer.Designer.cs26
-rw-r--r--ShiftOS.WinForms/Applications/AudioPlayer.cs26
-rw-r--r--ShiftOS.WinForms/Applications/Calculator.cs5
-rw-r--r--ShiftOS.WinForms/Applications/Notifications.Designer.cs26
-rw-r--r--ShiftOS.WinForms/Applications/Notifications.cs26
-rw-r--r--ShiftOS.WinForms/Applications/ShiftSweeper.Designer.cs324
-rw-r--r--ShiftOS.WinForms/Applications/ShiftSweeper.cs370
-rw-r--r--ShiftOS.WinForms/Applications/ShiftSweeper.resx120
10 files changed, 965 insertions, 10 deletions
diff --git a/ShiftOS.WinForms/Applications/About.Designer.cs b/ShiftOS.WinForms/Applications/About.Designer.cs
index e44b29e..ab76eab 100644
--- a/ShiftOS.WinForms/Applications/About.Designer.cs
+++ b/ShiftOS.WinForms/Applications/About.Designer.cs
@@ -1,4 +1,28 @@
-namespace ShiftOS.WinForms.Applications
+/*
+ * MIT License
+ *
+ * Copyright (c) 2017 Michael VanOverbeek and ShiftOS devs
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+namespace ShiftOS.WinForms.Applications
{
partial class About
{
diff --git a/ShiftOS.WinForms/Applications/About.cs b/ShiftOS.WinForms/Applications/About.cs
index cd95296..f91e0cc 100644
--- a/ShiftOS.WinForms/Applications/About.cs
+++ b/ShiftOS.WinForms/Applications/About.cs
@@ -1,4 +1,28 @@
-using System;
+/*
+ * MIT License
+ *
+ * Copyright (c) 2017 Michael VanOverbeek and ShiftOS devs
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
diff --git a/ShiftOS.WinForms/Applications/AudioPlayer.Designer.cs b/ShiftOS.WinForms/Applications/AudioPlayer.Designer.cs
index 3cc88df..83f41d2 100644
--- a/ShiftOS.WinForms/Applications/AudioPlayer.Designer.cs
+++ b/ShiftOS.WinForms/Applications/AudioPlayer.Designer.cs
@@ -1,4 +1,28 @@
-namespace ShiftOS.WinForms.Applications
+/*
+ * MIT License
+ *
+ * Copyright (c) 2017 Michael VanOverbeek and ShiftOS devs
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+namespace ShiftOS.WinForms.Applications
{
partial class AudioPlayer
{
diff --git a/ShiftOS.WinForms/Applications/AudioPlayer.cs b/ShiftOS.WinForms/Applications/AudioPlayer.cs
index b7dc9ee..b8be6af 100644
--- a/ShiftOS.WinForms/Applications/AudioPlayer.cs
+++ b/ShiftOS.WinForms/Applications/AudioPlayer.cs
@@ -1,4 +1,28 @@
-using System;
+/*
+ * MIT License
+ *
+ * Copyright (c) 2017 Michael VanOverbeek and ShiftOS devs
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
diff --git a/ShiftOS.WinForms/Applications/Calculator.cs b/ShiftOS.WinForms/Applications/Calculator.cs
index afd09f5..4fa84de 100644
--- a/ShiftOS.WinForms/Applications/Calculator.cs
+++ b/ShiftOS.WinForms/Applications/Calculator.cs
@@ -69,10 +69,7 @@ namespace ShiftOS.WinForms.Applications
prepareButtons();
}
- public void OnSkinLoad()
- {
-
- }
+ public void OnSkinLoad() { }
public bool OnUnload()
{
diff --git a/ShiftOS.WinForms/Applications/Notifications.Designer.cs b/ShiftOS.WinForms/Applications/Notifications.Designer.cs
index d88c25b..861795a 100644
--- a/ShiftOS.WinForms/Applications/Notifications.Designer.cs
+++ b/ShiftOS.WinForms/Applications/Notifications.Designer.cs
@@ -1,4 +1,28 @@
-namespace ShiftOS.WinForms.Applications
+/*
+ * MIT License
+ *
+ * Copyright (c) 2017 Michael VanOverbeek and ShiftOS devs
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+namespace ShiftOS.WinForms.Applications
{
partial class Notifications
{
diff --git a/ShiftOS.WinForms/Applications/Notifications.cs b/ShiftOS.WinForms/Applications/Notifications.cs
index 9ed3587..30aec3d 100644
--- a/ShiftOS.WinForms/Applications/Notifications.cs
+++ b/ShiftOS.WinForms/Applications/Notifications.cs
@@ -1,4 +1,28 @@
-using System;
+/*
+ * MIT License
+ *
+ * Copyright (c) 2017 Michael VanOverbeek and ShiftOS devs
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
diff --git a/ShiftOS.WinForms/Applications/ShiftSweeper.Designer.cs b/ShiftOS.WinForms/Applications/ShiftSweeper.Designer.cs
new file mode 100644
index 0000000..17b01b7
--- /dev/null
+++ b/ShiftOS.WinForms/Applications/ShiftSweeper.Designer.cs
@@ -0,0 +1,324 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2017 Michael VanOverbeek and ShiftOS devs
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+namespace ShiftOS.WinForms.Applications
+{
+ partial class ShiftSweeper
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.pictureBox1 = new System.Windows.Forms.PictureBox();
+ this.easyPanel = 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();
+ this.lbltime = new System.Windows.Forms.Label();
+ this.lblinfo = new System.Windows.Forms.Label();
+ this.lblinfo2 = new System.Windows.Forms.Label();
+ this.flagButton = new System.Windows.Forms.PictureBox();
+ this.mediumPanel = new System.Windows.Forms.TableLayoutPanel();
+ this.hardPanel = new System.Windows.Forms.TableLayoutPanel();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.flagButton)).BeginInit();
+ this.SuspendLayout();
+ //
+ // pictureBox1
+ //
+ this.pictureBox1.BackgroundImage = global::ShiftOS.WinForms.Properties.Resources.SweeperNormalFace;
+ this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
+ this.pictureBox1.Image = global::ShiftOS.WinForms.Properties.Resources.SweeperNormalFace;
+ this.pictureBox1.Location = new System.Drawing.Point(264, 3);
+ this.pictureBox1.Name = "pictureBox1";
+ this.pictureBox1.Size = new System.Drawing.Size(32, 32);
+ this.pictureBox1.TabIndex = 0;
+ this.pictureBox1.TabStop = false;
+ //
+ // easyPanel
+ //
+ this.easyPanel.ColumnCount = 9;
+ this.easyPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.easyPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.easyPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.easyPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.easyPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.easyPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.easyPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.easyPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.easyPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
+ this.easyPanel.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
+ this.easyPanel.Location = new System.Drawing.Point(4, 40);
+ this.easyPanel.Name = "easyPanel";
+ this.easyPanel.RowCount = 9;
+ this.easyPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11136F));
+ this.easyPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11136F));
+ this.easyPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11136F));
+ this.easyPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11136F));
+ this.easyPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11136F));
+ this.easyPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11136F));
+ this.easyPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11136F));
+ this.easyPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11025F));
+ this.easyPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11025F));
+ this.easyPanel.Size = new System.Drawing.Size(553, 308);
+ this.easyPanel.TabIndex = 1;
+ //
+ // buttonE
+ //
+ this.buttonE.Location = new System.Drawing.Point(4, 354);
+ this.buttonE.Name = "buttonE";
+ this.buttonE.Size = new System.Drawing.Size(75, 23);
+ 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(244, 354);
+ this.buttonM.Name = "buttonM";
+ this.buttonM.Size = new System.Drawing.Size(75, 23);
+ this.buttonM.TabIndex = 3;
+ this.buttonM.Text = "Medium";
+ this.buttonM.UseVisualStyleBackColor = true;
+ this.buttonM.Click += new System.EventHandler(this.buttonM_Click);
+ //
+ // buttonH
+ //
+ this.buttonH.Location = new System.Drawing.Point(482, 354);
+ 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;
+ this.buttonH.Click += new System.EventHandler(this.buttonH_Click);
+ //
+ // lblmines
+ //
+ this.lblmines.AutoSize = true;
+ this.lblmines.Location = new System.Drawing.Point(317, 4);
+ this.lblmines.Name = "lblmines";
+ this.lblmines.Size = new System.Drawing.Size(47, 13);
+ this.lblmines.TabIndex = 5;
+ this.lblmines.Text = "Mines: 0";
+ //
+ // lbltime
+ //
+ this.lbltime.AutoSize = true;
+ this.lbltime.Location = new System.Drawing.Point(317, 22);
+ this.lbltime.Name = "lbltime";
+ this.lbltime.Size = new System.Drawing.Size(42, 13);
+ this.lbltime.TabIndex = 6;
+ this.lbltime.Text = "Time: 0";
+ //
+ // lblinfo
+ //
+ this.lblinfo.AutoSize = true;
+ this.lblinfo.Location = new System.Drawing.Point(4, 4);
+ this.lblinfo.Name = "lblinfo";
+ this.lblinfo.Size = new System.Drawing.Size(108, 13);
+ this.lblinfo.TabIndex = 7;
+ this.lblinfo.Text = "Click to uncover tiles.";
+ //
+ // lblinfo2
+ //
+ 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.TabIndex = 8;
+ this.lblinfo2.Text = "Right Button: Toggle Flag";
+ //
+ // flagButton
+ //
+ this.flagButton.Image = global::ShiftOS.WinForms.Properties.Resources.SweeperTileBlock;
+ this.flagButton.Location = new System.Drawing.Point(537, 14);
+ this.flagButton.Name = "flagButton";
+ this.flagButton.Size = new System.Drawing.Size(20, 20);
+ this.flagButton.TabIndex = 9;
+ this.flagButton.TabStop = false;
+ this.flagButton.Click += new System.EventHandler(this.flagButton_Click);
+ //
+ // mediumPanel
+ //
+ this.mediumPanel.ColumnCount = 16;
+ this.mediumPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249042F));
+ this.mediumPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249044F));
+ this.mediumPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249044F));
+ this.mediumPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249044F));
+ this.mediumPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249044F));
+ this.mediumPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249044F));
+ this.mediumPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249044F));
+ this.mediumPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249044F));
+ this.mediumPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.249044F));
+ this.mediumPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.mediumPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.mediumPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.mediumPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.mediumPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.mediumPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.mediumPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.mediumPanel.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
+ this.mediumPanel.Location = new System.Drawing.Point(4, 41);
+ this.mediumPanel.Name = "mediumPanel";
+ this.mediumPanel.RowCount = 16;
+ this.mediumPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.249183F));
+ this.mediumPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.249182F));
+ this.mediumPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.249182F));
+ this.mediumPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.249182F));
+ this.mediumPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.249182F));
+ this.mediumPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.249182F));
+ this.mediumPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.249182F));
+ this.mediumPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.248558F));
+ this.mediumPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.248558F));
+ this.mediumPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.mediumPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.mediumPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.mediumPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.mediumPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.mediumPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.mediumPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.mediumPanel.Size = new System.Drawing.Size(553, 307);
+ this.mediumPanel.TabIndex = 2;
+ //
+ // 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.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
+ this.hardPanel.Location = new System.Drawing.Point(4, 40);
+ this.hardPanel.Name = "hardPanel";
+ this.hardPanel.RowCount = 16;
+ this.hardPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.249183F));
+ this.hardPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.249182F));
+ this.hardPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.249182F));
+ this.hardPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.249182F));
+ this.hardPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.249182F));
+ this.hardPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.249182F));
+ this.hardPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.249182F));
+ this.hardPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.248558F));
+ this.hardPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.248558F));
+ this.hardPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.hardPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.hardPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.hardPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.hardPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.hardPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.hardPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.251231F));
+ this.hardPanel.Size = new System.Drawing.Size(553, 308);
+ this.hardPanel.TabIndex = 3;
+ //
+ // ShiftSweeper
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.hardPanel);
+ this.Controls.Add(this.mediumPanel);
+ this.Controls.Add(this.flagButton);
+ this.Controls.Add(this.lblinfo2);
+ this.Controls.Add(this.lblinfo);
+ this.Controls.Add(this.lbltime);
+ this.Controls.Add(this.lblmines);
+ this.Controls.Add(this.buttonH);
+ this.Controls.Add(this.buttonM);
+ this.Controls.Add(this.buttonE);
+ this.Controls.Add(this.easyPanel);
+ this.Controls.Add(this.pictureBox1);
+ this.Name = "ShiftSweeper";
+ this.Size = new System.Drawing.Size(624, 426);
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.flagButton)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.PictureBox pictureBox1;
+ private System.Windows.Forms.TableLayoutPanel easyPanel;
+ private System.Windows.Forms.Button buttonE;
+ private System.Windows.Forms.Button buttonM;
+ private System.Windows.Forms.Button buttonH;
+ private System.Windows.Forms.Label lblmines;
+ private System.Windows.Forms.Label lbltime;
+ private System.Windows.Forms.Label lblinfo;
+ private System.Windows.Forms.Label lblinfo2;
+ private System.Windows.Forms.PictureBox flagButton;
+ private System.Windows.Forms.TableLayoutPanel mediumPanel;
+ private System.Windows.Forms.TableLayoutPanel hardPanel;
+ }
+}
diff --git a/ShiftOS.WinForms/Applications/ShiftSweeper.cs b/ShiftOS.WinForms/Applications/ShiftSweeper.cs
new file mode 100644
index 0000000..529a7e8
--- /dev/null
+++ b/ShiftOS.WinForms/Applications/ShiftSweeper.cs
@@ -0,0 +1,370 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2017 Michael VanOverbeek and ShiftOS devs
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using ShiftOS.Engine;
+
+namespace ShiftOS.WinForms.Applications
+{
+ [Launcher("ShiftSweeper", true, "shiftsweeper", "Games")]
+ [RequiresUpgrade("shiftsweeper")]
+ [WinOpen("shiftsweeper")]
+ [DefaultIcon("iconShiftSweeper")]
+ public partial class ShiftSweeper : UserControl, IShiftOSWindow
+ {
+ private bool gameplayed = false;
+ private bool flagtime = false;
+ private int mineCount = 0;
+ private int origminecount;
+ private int[,] minemap; //Represents status of tiles. 0-8 = how many mines surrounding. -1 = mine. -2 = flagged mine. -3 to -11 = flagged safe.
+ private Timer ticking = new Timer();
+ private int minetimer;
+ private TableLayoutPanel minefieldPanel;
+
+ public ShiftSweeper() { InitializeComponent(); }
+
+ public void OnLoad()
+ {
+ buttonE.Visible = true;
+ buttonM.Visible = ShiftoriumFrontend.UpgradeInstalled("shiftsweeper_medium");
+ buttonH.Visible = ShiftoriumFrontend.UpgradeInstalled("shiftsweeper_hard");
+ ticking.Interval = 1000;
+ ticking.Tick += Ticking_Tick;
+ easyPanel.Visible = false;
+ mediumPanel.Visible = false;
+ hardPanel.Visible = false;
+ }
+
+ private void Ticking_Tick(object sender, EventArgs e)
+ {
+ minetimer++;
+ lbltime.Text = "Time: " + minetimer.ToString();
+ }
+
+ public void OnSkinLoad() { }
+
+ public bool OnUnload() { return true; }
+
+ public void OnUpgrade() { }
+
+ private void buttonE_Click(object sender, EventArgs e) { startGame(0); }
+
+ private void clearPreviousGame()
+ {
+ if (minemap != null) for (int x = 0; x < minefieldPanel.ColumnCount; x++)
+ {
+ for (int y = 0; y < minefieldPanel.RowCount; y++)
+ {
+ minemap[x, y] = 0;
+
+ if (minefieldPanel.GetControlFromPosition(x,y) != null)
+ {
+ minefieldPanel.Controls.Remove(minefieldPanel.GetControlFromPosition(x, y));
+ }
+ }
+ }
+
+ }
+
+ private void startGame(int d)
+ {
+ pictureBox1.Image = Properties.Resources.SweeperNormalFace;
+ clearPreviousGame();
+ lbltime.Text = "Time: 0";
+ minetimer = 0;
+ ticking.Start();
+ if (minefieldPanel != null) minefieldPanel.Visible = false;
+ switch (d)
+ {
+ case 0:
+ minefieldPanel = easyPanel;
+ mineCount = 10;
+ minefieldPanel.ColumnCount = 9;
+ minefieldPanel.RowCount = 9;
+ break;
+
+ case 1:
+ minefieldPanel = mediumPanel;
+ mineCount = 40;
+ minefieldPanel.ColumnCount = 16;
+ minefieldPanel.RowCount = 16;
+ break;
+
+ case 2:
+ minefieldPanel = hardPanel;
+ mineCount = 99;
+ minefieldPanel.ColumnCount = 30;
+ minefieldPanel.RowCount = 16;
+ break;
+
+ default:
+ throw new NullReferenceException();
+ }
+ minefieldPanel.Visible = true;
+ origminecount = mineCount;
+ lblmines.Text = "Mines: " + mineCount.ToString();
+ buttonE.Enabled = false;
+ buttonM.Enabled = false;
+ buttonH.Enabled = false;
+ gameplayed = true;
+ makegrid();
+ }
+
+ private void makegrid()
+ {
+ Random rnd1 = new Random();
+ minemap = new int[minefieldPanel.ColumnCount, minefieldPanel.RowCount];
+
+ // Makes the minefield full of buttons
+ for (int x = 0; x < minefieldPanel.ColumnCount; x++)
+ {
+ for (int y = 0; y < minefieldPanel.RowCount; y++)
+ {
+ minemap[x, y] = 0;
+ minefieldPanel.Controls.Add(makeButton(x, y), x, y);
+ }
+ }
+
+ // Placing the mines
+ int currminecount = mineCount;
+ while (currminecount > 0)
+ {
+ int mineX = rnd1.Next(minefieldPanel.ColumnCount);
+ int mineY = rnd1.Next(minefieldPanel.RowCount);
+
+ if (minemap[mineX, mineY] == 0)
+ {
+ minemap[mineX, mineY] = -1;
+ currminecount--;
+ }
+ }
+
+ // Setting the numbers
+ for (int x = 0; x < minefieldPanel.ColumnCount; x++)
+ {
+ for (int y = 0; y < minefieldPanel.RowCount; y++)
+ {
+ if (minemap[x, y] != -1)
+ {
+ int numMines = 0;
+ for (int xx = -1; xx < 2; xx++)
+ {
+ for (int yy = -1; yy < 2; yy++)
+ {
+ if (x + xx >= 0 && y + yy >= 0 && x + xx < minefieldPanel.ColumnCount && y + yy < minefieldPanel.RowCount)
+ {
+ if (minemap[x + xx, y + yy] == -1) numMines++;
+ }
+ }
+ }
+ minemap[x, y] = numMines;
+ }
+ }
+ }
+ }
+
+ private Button makeButton(int col, int row)
+ {
+ Button bttn = new Button();
+
+ 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.Click += new System.EventHandler(bttnOnclick);
+ bttn.BackgroundImage = Properties.Resources.SweeperTileBlock;
+ bttn.BackgroundImageLayout = ImageLayout.Stretch;
+
+ return bttn;
+ }
+
+ private void bttnOnclick(object sender, EventArgs e)
+ {
+ if (!ticking.Enabled) return;
+
+ Button bttnClick = sender as Button;
+
+ if (bttnClick == null) return; //not a button.
+
+ string[] split = bttnClick.Name.Split(new Char[] { ' ' });
+
+ int x = System.Convert.ToInt32(split[0]);
+ int y = System.Convert.ToInt32(split[1]);
+
+
+ if (!flagtime)
+ {
+ if (minemap[x, y] == -1)
+ {
+ ticking.Enabled = false;
+
+ buttonE.Enabled = true;
+ buttonM.Enabled = true;
+ buttonH.Enabled = true;
+
+ pictureBox1.BackgroundImage = Properties.Resources.SweeperLoseFace;
+
+ for (int xx = 0; xx < minefieldPanel.ColumnCount; xx++)
+ {
+ for (int yy = 0; yy < minefieldPanel.RowCount; yy++)
+ {
+ pictureBox1.BackgroundImage = Properties.Resources.SweeperLoseFace;
+ minefieldPanel.GetControlFromPosition(xx, yy).Enabled = false;
+ if (minemap[xx, yy] == -1)
+ {
+ minefieldPanel.GetControlFromPosition(xx, yy).BackgroundImage = Properties.Resources.SweeperTileBomb;
+ }
+
+ }
+ }
+ pictureBox1.Image = Properties.Resources.SweeperLoseFace;
+ }
+ else if (minemap[x, y] < -1) return;
+ else removeBlank(x, y);
+ }
+ else
+ {
+ if (!bttnClick.Enabled) return;
+
+ if (minemap[x, y] < -1)
+ {
+ minemap[x, y] = (minemap[x, y] * -1) - 3;
+ bttnClick.BackgroundImage = Properties.Resources.SweeperTileBlock;
+ mineCount++;
+ }
+ else
+ {
+ minemap[x, y] = (minemap[x, y] * -1) - 3;
+ bttnClick.BackgroundImage = Properties.Resources.SweeperTileFlag;
+ mineCount--;
+ }
+ lblmines.Text = "Mines: " + mineCount.ToString();
+ bool wrongflags = false;
+ if (mineCount == 0)
+ {
+ for (int xx = 0; xx < minefieldPanel.ColumnCount; xx++)
+ {
+ if (wrongflags) break;
+ for (int yy = 0; yy < minefieldPanel.RowCount; yy++)
+ {
+ if (wrongflags) break;
+ if (minemap[xx, yy] < -2) wrongflags = true;
+ }
+ }
+ if (!wrongflags)
+ {
+ ticking.Enabled = false;
+
+ buttonE.Enabled = true;
+ buttonM.Enabled = true;
+ buttonH.Enabled = true;
+
+ for (int xx = 0; xx < minefieldPanel.ColumnCount; xx++)
+ {
+ for (int yy = 0; yy < minefieldPanel.RowCount; yy++)
+ {
+ minefieldPanel.GetControlFromPosition(xx, yy).Enabled = false;
+ }
+ }
+
+ 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);
+ SaveSystem.TransferCodepointsFrom("shiftsweeper", cp);
+ pictureBox1.Image = Properties.Resources.SweeperWinFace;
+ }
+ }
+ }
+ }
+
+ private void removeBlank(int x, int y)
+ {
+ minefieldPanel.GetControlFromPosition(x, y).Enabled = false;
+ trueform(x, y);
+ if (minemap[x, y] != 0) return;
+ for (int xx = -1; xx < 2; xx++)
+ {
+ for (int yy = -1; yy < 2; yy++)
+ {
+ if (x + xx >= 0 && y + yy >= 0 && x + xx < minefieldPanel.ColumnCount && y + yy < minefieldPanel.RowCount)
+ {
+ if (minefieldPanel.GetControlFromPosition(x + xx, y + yy).Enabled && minemap[x+xx,y+yy] != -1 && minemap[x + xx, y + yy] != -2)
+ {
+ minefieldPanel.GetControlFromPosition(x + xx, y + yy).Enabled = false;
+ trueform(x + xx, y + yy);
+ if (minemap[x + xx, y + yy] == 0)
+ {
+ removeBlank(x + xx, y + yy);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void trueform(int x, int y)
+ {
+ Button bttn = (Button)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;
+ else if (minemap[x, y] == 3) bttn.BackgroundImage = Properties.Resources.SweeperTile3;
+ else if (minemap[x, y] == 4) bttn.BackgroundImage = Properties.Resources.SweeperTile4;
+ else if (minemap[x, y] == 5) bttn.BackgroundImage = Properties.Resources.SweeperTile5;
+ else if (minemap[x, y] == 6) bttn.BackgroundImage = Properties.Resources.SweeperTile6;
+ else if (minemap[x, y] == 7) bttn.BackgroundImage = Properties.Resources.SweeperTile7;
+ else if (minemap[x, y] == 8) bttn.BackgroundImage = Properties.Resources.SweeperTile8;
+ }
+
+ private void buttonM_Click(object sender, EventArgs e) { startGame(1); }
+
+ private void buttonH_Click(object sender, EventArgs e) { startGame(2); }
+
+ private void flagButton_Click(object sender, EventArgs e)
+ {
+ if (flagtime)
+ {
+ flagButton.Image = Properties.Resources.SweeperTileBlock;
+ flagtime = false;
+ }
+ else
+ {
+ flagButton.Image = Properties.Resources.SweeperTileFlag;
+ flagtime = true;
+ }
+ }
+ }
+}
diff --git a/ShiftOS.WinForms/Applications/ShiftSweeper.resx b/ShiftOS.WinForms/Applications/ShiftSweeper.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/ShiftOS.WinForms/Applications/ShiftSweeper.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root> \ No newline at end of file