diff options
| author | lempamo <[email protected]> | 2017-07-06 12:34:09 -0400 |
|---|---|---|
| committer | lempamo <[email protected]> | 2017-07-06 12:34:09 -0400 |
| commit | a3d4fab4392a149492e4896411cc44f0adf9eb2e (patch) | |
| tree | d1c67054043c41bb2738a10854b7d5a5031abd5a /TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs | |
| parent | 44a5fb97c89311364b013f5ed610d59de0b0ccf0 (diff) | |
| parent | b37a9fa6c4f42790274219fd972e34cec518cc1e (diff) | |
| download | histacom2-a3d4fab4392a149492e4896411cc44f0adf9eb2e.tar.gz histacom2-a3d4fab4392a149492e4896411cc44f0adf9eb2e.tar.bz2 histacom2-a3d4fab4392a149492e4896411cc44f0adf9eb2e.zip | |
Merge branch 'master' of https://github.com/TimeHACKDevs/TimeHACK.git
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"; + } + } +} |
