aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlempamo <[email protected]>2017-08-03 09:44:42 -0500
committerGitHub <[email protected]>2017-08-03 09:44:42 -0500
commit970dabaa90a39623c7a8271239861a09af7b2b54 (patch)
treebe800478122fb3909c40699b1e879d333afdb536
parenta3b48880bf4136cb8033305fde052727e24ab8b1 (diff)
parent3e53975325a4f398150207c9362b8d63ef927f7c (diff)
downloadhistacom2-970dabaa90a39623c7a8271239861a09af7b2b54.tar.gz
histacom2-970dabaa90a39623c7a8271239861a09af7b2b54.tar.bz2
histacom2-970dabaa90a39623c7a8271239861a09af7b2b54.zip
Merge pull request #146 from jtsshieh/master
Minesweeper Scoring System
-rw-r--r--README.md2
-rw-r--r--TimeHACK.Engine/SaveSystem.cs9
-rw-r--r--TimeHACK.Engine/Template/WinClassic.cs1
-rw-r--r--TimeHACK.Main/AchievementScreen.resx2
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs20
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/MineBestTimes.Designer.cs201
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/MineBestTimes.cs71
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/MineBestTimes.resx123
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Square.cs18
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.Designer.cs10
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs56
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.resx3
-rw-r--r--TimeHACK.Main/TimeHACK.Main.csproj9
13 files changed, 496 insertions, 29 deletions
diff --git a/README.md b/README.md
index 52ac609..76e6125 100644
--- a/README.md
+++ b/README.md
@@ -28,8 +28,6 @@ TimeHACK has a YouTube channel at https://www.youtube.com/channel/UCU3uiIgHdLaNv
TimeHACK's documentation can be found on the TimeHACK Wiki: https://github.com/TimeHACKDevs/TimeHACK/wiki
## Other Repositories
-* A completely discontinued project called "HistacomVB".
-The idea of it being that it was the old game except being built upon. In the end, however, we stopped it because having "HistacomVB" and "TimeHACK" was unnecessary. If you REALLY want to see the repo, click here: http://www.github.com/TimeHACKDevs/HistacomVB
* An unofficial project called "Histacom.AU".
This is a rewrite of Histacom in Python, and has a place [here](https://github.com/TimeHACKDevs/histacom-au).
diff --git a/TimeHACK.Engine/SaveSystem.cs b/TimeHACK.Engine/SaveSystem.cs
index 32e2661..f7dc954 100644
--- a/TimeHACK.Engine/SaveSystem.cs
+++ b/TimeHACK.Engine/SaveSystem.cs
@@ -653,6 +653,15 @@ namespace TimeHACK.Engine
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; }
[Order]
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
+ {
+ /// <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.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 @@
+<?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>
+ <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+</root> \ 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..7337c83 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 @@
/// </summary>
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
//
@@ -223,6 +226,7 @@
this.exitToolStripMenuItem.Text = "Exit";
this.exitToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.exitToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
+ this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
// helpToolStripMenuItem
//
@@ -264,6 +268,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 +317,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..53dd1b2 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,65 @@ 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();
+ }
+ }
+
+ private void exitToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ this.ParentForm.Close();
}
}
}
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 @@
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
+ <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>132, 17</value>
+ </metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>48</value>
</metadata>
diff --git a/TimeHACK.Main/TimeHACK.Main.csproj b/TimeHACK.Main/TimeHACK.Main.csproj
index 7f95fb9..585d87f 100644
--- a/TimeHACK.Main/TimeHACK.Main.csproj
+++ b/TimeHACK.Main/TimeHACK.Main.csproj
@@ -163,6 +163,12 @@
<DependentUpon>IE4Start.cs</DependentUpon>
</Compile>
<Compile Include="OS\Win95\Win95Apps\MineSweeper\Game.cs" />
+ <Compile Include="OS\Win95\Win95Apps\MineSweeper\MineBestTimes.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="OS\Win95\Win95Apps\MineSweeper\MineBestTimes.Designer.cs">
+ <DependentUpon>MineBestTimes.cs</DependentUpon>
+ </Compile>
<Compile Include="OS\Win95\Win95Apps\MineSweeper\Square.cs" />
<Compile Include="OS\Win95\Win95Apps\Story\Hack1.cs" />
<Compile Include="OS\Win95\Win95Apps\Story\Hack2.cs" />
@@ -357,6 +363,9 @@
<EmbeddedResource Include="OS\Win95\Win95Apps\IE4Sites\IE4Start.resx">
<DependentUpon>IE4Start.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="OS\Win95\Win95Apps\MineSweeper\MineBestTimes.resx">
+ <DependentUpon>MineBestTimes.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="OS\Win95\Win95Apps\WinClassicIE4.resx">
<DependentUpon>WinClassicIE4.cs</DependentUpon>
</EmbeddedResource>