aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs
diff options
context:
space:
mode:
authorAlex-TIMEHACK <[email protected]>2017-07-08 16:04:01 +0100
committerAlex-TIMEHACK <[email protected]>2017-07-08 16:04:01 +0100
commita52f16bf447268d26ea30228a5560435381b6e0b (patch)
tree515a2b52b533b0070559f453c660859c1ba2b877 /TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs
parentf095f4efd9e2dd217045f65b7b33594b16fb0125 (diff)
parent88711b440b3a55d09118d2c42b1bb8930936eb90 (diff)
downloadhistacom2-a52f16bf447268d26ea30228a5560435381b6e0b.tar.gz
histacom2-a52f16bf447268d26ea30228a5560435381b6e0b.tar.bz2
histacom2-a52f16bf447268d26ea30228a5560435381b6e0b.zip
Merge remote-tracking branch 'refs/remotes/TimeHACKDevs/master'
Diffstat (limited to 'TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs')
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs47
1 files changed, 47 insertions, 0 deletions
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs
new file mode 100644
index 0000000..b0542ba
--- /dev/null
+++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Windows.Forms;
+using TimeHACK.Engine;
+using TimeHACK.Engine.Template;
+
+namespace TimeHACK.OS.Win95
+{
+ public partial class WinClassicTimeDistorter : UserControl
+ {
+ private int _counter;
+ private Form _action;
+
+ public WinClassicTimeDistorter(string currentYear, string yearToTravel, int counter, Form action = null)
+ {
+ InitializeComponent();
+
+ btnGo.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2);
+ lblYear.Text = currentYear;
+ lblDestYear.Text = yearToTravel;
+ _action = action;
+ _counter = counter;
+ }
+
+ private void btnGo_Click(object sender, EventArgs e)
+ {
+ lblCountDown.Visible = true;
+ btnGo.Enabled = false;
+ countDownTimer.Start();
+
+ lblCountDown.Text = $"Preparing to travel... ETA: {_counter.ToString()} seconds";
+ }
+
+ private void countDownTimer_Tick(object sender, EventArgs e)
+ {
+ _counter--;
+
+ if (_counter == 0)
+ {
+ countDownTimer.Stop();
+
+ if (_action != null)
+ _action.ShowDialog();
+ }
+ lblCountDown.Text = $"Preparing to travel... ETA: {_counter.ToString()} seconds";
+ }
+ }
+}