From d2286b7d68db20fae6bdb58078853379faf5ac08 Mon Sep 17 00:00:00 2001 From: jtsshieh Date: Wed, 2 Aug 2017 22:03:57 -0400 Subject: Minesweeper Scoring System I didn't do acheivments because I couldn t work out how to add one. --- TimeHACK.Engine/SaveSystem.cs | 9 + TimeHACK.Engine/Template/WinClassic.cs | 1 + TimeHACK.Main/AchievementScreen.resx | 2 +- .../OS/Win95/Win95Apps/MineSweeper/Game.cs | 20 +- .../MineSweeper/MineBestTimes.Designer.cs | 201 +++++++++++++++++++++ .../Win95/Win95Apps/MineSweeper/MineBestTimes.cs | 71 ++++++++ .../Win95/Win95Apps/MineSweeper/MineBestTimes.resx | 123 +++++++++++++ .../OS/Win95/Win95Apps/MineSweeper/Square.cs | 18 ++ .../MineSweeper/WinClassicMinesweeper.Designer.cs | 9 + .../Win95Apps/MineSweeper/WinClassicMinesweeper.cs | 51 ++++-- .../MineSweeper/WinClassicMinesweeper.resx | 3 + TimeHACK.Main/TimeHACK.Main.csproj | 9 + 12 files changed, 490 insertions(+), 27 deletions(-) create mode 100644 TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/MineBestTimes.Designer.cs create mode 100644 TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/MineBestTimes.cs create mode 100644 TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/MineBestTimes.resx diff --git a/TimeHACK.Engine/SaveSystem.cs b/TimeHACK.Engine/SaveSystem.cs index e374ba9..691e06d 100644 --- a/TimeHACK.Engine/SaveSystem.cs +++ b/TimeHACK.Engine/SaveSystem.cs @@ -643,6 +643,15 @@ namespace TimeHACK.Engine [Order] public bool FTime95 { get; set; } + [Order] + public int mineSweepE { get; set; } = 999; + + [Order] + public int mineSweepI { get; set; } = 999; + + [Order] + public int mineSweepH { get; set; } = 999; + [Order] public string ThemeName { get; set; } diff --git a/TimeHACK.Engine/Template/WinClassic.cs b/TimeHACK.Engine/Template/WinClassic.cs index cc2a67a..75398dd 100644 --- a/TimeHACK.Engine/Template/WinClassic.cs +++ b/TimeHACK.Engine/Template/WinClassic.cs @@ -67,6 +67,7 @@ namespace TimeHACK.Engine.Template Title.ForeColor = SaveSystem.currentTheme.inactiveTitleTextColor; } + private void right_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) diff --git a/TimeHACK.Main/AchievementScreen.resx b/TimeHACK.Main/AchievementScreen.resx index 76e0ac7..7dac302 100644 --- a/TimeHACK.Main/AchievementScreen.resx +++ b/TimeHACK.Main/AchievementScreen.resx @@ -125,7 +125,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABw - CwAAAk1TRnQBSQFMAgEBAgEAASABAAEgAQABIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CwAAAk1TRnQBSQFMAgEBAgEAATABAAEwAQABIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABgAMAASADAAEBAQABCAYAARAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs index 8adee8e..fd6704a 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs @@ -16,10 +16,11 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper private int _mines; private Panel _panel; private Square[,] _squares; - private Timer _timer; + public Timer _timer; private int _width; public bool ftime = true; public int Time; + public bool win = false; public Game(Panel panel, int width, int height, int mines) { @@ -27,15 +28,12 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper _width = width; _height = height; _mines = mines; + win = false; } private void Dismantle(object sender, EventArgs e) { - if(ftime == true) - { - ftime = false; - OnTick(); - } + Square s = (Square)sender; if (s.Dismantled) { @@ -66,6 +64,7 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper { _timer.Enabled = false; Panel.Enabled = false; + win = true; } } @@ -77,7 +76,6 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper private void Explode(object sender, EventArgs e) { _timer.Enabled = false; - foreach (Square s in _squares) { s.RemoveEvents(); @@ -114,6 +112,7 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper protected void OnDismantledMinesChanged() { + if (DismantledMinesChanged != null) { DismantledMinesChanged(this, new EventArgs()); @@ -184,14 +183,9 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper } OnDismantledMinesChanged(); - - _timer = new Timer(); - _timer.Interval = 1000; - _timer.Tick += new EventHandler(TimerTick); - _timer.Enabled = true; } - private void TimerTick(object sender, EventArgs e) + public void TimerTick(object sender, EventArgs e) { Time++; OnTick(); diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/MineBestTimes.Designer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/MineBestTimes.Designer.cs new file mode 100644 index 0000000..6f6c3a2 --- /dev/null +++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/MineBestTimes.Designer.cs @@ -0,0 +1,201 @@ +namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper +{ + partial class MineBestTimes + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(20, 23); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(103, 25); + this.label1.TabIndex = 0; + this.label1.Text = "Begginner:"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.Location = new System.Drawing.Point(20, 71); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(123, 25); + this.label2.TabIndex = 1; + this.label2.Text = "Intermediate:"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label3.Location = new System.Drawing.Point(20, 124); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(69, 25); + this.label3.TabIndex = 2; + this.label3.Text = "Expert:"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label4.Location = new System.Drawing.Point(95, 23); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(115, 25); + this.label4.TabIndex = 3; + this.label4.Text = "999 seconds"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label5.Location = new System.Drawing.Point(95, 71); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(115, 25); + this.label5.TabIndex = 4; + this.label5.Text = "999 seconds"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label6.Location = new System.Drawing.Point(95, 124); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(115, 25); + this.label6.TabIndex = 5; + this.label6.Text = "999 seconds"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label7.Location = new System.Drawing.Point(160, 23); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(112, 25); + this.label7.TabIndex = 6; + this.label7.Text = "Anonymous"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label8.Location = new System.Drawing.Point(160, 71); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(112, 25); + this.label8.TabIndex = 7; + this.label8.Text = "Anonymous"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label9.Location = new System.Drawing.Point(160, 124); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(112, 25); + this.label9.TabIndex = 8; + this.label9.Text = "Anonymous"; + // + // button1 + // + this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button1.Location = new System.Drawing.Point(193, 167); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 9; + this.button1.Text = "OK"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button2.Location = new System.Drawing.Point(45, 167); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(98, 23); + this.button2.TabIndex = 10; + this.button2.Text = "Reset Scores"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // timer1 + // + this.timer1.Interval = 1; + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // + // MineBestTimes + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Name = "MineBestTimes"; + this.Size = new System.Drawing.Size(299, 209); + this.Load += new System.EventHandler(this.MineBestTimes_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Timer timer1; + } +} diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/MineBestTimes.cs b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/MineBestTimes.cs new file mode 100644 index 0000000..17a1380 --- /dev/null +++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/MineBestTimes.cs @@ -0,0 +1,71 @@ +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 TimeHACK.Engine; + +namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper +{ + public partial class MineBestTimes : UserControl + { + public MineBestTimes() + { + InitializeComponent(); + foreach (Control c in Controls) + { + if (c is Button) + { + c.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(0))); + c.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2); + } + else + { + c.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); + } + } + } + + private void MineBestTimes_Load(object sender, EventArgs e) + { + timer1.Start(); + + } + + private void button1_Click(object sender, EventArgs e) + { + ParentForm.Close(); + } + + private void button2_Click(object sender, EventArgs e) + { + SaveSystem.CurrentSave.mineSweepE = 999; + SaveSystem.CurrentSave.mineSweepI = 999; + SaveSystem.CurrentSave.mineSweepH = 999; + SaveSystem.SaveGame(); + } + + private void timer1_Tick(object sender, EventArgs e) + { + label4.Text = (SaveSystem.CurrentSave.mineSweepE.ToString()) + " seconds"; + label5.Text = (SaveSystem.CurrentSave.mineSweepI.ToString()) + " seconds"; + label6.Text = (SaveSystem.CurrentSave.mineSweepH.ToString()) + " seconds"; + if(SaveSystem.CurrentSave.mineSweepE != 999) + { + label7.Text = SaveSystem.ProfileName; + } + if(SaveSystem.CurrentSave.mineSweepI != 999) + { + label8.Text = SaveSystem.ProfileName; + }; + if(SaveSystem.CurrentSave.mineSweepH != 999) + { + label9.Text = SaveSystem.ProfileName; + } + } + } +} diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/MineBestTimes.resx b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/MineBestTimes.resx new file mode 100644 index 0000000..1f666f2 --- /dev/null +++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/MineBestTimes.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Square.cs b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Square.cs index 2029995..a65eedf 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Square.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Square.cs @@ -1,5 +1,6 @@ using System; using System.Drawing; +using System.Threading.Tasks; using System.Windows.Forms; using TimeHACK.Engine; @@ -51,6 +52,7 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper private void Click(object sender, System.EventArgs e) { + if (!Dismantled) { if (Minded) @@ -63,6 +65,14 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper this.Open(); } } + if (_game.ftime == true) + { + _game.ftime = false; + _game._timer = new Timer(); + _game._timer.Interval = 1000; + _game._timer.Tick += new EventHandler(_game.TimerTick); + _game._timer.Enabled = true; + } } private void DismantleClick(object sender, MouseEventArgs e) @@ -75,9 +85,17 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper Button.BackgroundImage = null; Button.Text = "?"; } + else if(Button.Text == "?") + { + _dismantled = false; + Button.BackgroundImage = null; + Button.Text = ""; + return; + } else { _dismantled = true; + Button.Text = ""; 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 e1e0d32..9d31d5c 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.Designer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.Designer.cs @@ -28,6 +28,7 @@ /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); this.labelBombs = new System.Windows.Forms.Label(); this.labelTime = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); @@ -51,6 +52,7 @@ this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); this.aboutMinesweeperToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.button1 = new System.Windows.Forms.Button(); + this.timer1 = new System.Windows.Forms.Timer(this.components); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -209,6 +211,7 @@ this.bestTimesToolStripMenuItem.Text = "Best Times"; this.bestTimesToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.bestTimesToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; + this.bestTimesToolStripMenuItem.Click += new System.EventHandler(this.bestTimesToolStripMenuItem_Click); // // toolStripSeparator4 // @@ -264,6 +267,11 @@ this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // + // timer1 + // + this.timer1.Interval = 1; + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // // WinClassicMinesweeper // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -308,5 +316,6 @@ private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; private System.Windows.Forms.ToolStripMenuItem aboutMinesweeperToolStripMenuItem; private System.Windows.Forms.Button button1; + private System.Windows.Forms.Timer timer1; } } diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs index 657659b..095d7dc 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs @@ -8,6 +8,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using TimeHACK.OS.Win95.Win95Apps.MineSweeper; +using TimeHACK.Engine; namespace TimeHACK.OS.Win95.Win95Apps { @@ -56,36 +57,60 @@ namespace TimeHACK.OS.Win95.Win95Apps } private void button1_Click(object sender, EventArgs e) { + labelTime.Text = "0"; switch (level) { case ("easy"): Cursor.Current = Cursors.WaitCursor; _game = new Game(this.panel1, 8, 8, 10); - _game.Tick += new EventHandler(GameTick); - _game.DismantledMinesChanged += new EventHandler(GameDismantledMinesChanged); - _game.Start(); - return; + break; case ("medium"): Cursor.Current = Cursors.WaitCursor; - _game = new Game(this.panel1, 16, 16, 46); - _game.Tick += new EventHandler(GameTick); - _game.DismantledMinesChanged += new EventHandler(GameDismantledMinesChanged); - _game.Start(); - return; + _game = new Game(this.panel1, 16, 16, 40); + break; case ("hard"): Cursor.Current = Cursors.WaitCursor; _game = new Game(this.panel1, 30, 16, 99); - _game.Tick += new EventHandler(GameTick); - _game.DismantledMinesChanged += new EventHandler(GameDismantledMinesChanged); - _game.Start(); - return; + break; } + _game.Tick += new EventHandler(GameTick); + _game.DismantledMinesChanged += new EventHandler(GameDismantledMinesChanged); + _game.Start(); } private void WinClassicMinesweeper_Load(object sender, EventArgs e) { begginnerToolStripMenuItem.PerformClick(); + timer1.Start(); + } + + private void bestTimesToolStripMenuItem_Click(object sender, EventArgs e) + { + WindowManager wm = new WindowManager(); + wm.StartWin95(new MineBestTimes(), "Best Times", null, false, false, true, false); + + } + + private void timer1_Tick(object sender, EventArgs e) + { + if(_game.win == true) + { + switch (level) + { + case ("easy"): + SaveSystem.CurrentSave.mineSweepE = _game.Time; + break; + case ("medium"): + SaveSystem.CurrentSave.mineSweepI = _game.Time; + break; + case ("hard"): + SaveSystem.CurrentSave.mineSweepH = _game.Time; + break; + + } + SaveSystem.SaveGame(); + } } } } diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.resx b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.resx index 4ca3a50..fe7c0a0 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.resx +++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.resx @@ -120,6 +120,9 @@ 17, 17 + + 132, 17 + 48 diff --git a/TimeHACK.Main/TimeHACK.Main.csproj b/TimeHACK.Main/TimeHACK.Main.csproj index 9d063c1..fe23577 100644 --- a/TimeHACK.Main/TimeHACK.Main.csproj +++ b/TimeHACK.Main/TimeHACK.Main.csproj @@ -163,6 +163,12 @@ IE4Start.cs + + UserControl + + + MineBestTimes.cs + @@ -363,6 +369,9 @@ IE4Start.cs + + MineBestTimes.cs + TempIE4.cs -- cgit v1.2.3