aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlempamo <[email protected]>2017-08-08 10:42:48 -0400
committerlempamo <[email protected]>2017-08-08 10:42:48 -0400
commitebe1b011db93d47b7a29b8b4d1e371b1a97bffce (patch)
tree81408da6b7fd97e36ac8e1a396ce52567b7b5705
parentb33a6b68aeca7cee4f4a9abf6eb012b100a04a39 (diff)
downloadhistacom2-ebe1b011db93d47b7a29b8b4d1e371b1a97bffce.tar.gz
histacom2-ebe1b011db93d47b7a29b8b4d1e371b1a97bffce.tar.bz2
histacom2-ebe1b011db93d47b7a29b8b4d1e371b1a97bffce.zip
custom minesweeper tables AND painted separators
-rw-r--r--TimeHACK.Engine/Paintbrush.cs19
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/CustomMinefield.Designer.cs140
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/CustomMinefield.cs42
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/CustomMinefield.resx120
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Square.cs5
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.Designer.cs66
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs25
-rw-r--r--TimeHACK.Main/TimeHACK.Main.csproj9
8 files changed, 395 insertions, 31 deletions
diff --git a/TimeHACK.Engine/Paintbrush.cs b/TimeHACK.Engine/Paintbrush.cs
index 087b87f..a8a6b54 100644
--- a/TimeHACK.Engine/Paintbrush.cs
+++ b/TimeHACK.Engine/Paintbrush.cs
@@ -10,7 +10,6 @@ namespace TimeHACK.Engine
{
public class Paintbrush
{
-
public static void PaintClassicBorders(object sender, PaintEventArgs e, int borderwidth)
{
ControlPaint.DrawBorder(e.Graphics, ((Control)sender).ClientRectangle,
@@ -28,5 +27,23 @@ namespace TimeHACK.Engine
Color.White, borderwidth, ButtonBorderStyle.Solid,
Color.White, borderwidth, ButtonBorderStyle.Solid);
}
+
+ public static void ExtendedToolStripSeparator_Paint(object sender, PaintEventArgs e)
+ {
+ // Get the separator's width and height.
+ ToolStripSeparator toolStripSeparator = (ToolStripSeparator)sender;
+ int width = toolStripSeparator.Width;
+ int height = toolStripSeparator.Height;
+
+ // Choose the colors for drawing.
+ Color foreColor = Color.Gray;
+ Color backColor = Color.Silver;
+
+ // Fill the background.
+ e.Graphics.FillRectangle(new SolidBrush(backColor), 0, 0, width, height);
+
+ // Draw the line.
+ e.Graphics.DrawLine(new Pen(foreColor), 4, height / 2, width - 4, height / 2);
+ }
}
}
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/CustomMinefield.Designer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/CustomMinefield.Designer.cs
new file mode 100644
index 0000000..5eaef09
--- /dev/null
+++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/CustomMinefield.Designer.cs
@@ -0,0 +1,140 @@
+namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper
+{
+ partial class CustomMinefield
+ {
+ /// <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.label1 = new System.Windows.Forms.Label();
+ this.comboBox2 = new System.Windows.Forms.ComboBox();
+ this.comboBox1 = new System.Windows.Forms.ComboBox();
+ this.comboBox3 = new System.Windows.Forms.ComboBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.label3 = new System.Windows.Forms.Label();
+ this.button1 = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(13, 7);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(38, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "Width:";
+ //
+ // comboBox2
+ //
+ this.comboBox2.BackColor = System.Drawing.Color.White;
+ this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.comboBox2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.comboBox2.FormattingEnabled = true;
+ this.comboBox2.Location = new System.Drawing.Point(57, 31);
+ this.comboBox2.Name = "comboBox2";
+ this.comboBox2.Size = new System.Drawing.Size(78, 21);
+ this.comboBox2.TabIndex = 2;
+ //
+ // comboBox1
+ //
+ this.comboBox1.BackColor = System.Drawing.Color.White;
+ this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.comboBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.comboBox1.FormattingEnabled = true;
+ this.comboBox1.Location = new System.Drawing.Point(57, 4);
+ this.comboBox1.Name = "comboBox1";
+ this.comboBox1.Size = new System.Drawing.Size(78, 21);
+ this.comboBox1.TabIndex = 3;
+ //
+ // comboBox3
+ //
+ this.comboBox3.BackColor = System.Drawing.Color.White;
+ this.comboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.comboBox3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.comboBox3.FormattingEnabled = true;
+ this.comboBox3.Location = new System.Drawing.Point(57, 58);
+ this.comboBox3.Name = "comboBox3";
+ this.comboBox3.Size = new System.Drawing.Size(78, 21);
+ this.comboBox3.TabIndex = 4;
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(10, 34);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(41, 13);
+ this.label2.TabIndex = 5;
+ this.label2.Text = "Height:";
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(13, 61);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(38, 13);
+ this.label3.TabIndex = 6;
+ this.label3.Text = "Mines:";
+ //
+ // button1
+ //
+ this.button1.BackColor = System.Drawing.Color.Silver;
+ this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.button1.Location = new System.Drawing.Point(153, 4);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(75, 23);
+ this.button1.TabIndex = 7;
+ this.button1.Text = "OK";
+ this.button1.UseVisualStyleBackColor = false;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // CustomMinefield
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.comboBox3);
+ this.Controls.Add(this.comboBox1);
+ this.Controls.Add(this.comboBox2);
+ this.Controls.Add(this.label1);
+ this.Name = "CustomMinefield";
+ this.Size = new System.Drawing.Size(231, 89);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.ComboBox comboBox2;
+ private System.Windows.Forms.ComboBox comboBox1;
+ private System.Windows.Forms.ComboBox comboBox3;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.Button button1;
+ }
+}
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/CustomMinefield.cs b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/CustomMinefield.cs
new file mode 100644
index 0000000..c87d0d1
--- /dev/null
+++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/CustomMinefield.cs
@@ -0,0 +1,42 @@
+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 CustomMinefield : UserControl
+ {
+ private WinClassicMinesweeper _wcm;
+ private WindowManager wm;
+
+ public CustomMinefield(WinClassicMinesweeper wcm)
+ {
+ InitializeComponent();
+ _wcm = wcm;
+ wm = new WindowManager();
+ for (int i = 8; i < 31; i++) comboBox1.Items.Add(i);
+ for (int i = 8; i < 25; i++) comboBox2.Items.Add(i);
+ for (int i = 10; i < 668; i++) comboBox3.Items.Add(i);
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ if ((int)comboBox1.SelectedItem * (int)comboBox2.SelectedItem <= (int)comboBox3.SelectedItem) wm.StartInfobox95("Oops!", "Too many mines!", Engine.Template.InfoboxType.Warning, Engine.Template.InfoboxButtons.OK);
+ else
+ {
+ _wcm.customwidth = (int)comboBox1.SelectedItem;
+ _wcm.customheight = (int)comboBox2.SelectedItem;
+ _wcm.custommines = (int)comboBox3.SelectedItem;
+ _wcm.calculateFormSize((int)comboBox1.SelectedItem, (int)comboBox2.SelectedItem);
+ this.ParentForm.Close();
+ }
+ }
+ }
+}
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/CustomMinefield.resx b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/CustomMinefield.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/CustomMinefield.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
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Square.cs b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Square.cs
index 1dea7e7..fc1e38f 100644
--- a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Square.cs
+++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Square.cs
@@ -13,6 +13,7 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper
private Button _button;
private bool _dismantled = false;
+ private bool _questioned = false;
private Game _game;
private bool _minded = false;
private bool _opened = false;
@@ -124,10 +125,12 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper
if (Dismantled)
{
_dismantled = false;
+ _questioned = true;
Button.BackgroundImage = Properties.Resources.minesweepSquareQuestion;
}
- else if(Button.BackgroundImage == Properties.Resources.minesweepSquareQuestion)
+ else if(_questioned)
{
+ _questioned = false;
Button.BackgroundImage = Properties.Resources.minesweepSquare;
return;
}
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.Designer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.Designer.cs
index d407d13..10beaaa 100644
--- a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.Designer.cs
+++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.Designer.cs
@@ -131,12 +131,14 @@
this.gameToolStripMenuItem.Name = "gameToolStripMenuItem";
this.gameToolStripMenuItem.Size = new System.Drawing.Size(50, 20);
this.gameToolStripMenuItem.Text = "Game";
+ this.gameToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.Overlay;
//
// newToolStripMenuItem
//
+ this.newToolStripMenuItem.BackColor = System.Drawing.Color.Silver;
this.newToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
- this.newToolStripMenuItem.Size = new System.Drawing.Size(141, 22);
+ this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.newToolStripMenuItem.Text = "New";
this.newToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.newToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
@@ -144,23 +146,25 @@
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
- this.toolStripSeparator1.Size = new System.Drawing.Size(138, 6);
+ this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6);
//
// begginnerToolStripMenuItem
//
+ this.begginnerToolStripMenuItem.BackColor = System.Drawing.Color.Silver;
this.begginnerToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.begginnerToolStripMenuItem.Name = "begginnerToolStripMenuItem";
- this.begginnerToolStripMenuItem.Size = new System.Drawing.Size(141, 22);
- this.begginnerToolStripMenuItem.Text = "Begginner";
+ this.begginnerToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.begginnerToolStripMenuItem.Text = "Beginner";
this.begginnerToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.begginnerToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.begginnerToolStripMenuItem.Click += new System.EventHandler(this.begginnerToolStripMenuItem_Click);
//
// intermediateToolStripMenuItem
//
+ this.intermediateToolStripMenuItem.BackColor = System.Drawing.Color.Silver;
this.intermediateToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.intermediateToolStripMenuItem.Name = "intermediateToolStripMenuItem";
- this.intermediateToolStripMenuItem.Size = new System.Drawing.Size(141, 22);
+ this.intermediateToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.intermediateToolStripMenuItem.Text = "Intermediate";
this.intermediateToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.intermediateToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
@@ -168,9 +172,10 @@
//
// expertToolStripMenuItem
//
+ this.expertToolStripMenuItem.BackColor = System.Drawing.Color.Silver;
this.expertToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.expertToolStripMenuItem.Name = "expertToolStripMenuItem";
- this.expertToolStripMenuItem.Size = new System.Drawing.Size(141, 22);
+ this.expertToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.expertToolStripMenuItem.Text = "Expert";
this.expertToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.expertToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
@@ -178,32 +183,36 @@
//
// customToolStripMenuItem
//
+ this.customToolStripMenuItem.BackColor = System.Drawing.Color.Silver;
this.customToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.customToolStripMenuItem.Name = "customToolStripMenuItem";
- this.customToolStripMenuItem.Size = new System.Drawing.Size(141, 22);
+ this.customToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.customToolStripMenuItem.Text = "Custom";
this.customToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.customToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
+ this.customToolStripMenuItem.Click += new System.EventHandler(this.customToolStripMenuItem_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
- this.toolStripSeparator2.Size = new System.Drawing.Size(138, 6);
+ this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6);
//
// marksToolStripMenuItem
//
+ this.marksToolStripMenuItem.BackColor = System.Drawing.Color.Silver;
this.marksToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.marksToolStripMenuItem.Name = "marksToolStripMenuItem";
- this.marksToolStripMenuItem.Size = new System.Drawing.Size(141, 22);
+ this.marksToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.marksToolStripMenuItem.Text = "Marks {?}";
this.marksToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.marksToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
//
// colorToolStripMenuItem
//
+ this.colorToolStripMenuItem.BackColor = System.Drawing.Color.Silver;
this.colorToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.colorToolStripMenuItem.Name = "colorToolStripMenuItem";
- this.colorToolStripMenuItem.Size = new System.Drawing.Size(141, 22);
+ this.colorToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.colorToolStripMenuItem.Text = "Color";
this.colorToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.colorToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
@@ -211,13 +220,14 @@
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
- this.toolStripSeparator3.Size = new System.Drawing.Size(138, 6);
+ this.toolStripSeparator3.Size = new System.Drawing.Size(149, 6);
//
// bestTimesToolStripMenuItem
//
+ this.bestTimesToolStripMenuItem.BackColor = System.Drawing.Color.Silver;
this.bestTimesToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.bestTimesToolStripMenuItem.Name = "bestTimesToolStripMenuItem";
- this.bestTimesToolStripMenuItem.Size = new System.Drawing.Size(141, 22);
+ this.bestTimesToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.bestTimesToolStripMenuItem.Text = "Best Times";
this.bestTimesToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.bestTimesToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
@@ -226,13 +236,14 @@
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
- this.toolStripSeparator4.Size = new System.Drawing.Size(138, 6);
+ this.toolStripSeparator4.Size = new System.Drawing.Size(149, 6);
//
// exitToolStripMenuItem
//
+ this.exitToolStripMenuItem.BackColor = System.Drawing.Color.Silver;
this.exitToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
- this.exitToolStripMenuItem.Size = new System.Drawing.Size(141, 22);
+ this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.exitToolStripMenuItem.Text = "Exit";
this.exitToolStripMenuItem.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.exitToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
@@ -240,6 +251,7 @@
//
// helpToolStripMenuItem
//
+ this.helpToolStripMenuItem.BackgroundImage = global::TimeHACK.Properties.Resources.sliversilver;
this.helpToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.helpTopicsToolStripMenuItem,
@@ -251,6 +263,7 @@
//
// helpTopicsToolStripMenuItem
//
+ this.helpTopicsToolStripMenuItem.BackColor = System.Drawing.Color.Silver;
this.helpTopicsToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.helpTopicsToolStripMenuItem.Name = "helpTopicsToolStripMenuItem";
this.helpTopicsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
@@ -263,6 +276,7 @@
//
// aboutMinesweeperToolStripMenuItem
//
+ this.aboutMinesweeperToolStripMenuItem.BackColor = System.Drawing.Color.Silver;
this.aboutMinesweeperToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.aboutMinesweeperToolStripMenuItem.Name = "aboutMinesweeperToolStripMenuItem";
this.aboutMinesweeperToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
@@ -340,27 +354,27 @@
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem gameToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem helpTopicsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem aboutMinesweeperToolStripMenuItem;
+ private System.Windows.Forms.Timer timer1;
+ private System.Windows.Forms.Panel panel2;
+ internal System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Panel panel3;
+ private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
- private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem begginnerToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem intermediateToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem expertToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem customToolStripMenuItem;
- private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem marksToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem colorToolStripMenuItem;
- private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripMenuItem bestTimesToolStripMenuItem;
- private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem helpTopicsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
- private System.Windows.Forms.ToolStripMenuItem aboutMinesweeperToolStripMenuItem;
- private System.Windows.Forms.Timer timer1;
- private System.Windows.Forms.Panel panel2;
- internal System.Windows.Forms.Button button1;
- private System.Windows.Forms.Panel panel3;
- private System.Windows.Forms.Panel panel4;
}
}
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs
index ac627b3..d7f9d18 100644
--- a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs
+++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs
@@ -10,6 +10,7 @@ using System.Windows.Forms;
using TimeHACK.OS.Win95.Win95Apps.MineSweeper;
using TimeHACK.Engine;
using System.Threading;
+using TimeHACK.Engine.Template;
namespace TimeHACK.OS.Win95.Win95Apps
{
@@ -18,6 +19,9 @@ namespace TimeHACK.OS.Win95.Win95Apps
private Game _game;
public int currentface = 1;
public string level = "easy";
+ public int customwidth;
+ public int customheight;
+ public int custommines;
public WinClassicMinesweeper()
{
InitializeComponent();
@@ -34,12 +38,16 @@ namespace TimeHACK.OS.Win95.Win95Apps
item.BackgroundImageLayout = ImageLayout.Center;
item.DisplayStyle = ToolStripItemDisplayStyle.Text;
}
+ toolStripSeparator1.Paint += Paintbrush.ExtendedToolStripSeparator_Paint;
+ toolStripSeparator2.Paint += Paintbrush.ExtendedToolStripSeparator_Paint;
+ toolStripSeparator3.Paint += Paintbrush.ExtendedToolStripSeparator_Paint;
+ toolStripSeparator4.Paint += Paintbrush.ExtendedToolStripSeparator_Paint;
+ toolStripSeparator5.Paint += Paintbrush.ExtendedToolStripSeparator_Paint;
}
private void GameTick(object sender, EventArgs e)
{
labelTime.Text = _game.Time.ToString();
}
-
private void GameDismantledMinesChanged(object sender, EventArgs e)
{
labelBombs.Text = (_game.Mines - _game.DismantledMines).ToString();
@@ -63,7 +71,7 @@ namespace TimeHACK.OS.Win95.Win95Apps
{
level = "easy";
//button1.Location = new Point(70, 32);
- calculateFormSize(8, 8);
+ calculateFormSize(9, 9);
}
private void intermediateToolStripMenuItem_Click(object sender, EventArgs e)
{
@@ -85,7 +93,7 @@ namespace TimeHACK.OS.Win95.Win95Apps
{
case ("easy"):
Cursor.Current = Cursors.WaitCursor;
- _game = new Game(this, panel1, 8, 8, 10);
+ _game = new Game(this, panel1, 9, 9, 10);
break;
case ("medium"):
Cursor.Current = Cursors.WaitCursor;
@@ -95,10 +103,15 @@ namespace TimeHACK.OS.Win95.Win95Apps
Cursor.Current = Cursors.WaitCursor;
_game = new Game(this, panel1, 30, 16, 99);
break;
+ case ("custom"):
+ Cursor.Current = Cursors.WaitCursor;
+ _game = new Game(this, panel1, customwidth, customheight, custommines);
+ break;
}
_game.Tick += new EventHandler(GameTick);
_game.DismantledMinesChanged += new EventHandler(GameDismantledMinesChanged);
_game.Start();
+ timer1.Start();
}
private void WinClassicMinesweeper_Load(object sender, EventArgs e)
@@ -148,5 +161,11 @@ namespace TimeHACK.OS.Win95.Win95Apps
{
this.ParentForm.Close();
}
+
+ private void customToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ level = "custom";
+ new WindowManager().StartWin95(new CustomMinefield(this), "Custom Field", null, false, false, true, false);
+ }
}
}
diff --git a/TimeHACK.Main/TimeHACK.Main.csproj b/TimeHACK.Main/TimeHACK.Main.csproj
index 623b3e7..2dfcdb9 100644
--- a/TimeHACK.Main/TimeHACK.Main.csproj
+++ b/TimeHACK.Main/TimeHACK.Main.csproj
@@ -168,6 +168,12 @@
<Compile Include="OS\Win95\Win95Apps\IE4Sites\IE4Start.Designer.cs">
<DependentUpon>IE4Start.cs</DependentUpon>
</Compile>
+ <Compile Include="OS\Win95\Win95Apps\MineSweeper\CustomMinefield.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="OS\Win95\Win95Apps\MineSweeper\CustomMinefield.Designer.cs">
+ <DependentUpon>CustomMinefield.cs</DependentUpon>
+ </Compile>
<Compile Include="OS\Win95\Win95Apps\MineSweeper\Game.cs" />
<Compile Include="OS\Win95\Win95Apps\MineSweeper\MineBestTimes.cs">
<SubType>UserControl</SubType>
@@ -372,6 +378,9 @@
<EmbeddedResource Include="OS\Win95\Win95Apps\IE4Sites\IE4Start.resx">
<DependentUpon>IE4Start.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="OS\Win95\Win95Apps\MineSweeper\CustomMinefield.resx">
+ <DependentUpon>CustomMinefield.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="OS\Win95\Win95Apps\MineSweeper\MineBestTimes.resx">
<DependentUpon>MineBestTimes.cs</DependentUpon>
</EmbeddedResource>