From 4b44847216ac4b498d088c11db5f928cc037d605 Mon Sep 17 00:00:00 2001 From: JayXKanz666 Date: Thu, 6 Jul 2017 18:31:20 +0200 Subject: Added Time distorter Look at the source if you want to know more *wink* --- TimeHACK.Main/OS/Win95/Win95.Designer.cs | 4 +- TimeHACK.Main/OS/Win95/Win95.cs | 9 ++ TimeHACK.Main/OS/Win95/Win95.resx | 2 +- .../Win95Apps/WinClassicTimeDistorter.Designer.cs | 159 +++++++++++++++++++++ .../OS/Win95/Win95Apps/WinClassicTimeDistorter.cs | 47 ++++++ .../Win95/Win95Apps/WinClassicTimeDistorter.resx | 123 ++++++++++++++++ TimeHACK.Main/TimeHACK.Main.csproj | 9 ++ 7 files changed, 350 insertions(+), 3 deletions(-) create mode 100644 TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.Designer.cs create mode 100644 TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.cs create mode 100644 TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.resx (limited to 'TimeHACK.Main') diff --git a/TimeHACK.Main/OS/Win95/Win95.Designer.cs b/TimeHACK.Main/OS/Win95/Win95.Designer.cs index e164439..998ece1 100644 --- a/TimeHACK.Main/OS/Win95/Win95.Designer.cs +++ b/TimeHACK.Main/OS/Win95/Win95.Designer.cs @@ -243,7 +243,7 @@ namespace TimeHACK.OS.Win95 this.startmenuitems.Name = "startmenuitems"; this.startmenuitems.Padding = new System.Windows.Forms.Padding(6, 2, 0, 0); this.startmenuitems.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; - this.startmenuitems.Size = new System.Drawing.Size(145, 292); + this.startmenuitems.Size = new System.Drawing.Size(145, 311); this.startmenuitems.TabIndex = 0; this.startmenuitems.Text = "StartMenu"; // @@ -723,7 +723,7 @@ namespace TimeHACK.OS.Win95 this.TimeDistorterToolStripMenuItem.Name = "TimeDistorterToolStripMenuItem"; this.TimeDistorterToolStripMenuItem.Size = new System.Drawing.Size(181, 28); this.TimeDistorterToolStripMenuItem.Text = "Time Distorter"; - this.TimeDistorterToolStripMenuItem.Visible = false; + this.TimeDistorterToolStripMenuItem.Click += new System.EventHandler(this.TimeDistorterToolStripMenuItem_Click); // // DocumentsToolStripMenuItem // diff --git a/TimeHACK.Main/OS/Win95/Win95.cs b/TimeHACK.Main/OS/Win95/Win95.cs index e6ea876..c326c64 100644 --- a/TimeHACK.Main/OS/Win95/Win95.cs +++ b/TimeHACK.Main/OS/Win95/Win95.cs @@ -429,6 +429,15 @@ namespace TimeHACK.OS.Win95 app.BringToFront(); startmenu.Hide(); } + + private void TimeDistorterToolStripMenuItem_Click(object sender, EventArgs e) + { + WinClassic app = wm.StartWin95(new WinClassicTimeDistorter("2017", "20XX", 10), "Time Distorter", null, false, true); + + AddTaskBarItem(app, app.Tag.ToString(), "Time Distorter", null); + app.BringToFront(); + startmenu.Hide(); + } } public class MyRenderer : ToolStripProfessionalRenderer { diff --git a/TimeHACK.Main/OS/Win95/Win95.resx b/TimeHACK.Main/OS/Win95/Win95.resx index 2e8769b..e4cbaa8 100644 --- a/TimeHACK.Main/OS/Win95/Win95.resx +++ b/TimeHACK.Main/OS/Win95/Win95.resx @@ -389,7 +389,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADq - ggAAAk1TRnQBSQFMAgEBDAEAAXABAQFwAQEBIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA + ggAAAk1TRnQBSQFMAgEBDAEAAYABAQGAAQEBIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA AwABgAMAAQEBAAEgBwABAf8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8AXAAB/wMAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/x8AAf8DAAH/ diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.Designer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.Designer.cs new file mode 100644 index 0000000..e8397b6 --- /dev/null +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.Designer.cs @@ -0,0 +1,159 @@ +namespace TimeHACK.OS.Win95 +{ + partial class WinClassicTimeDistorter + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.lblDest = new System.Windows.Forms.Label(); + this.lblDestYear = new System.Windows.Forms.Label(); + this.lblCurrent = new System.Windows.Forms.Label(); + this.lblYear = new System.Windows.Forms.Label(); + this.lblTo = new System.Windows.Forms.Label(); + this.btnGo = new System.Windows.Forms.Button(); + this.lblCountDown = new System.Windows.Forms.Label(); + this.countDownTimer = new System.Windows.Forms.Timer(this.components); + this.SuspendLayout(); + // + // lblDest + // + this.lblDest.AutoSize = true; + this.lblDest.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.lblDest.Location = new System.Drawing.Point(286, 6); + this.lblDest.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblDest.Name = "lblDest"; + this.lblDest.Size = new System.Drawing.Size(168, 25); + this.lblDest.TabIndex = 0; + this.lblDest.Text = "Destination year"; + this.lblDest.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblDestYear + // + this.lblDestYear.AutoSize = true; + this.lblDestYear.Font = new System.Drawing.Font("Arial", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.lblDestYear.Location = new System.Drawing.Point(333, 32); + this.lblDestYear.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblDestYear.Name = "lblDestYear"; + this.lblDestYear.Size = new System.Drawing.Size(61, 33); + this.lblDestYear.TabIndex = 1; + this.lblDestYear.Text = "null"; + this.lblDestYear.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblCurrent + // + this.lblCurrent.AutoSize = true; + this.lblCurrent.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.lblCurrent.Location = new System.Drawing.Point(8, 6); + this.lblCurrent.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblCurrent.Name = "lblCurrent"; + this.lblCurrent.Size = new System.Drawing.Size(131, 25); + this.lblCurrent.TabIndex = 0; + this.lblCurrent.Text = "Current year"; + this.lblCurrent.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblYear + // + this.lblYear.AutoSize = true; + this.lblYear.Font = new System.Drawing.Font("Arial", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.lblYear.Location = new System.Drawing.Point(29, 32); + this.lblYear.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblYear.Name = "lblYear"; + this.lblYear.Size = new System.Drawing.Size(61, 33); + this.lblYear.TabIndex = 1; + this.lblYear.Text = "null"; + this.lblYear.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblTo + // + this.lblTo.AutoSize = true; + this.lblTo.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.lblTo.Location = new System.Drawing.Point(151, 43); + this.lblTo.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblTo.Name = "lblTo"; + this.lblTo.Size = new System.Drawing.Size(135, 20); + this.lblTo.TabIndex = 6; + this.lblTo.Text = ">>>>>>>>>>>>>>\r\n"; + // + // btnGo + // + this.btnGo.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnGo.Location = new System.Drawing.Point(162, 133); + this.btnGo.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3); + this.btnGo.Name = "btnGo"; + this.btnGo.Size = new System.Drawing.Size(124, 23); + this.btnGo.TabIndex = 7; + this.btnGo.Text = "Go to destination year"; + this.btnGo.UseVisualStyleBackColor = true; + this.btnGo.Click += new System.EventHandler(this.btnGo_Click); + // + // lblCountDown + // + this.lblCountDown.AutoSize = true; + this.lblCountDown.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.lblCountDown.Location = new System.Drawing.Point(48, 87); + this.lblCountDown.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblCountDown.Name = "lblCountDown"; + this.lblCountDown.Size = new System.Drawing.Size(46, 25); + this.lblCountDown.TabIndex = 8; + this.lblCountDown.Text = "null"; + this.lblCountDown.Visible = false; + // + // countDownTimer + // + this.countDownTimer.Interval = 1000; + this.countDownTimer.Tick += new System.EventHandler(this.countDownTimer_Tick); + // + // WinClassicTimeDistorter + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.lblCountDown); + this.Controls.Add(this.lblCurrent); + this.Controls.Add(this.lblDest); + this.Controls.Add(this.lblYear); + this.Controls.Add(this.btnGo); + this.Controls.Add(this.lblDestYear); + this.Controls.Add(this.lblTo); + this.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3); + this.Name = "WinClassicTimeDistorter"; + this.Size = new System.Drawing.Size(464, 166); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private System.Windows.Forms.Label lblDest; + private System.Windows.Forms.Label lblDestYear; + private System.Windows.Forms.Label lblCurrent; + private System.Windows.Forms.Label lblYear; + private System.Windows.Forms.Label lblTo; + private System.Windows.Forms.Button btnGo; + private System.Windows.Forms.Label lblCountDown; + private System.Windows.Forms.Timer countDownTimer; + } +} 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"; + } + } +} diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.resx b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.resx new file mode 100644 index 0000000..933551f --- /dev/null +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTimeDistorter.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/TimeHACK.Main/TimeHACK.Main.csproj b/TimeHACK.Main/TimeHACK.Main.csproj index 5d55c25..1590896 100644 --- a/TimeHACK.Main/TimeHACK.Main.csproj +++ b/TimeHACK.Main/TimeHACK.Main.csproj @@ -179,6 +179,12 @@ Win95SaveAs.cs + + UserControl + + + WinClassicTimeDistorter.cs + Form @@ -312,6 +318,9 @@ WinClassicThemePanel.cs + + WinClassicTimeDistorter.cs + WinClassicWelcome.cs -- cgit v1.2.3