From 717f7caf678aeb08bc2d621988b771cc1ebd6070 Mon Sep 17 00:00:00 2001 From: lempamo Date: Fri, 28 Jul 2017 15:21:46 -0400 Subject: added seizure warning --- .../Win95/Win95Apps/WinClassicTerminal.Designer.cs | 3 +- TimeHACK.Main/Properties/Resources.Designer.cs | 10 ++ TimeHACK.Main/Properties/Resources.resx | 3 + TimeHACK.Main/Resources/SeizureWarning.png | Bin 0 -> 8081 bytes TimeHACK.Main/SeizureWarning.Designer.cs | 81 ++++++++++++++ TimeHACK.Main/SeizureWarning.cs | 27 +++++ TimeHACK.Main/SeizureWarning.resx | 120 +++++++++++++++++++++ TimeHACK.Main/TimeHACK.Main.csproj | 10 ++ TimeHACK.Main/TitleScreen.cs | 7 ++ 9 files changed, 260 insertions(+), 1 deletion(-) create mode 100644 TimeHACK.Main/Resources/SeizureWarning.png create mode 100644 TimeHACK.Main/SeizureWarning.Designer.cs create mode 100644 TimeHACK.Main/SeizureWarning.cs create mode 100644 TimeHACK.Main/SeizureWarning.resx diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTerminal.Designer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTerminal.Designer.cs index f251094..184b7f5 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTerminal.Designer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicTerminal.Designer.cs @@ -46,9 +46,10 @@ this.cmdPrompt.BackColor = System.Drawing.Color.Black; this.cmdPrompt.Dock = System.Windows.Forms.DockStyle.Fill; this.cmdPrompt.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cmdPrompt.ForeColor = System.Drawing.Color.White; + this.cmdPrompt.ForeColor = System.Drawing.Color.Silver; this.cmdPrompt.Location = new System.Drawing.Point(0, 0); this.cmdPrompt.Name = "cmdPrompt"; + this.cmdPrompt.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedBoth; this.cmdPrompt.ShowSelectionMargin = true; this.cmdPrompt.Size = new System.Drawing.Size(459, 262); this.cmdPrompt.TabIndex = 0; diff --git a/TimeHACK.Main/Properties/Resources.Designer.cs b/TimeHACK.Main/Properties/Resources.Designer.cs index 4abab30..b266891 100644 --- a/TimeHACK.Main/Properties/Resources.Designer.cs +++ b/TimeHACK.Main/Properties/Resources.Designer.cs @@ -464,6 +464,16 @@ namespace TimeHACK.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SeizureWarning { + get { + object obj = ResourceManager.GetObject("SeizureWarning", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/TimeHACK.Main/Properties/Resources.resx b/TimeHACK.Main/Properties/Resources.resx index 7a96a19..b7d6a68 100644 --- a/TimeHACK.Main/Properties/Resources.resx +++ b/TimeHACK.Main/Properties/Resources.resx @@ -681,6 +681,9 @@ ..\Resources\ie4_mail.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\SeizureWarning.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\WinClassic\Win95File.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/TimeHACK.Main/Resources/SeizureWarning.png b/TimeHACK.Main/Resources/SeizureWarning.png new file mode 100644 index 0000000..787d133 Binary files /dev/null and b/TimeHACK.Main/Resources/SeizureWarning.png differ diff --git a/TimeHACK.Main/SeizureWarning.Designer.cs b/TimeHACK.Main/SeizureWarning.Designer.cs new file mode 100644 index 0000000..fc86942 --- /dev/null +++ b/TimeHACK.Main/SeizureWarning.Designer.cs @@ -0,0 +1,81 @@ +namespace TimeHACK +{ + partial class SeizureWarning + { + /// + /// 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.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.button1 = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // pictureBox1 + // + this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.pictureBox1.BackgroundImage = global::TimeHACK.Properties.Resources.SeizureWarning; + this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.pictureBox1.Location = new System.Drawing.Point(0, 0); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(600, 331); + this.pictureBox1.TabIndex = 0; + this.pictureBox1.TabStop = false; + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.button1.ForeColor = System.Drawing.Color.White; + this.button1.Location = new System.Drawing.Point(261, 275); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 1; + this.button1.Text = "OK"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // SeizureWarning + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Black; + this.Controls.Add(this.button1); + this.Controls.Add(this.pictureBox1); + this.Name = "SeizureWarning"; + this.Size = new System.Drawing.Size(600, 330); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.Button button1; + } +} diff --git a/TimeHACK.Main/SeizureWarning.cs b/TimeHACK.Main/SeizureWarning.cs new file mode 100644 index 0000000..ea14576 --- /dev/null +++ b/TimeHACK.Main/SeizureWarning.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.IO; + +namespace TimeHACK +{ + public partial class SeizureWarning : UserControl + { + public SeizureWarning() + { + InitializeComponent(); + } + + private void button1_Click(object sender, EventArgs e) + { + File.WriteAllText(Path.Combine(Engine.SaveSystem.DataDirectory, "o.k"), "."); + this.Hide(); + } + } +} diff --git a/TimeHACK.Main/SeizureWarning.resx b/TimeHACK.Main/SeizureWarning.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/TimeHACK.Main/SeizureWarning.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/TimeHACK.Main/TimeHACK.Main.csproj b/TimeHACK.Main/TimeHACK.Main.csproj index c6433e0..b496ec5 100644 --- a/TimeHACK.Main/TimeHACK.Main.csproj +++ b/TimeHACK.Main/TimeHACK.Main.csproj @@ -329,6 +329,12 @@ SaveFileTroubleShooter.cs + + UserControl + + + SeizureWarning.cs + Form @@ -449,6 +455,9 @@ SaveFileTroubleShooter.cs + + SeizureWarning.cs + TitleScreen.cs @@ -519,6 +528,7 @@ + diff --git a/TimeHACK.Main/TitleScreen.cs b/TimeHACK.Main/TitleScreen.cs index ef14a73..194776c 100644 --- a/TimeHACK.Main/TitleScreen.cs +++ b/TimeHACK.Main/TitleScreen.cs @@ -47,6 +47,13 @@ namespace TimeHACK { InitializeComponent(); this.startmenu.Paint += (sender, args) => Engine.Paintbrush.PaintClassicBorders(sender, args, 2); + if (!File.Exists(Path.Combine(DataDirectory, "o.k"))) + { + SeizureWarning sw = new SeizureWarning(); + sw.Size = programContent.Size; + programContent.Controls.Add(sw); + sw.BringToFront(); + } } public void StartGame() -- cgit v1.2.3