Merge pull request #118 from jayxkanz666/master

Added Time Distorter with modularity
This commit is contained in:
Jason 2017-07-06 18:32:31 +02:00 committed by GitHub
commit b37a9fa6c4
7 changed files with 350 additions and 3 deletions

View file

@ -243,7 +243,7 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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
//

View file

@ -429,6 +429,15 @@ private void PropertiesToolStripMenuItem1_Click(object sender, EventArgs e)
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
{

View file

@ -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/

View file

@ -0,0 +1,159 @@
namespace TimeHACK.OS.Win95
{
partial class WinClassicTimeDistorter
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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;
}
}

View file

@ -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";
}
}
}

View file

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="countDownTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -179,6 +179,12 @@
<Compile Include="OS\Win95\Win95SaveAs.Designer.cs">
<DependentUpon>Win95SaveAs.cs</DependentUpon>
</Compile>
<Compile Include="OS\Win95\Win95Apps\WinClassicTimeDistorter.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="OS\Win95\Win95Apps\WinClassicTimeDistorter.Designer.cs">
<DependentUpon>WinClassicTimeDistorter.cs</DependentUpon>
</Compile>
<Compile Include="OS\Win98\Win98.cs">
<SubType>Form</SubType>
</Compile>
@ -312,6 +318,9 @@
<EmbeddedResource Include="OS\Win95\Win95Apps\WinClassicThemePanel.resx">
<DependentUpon>WinClassicThemePanel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="OS\Win95\Win95Apps\WinClassicTimeDistorter.resx">
<DependentUpon>WinClassicTimeDistorter.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="OS\Win95\Win95Apps\WinClassicWelcome.resx">
<DependentUpon>WinClassicWelcome.cs</DependentUpon>
</EmbeddedResource>