diff options
| author | JayXKanz666 <[email protected]> | 2017-07-06 18:31:20 +0200 |
|---|---|---|
| committer | JayXKanz666 <[email protected]> | 2017-07-06 18:31:20 +0200 |
| commit | 4b44847216ac4b498d088c11db5f928cc037d605 (patch) | |
| tree | 2ab290ede1f7b96c7b7551bab104d65ed2b1010f /TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs | |
| parent | 3d5a7f0674f23c6e02e36505502e6d29048b7bd8 (diff) | |
| download | histacom2-4b44847216ac4b498d088c11db5f928cc037d605.tar.gz histacom2-4b44847216ac4b498d088c11db5f928cc037d605.tar.bz2 histacom2-4b44847216ac4b498d088c11db5f928cc037d605.zip | |
Added Time distorter
Look at the source if you want to know more *wink*
Diffstat (limited to 'TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs')
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs | 47 |
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"; + } + } +} |
