From 677482ba0b26102b2a2802502a3f29701c319e9d Mon Sep 17 00:00:00 2001 From: jtsshieh Date: Sun, 30 Jul 2017 12:25:22 -0400 Subject: Made so changes to Minesweeper -Created a function for generating levels -Uploaded some pictures -FIXED UP WHOEVER MIXED UP MINESWEEPER AND CALCULATOR ICONS!! --- TimeHACK.Main/OS/Win95/Win95.cs | 2 +- .../OS/Win95/Win95Apps/MineSweeper/Square.cs | 7 ++- .../MineSweeper/WinClassicMinesweeper.Designer.cs | 2 +- .../Win95Apps/MineSweeper/WinClassicMinesweeper.cs | 24 ++++----- TimeHACK.Main/Properties/Resources.Designer.cs | 60 ++++++++++----------- TimeHACK.Main/Properties/Resources.resx | 6 +-- TimeHACK.Main/Resources/minesweepeprlogo.PNG | Bin 0 -> 1279 bytes TimeHACK.Main/Resources/minsweeper flag.PNG | Bin 230 -> 1235 bytes TimeHACK.Main/Resources/minsweeper sad.PNG | Bin 294 -> 1024 bytes TimeHACK.Main/Resources/minsweeper smile.PNG | Bin 285 -> 1020 bytes TimeHACK.Main/TimeHACK.Main.csproj | 5 +- 11 files changed, 54 insertions(+), 52 deletions(-) create mode 100644 TimeHACK.Main/Resources/minesweepeprlogo.PNG diff --git a/TimeHACK.Main/OS/Win95/Win95.cs b/TimeHACK.Main/OS/Win95/Win95.cs index 5d02b16..a352a62 100644 --- a/TimeHACK.Main/OS/Win95/Win95.cs +++ b/TimeHACK.Main/OS/Win95/Win95.cs @@ -575,7 +575,7 @@ namespace TimeHACK.OS.Win95 private void MinsweeperToolStripMenuItem_Click(object sender, EventArgs e) { WinClassic app = wm.StartWin95(new WinClassicMinesweeper(), "Minesweeper", Properties.Resources.WinClassicMinesweeper, false, false); - AddTaskBarItem(app, app.Tag.ToString(), "Calculator", Properties.Resources.WinClassicCalc); + AddTaskBarItem(app, app.Tag.ToString(), "Minesweeper", Properties.Resources.WinClassicMinesweeper); nonimportantapps.Add(app); nonimportantapps[nonimportantapps.Count - 1].BringToFront(); diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Square.cs b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Square.cs index f7a9e99..2029995 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Square.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Square.cs @@ -37,6 +37,9 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper _button.Click += new EventHandler(Click); _button.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender,args,2); _button.MouseDown += new MouseEventHandler(DismantleClick); + _button.FlatStyle = FlatStyle.Flat; + _button.FlatAppearance.BorderSize = 1; + _button.BackgroundImageLayout = ImageLayout.Stretch; _game.Panel.Controls.Add(Button); } @@ -69,13 +72,13 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper if (Dismantled) { _dismantled = false; - Button.BackColor = SystemColors.Control; + Button.BackgroundImage = null; Button.Text = "?"; } else { _dismantled = true; - Button.BackgroundImage = Properties.Resources.minsweeper_flag; + Button.BackgroundImage = Properties.Resources.WinClassicMinesweeperFlag; } OnDismantle(); } diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.Designer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.Designer.cs index bca6b99..e1e0d32 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.Designer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.Designer.cs @@ -256,7 +256,7 @@ // // button1 // - this.button1.BackgroundImage = global::TimeHACK.Properties.Resources.minsweeper_smile; + this.button1.BackgroundImage = global::TimeHACK.Properties.Resources.WinClassicMinesweeperSmile; this.button1.Location = new System.Drawing.Point(108, 32); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(25, 25); diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs index 6b6e297..657659b 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs @@ -29,32 +29,30 @@ namespace TimeHACK.OS.Win95.Win95Apps { labelBombs.Text = (_game.Mines - _game.DismantledMines).ToString(); } + public void calculateFormSize(int x, int y) + { + panel1.Size = new Size(x * 25, y * 25); + this.ParentForm.Size = new Size(x * 25 + 45, y * 25 + 100); + labelTime.Location = new Point(x * 25 - 38, button1.Location.Y); + button1.PerformClick(); + } private void begginnerToolStripMenuItem_Click(object sender, EventArgs e) { level = "easy"; - panel1.Size = new Size(200, 200); - this.ParentForm.Size = new Size(240, 275); button1.Location = new Point(108, 32); - labelTime.Location = new Point(162, 34); - button1.PerformClick(); + calculateFormSize(8, 8); } private void intermediateToolStripMenuItem_Click(object sender, EventArgs e) { level = "medium"; - panel1.Size = new Size(400,400); - this.ParentForm.Size = new Size(440, 480); button1.Location = new Point(208, 32); - labelTime.Location = new Point(362, 34); - button1.PerformClick(); + calculateFormSize(16, 16); } private void expertToolStripMenuItem_Click(object sender, EventArgs e) { level = "hard"; - panel1.Size = new Size(740, 400); - this.ParentForm.Size = new Size(776, 480); button1.Location = new Point(381, 32); - labelTime.Location = new Point(702, 34); - button1.PerformClick(); + calculateFormSize(30, 16); } private void button1_Click(object sender, EventArgs e) { @@ -87,7 +85,7 @@ namespace TimeHACK.OS.Win95.Win95Apps private void WinClassicMinesweeper_Load(object sender, EventArgs e) { - button1.PerformClick(); + begginnerToolStripMenuItem.PerformClick(); } } } diff --git a/TimeHACK.Main/Properties/Resources.Designer.cs b/TimeHACK.Main/Properties/Resources.Designer.cs index 78ceb04..cd20295 100644 --- a/TimeHACK.Main/Properties/Resources.Designer.cs +++ b/TimeHACK.Main/Properties/Resources.Designer.cs @@ -365,36 +365,6 @@ namespace TimeHACK.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap minsweeper_flag { - get { - object obj = ResourceManager.GetObject("minsweeper_flag", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap minsweeper_sad { - get { - object obj = ResourceManager.GetObject("minsweeper_sad", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap minsweeper_smile { - get { - object obj = ResourceManager.GetObject("minsweeper_smile", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - /// /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. /// @@ -1241,6 +1211,36 @@ namespace TimeHACK.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap WinClassicMinesweeperFlag { + get { + object obj = ResourceManager.GetObject("WinClassicMinesweeperFlag", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap WinClassicMinesweeperSad { + get { + object obj = ResourceManager.GetObject("WinClassicMinesweeperSad", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap WinClassicMinesweeperSmile { + get { + object obj = ResourceManager.GetObject("WinClassicMinesweeperSmile", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/TimeHACK.Main/Properties/Resources.resx b/TimeHACK.Main/Properties/Resources.resx index cc6a173..ccb6df1 100644 --- a/TimeHACK.Main/Properties/Resources.resx +++ b/TimeHACK.Main/Properties/Resources.resx @@ -148,7 +148,7 @@ ..\Resources\WinClassic\WinClassicNew.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\minsweeper smile.PNG;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -276,7 +276,7 @@ ..\Resources\termCopy.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\minsweeper flag.PNG;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -321,7 +321,7 @@ ..\resources\winclassic\winclassicie4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\minsweeper sad.PNG;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/TimeHACK.Main/Resources/minesweepeprlogo.PNG b/TimeHACK.Main/Resources/minesweepeprlogo.PNG new file mode 100644 index 0000000..cd5477d Binary files /dev/null and b/TimeHACK.Main/Resources/minesweepeprlogo.PNG differ diff --git a/TimeHACK.Main/Resources/minsweeper flag.PNG b/TimeHACK.Main/Resources/minsweeper flag.PNG index 9cd89ce..bb79134 100644 Binary files a/TimeHACK.Main/Resources/minsweeper flag.PNG and b/TimeHACK.Main/Resources/minsweeper flag.PNG differ diff --git a/TimeHACK.Main/Resources/minsweeper sad.PNG b/TimeHACK.Main/Resources/minsweeper sad.PNG index 47e026e..b0e02da 100644 Binary files a/TimeHACK.Main/Resources/minsweeper sad.PNG and b/TimeHACK.Main/Resources/minsweeper sad.PNG differ diff --git a/TimeHACK.Main/Resources/minsweeper smile.PNG b/TimeHACK.Main/Resources/minsweeper smile.PNG index e044ad6..b6d90c3 100644 Binary files a/TimeHACK.Main/Resources/minsweeper smile.PNG and b/TimeHACK.Main/Resources/minsweeper smile.PNG differ diff --git a/TimeHACK.Main/TimeHACK.Main.csproj b/TimeHACK.Main/TimeHACK.Main.csproj index aeb1675..8eeb23a 100644 --- a/TimeHACK.Main/TimeHACK.Main.csproj +++ b/TimeHACK.Main/TimeHACK.Main.csproj @@ -521,10 +521,11 @@ - + - + + -- cgit v1.2.3