aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/CustomMinefield.cs
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 /TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/CustomMinefield.cs
parentb33a6b68aeca7cee4f4a9abf6eb012b100a04a39 (diff)
downloadhistacom2-ebe1b011db93d47b7a29b8b4d1e371b1a97bffce.tar.gz
histacom2-ebe1b011db93d47b7a29b8b4d1e371b1a97bffce.tar.bz2
histacom2-ebe1b011db93d47b7a29b8b4d1e371b1a97bffce.zip
custom minesweeper tables AND painted separators
Diffstat (limited to 'TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/CustomMinefield.cs')
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/CustomMinefield.cs42
1 files changed, 42 insertions, 0 deletions
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();
+ }
+ }
+ }
+}