From 90e14a0932b63679c356e8bc1d42e657d7c612ad Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 28 Aug 2018 14:22:58 -0400 Subject: Changed crashing and added booting --- PortEngine/CrashAPI.cs | 19 ---- PortEngine/PortEngine.csproj | 1 - Project Ports/App.config | 3 + Project Ports/Boot.Designer.cs | 72 ++++++++++++++++ Project Ports/Boot.cs | 39 +++++++++ Project Ports/Boot.resx | 120 ++++++++++++++++++++++++++ Project Ports/Crash.Designer.cs | 49 ++++------- Project Ports/Crash.cs | 24 ++++-- Project Ports/Desktop.Designer.cs | 16 ++++ Project Ports/Desktop.cs | 8 ++ Project Ports/Desktop.resx | 3 - Project Ports/MainMenu.cs | 8 +- Project Ports/Project Ports.csproj | 10 +++ Project Ports/Properties/Settings.Designer.cs | 12 +++ Project Ports/Properties/Settings.settings | 3 + 15 files changed, 325 insertions(+), 62 deletions(-) delete mode 100644 PortEngine/CrashAPI.cs create mode 100644 Project Ports/Boot.Designer.cs create mode 100644 Project Ports/Boot.cs create mode 100644 Project Ports/Boot.resx diff --git a/PortEngine/CrashAPI.cs b/PortEngine/CrashAPI.cs deleted file mode 100644 index 9796524..0000000 --- a/PortEngine/CrashAPI.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace PortEngine -{ - class CrashAPI - { - public static void ResetAPI () - { - Properties.Settings.Default.userBalance = 0; - //Properties.Settings.Default.userSecurityLevel = 1; - // Properties.Settings.Default.userPowerLevel = 1; - Properties.Settings.Default.userDisplayName = "Player"; - } - } -} diff --git a/PortEngine/PortEngine.csproj b/PortEngine/PortEngine.csproj index 98948a0..544ab0e 100644 --- a/PortEngine/PortEngine.csproj +++ b/PortEngine/PortEngine.csproj @@ -43,7 +43,6 @@ - UserControl diff --git a/Project Ports/App.config b/Project Ports/App.config index 97c0438..a72d535 100644 --- a/Project Ports/App.config +++ b/Project Ports/App.config @@ -19,6 +19,9 @@ Alpha 0.2 + + False + \ No newline at end of file diff --git a/Project Ports/Boot.Designer.cs b/Project Ports/Boot.Designer.cs new file mode 100644 index 0000000..91927d7 --- /dev/null +++ b/Project Ports/Boot.Designer.cs @@ -0,0 +1,72 @@ +namespace Project_Ports +{ + partial class Boot + { + /// + /// 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 Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.txtBoot = new System.Windows.Forms.RichTextBox(); + this.SuspendLayout(); + // + // txtBoot + // + this.txtBoot.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtBoot.BackColor = System.Drawing.Color.Black; + this.txtBoot.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.txtBoot.Cursor = System.Windows.Forms.Cursors.IBeam; + this.txtBoot.ForeColor = System.Drawing.Color.White; + this.txtBoot.Location = new System.Drawing.Point(12, 12); + this.txtBoot.Name = "txtBoot"; + this.txtBoot.ReadOnly = true; + this.txtBoot.Size = new System.Drawing.Size(565, 429); + this.txtBoot.TabIndex = 0; + this.txtBoot.Text = ""; + // + // Boot + // + this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 22F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Black; + this.ClientSize = new System.Drawing.Size(589, 453); + this.Controls.Add(this.txtBoot); + this.Font = new System.Drawing.Font("Consolas", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ForeColor = System.Drawing.Color.White; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.Name = "Boot"; + this.Text = "Boot"; + this.Load += new System.EventHandler(this.Boot_Load); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.RichTextBox txtBoot; + } +} \ No newline at end of file diff --git a/Project Ports/Boot.cs b/Project Ports/Boot.cs new file mode 100644 index 0000000..4aa9380 --- /dev/null +++ b/Project Ports/Boot.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Project_Ports +{ + public partial class Boot : Form + { + public Boot() + { + InitializeComponent(); + } + + private void Boot_Load(object sender, EventArgs e) + { + this.BringToFront(); + Thread.Sleep(2000); + txtBoot.AppendText("PortOS is now booting..."); + Thread.Sleep(2000); + txtBoot.AppendText("PortOS is now booting..." + Environment.NewLine); + Thread.Sleep(2000); + txtBoot.AppendText("GUI Driver has been found!" + Environment.NewLine); + Thread.Sleep(2000); + txtBoot.AppendText("Starting Desktop..." + Environment.NewLine); + Thread.Sleep(3000); + + Desktop desktop = new Desktop(); + desktop.Show(); + this.Close(); + } + } +} diff --git a/Project Ports/Boot.resx b/Project Ports/Boot.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Project Ports/Boot.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/Project Ports/Crash.Designer.cs b/Project Ports/Crash.Designer.cs index 2be9530..3a81699 100644 --- a/Project Ports/Crash.Designer.cs +++ b/Project Ports/Crash.Designer.cs @@ -28,34 +28,25 @@ /// private void InitializeComponent() { - this.lbCrash = new System.Windows.Forms.Label(); - this.btnStartOver = new System.Windows.Forms.Button(); + this.txtCrash = new System.Windows.Forms.RichTextBox(); this.SuspendLayout(); // - // lbCrash + // txtCrash // - this.lbCrash.AutoSize = true; - this.lbCrash.Font = new System.Drawing.Font("Consolas", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbCrash.ForeColor = System.Drawing.Color.Red; - this.lbCrash.Location = new System.Drawing.Point(12, 9); - this.lbCrash.Name = "lbCrash"; - this.lbCrash.Size = new System.Drawing.Size(406, 168); - this.lbCrash.TabIndex = 0; - this.lbCrash.Text = "PortOS.GUI has crashed....\r\n\r\nSYSTEM ERROR: CRASHED\r\n\r\nYou just lost the game :(\r" + - "\n\r\nPress the button to start over..."; - // - // btnStartOver - // - this.btnStartOver.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnStartOver.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnStartOver.ForeColor = System.Drawing.Color.White; - this.btnStartOver.Location = new System.Drawing.Point(619, 430); - this.btnStartOver.Name = "btnStartOver"; - this.btnStartOver.Size = new System.Drawing.Size(75, 23); - this.btnStartOver.TabIndex = 1; - this.btnStartOver.Text = "Start Over"; - this.btnStartOver.UseVisualStyleBackColor = true; - this.btnStartOver.Click += new System.EventHandler(this.btnStartOver_Click); + this.txtCrash.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtCrash.BackColor = System.Drawing.Color.Black; + this.txtCrash.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.txtCrash.Cursor = System.Windows.Forms.Cursors.IBeam; + this.txtCrash.Font = new System.Drawing.Font("Consolas", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtCrash.ForeColor = System.Drawing.Color.Red; + this.txtCrash.Location = new System.Drawing.Point(12, 12); + this.txtCrash.Name = "txtCrash"; + this.txtCrash.ReadOnly = true; + this.txtCrash.Size = new System.Drawing.Size(693, 441); + this.txtCrash.TabIndex = 0; + this.txtCrash.Text = ""; // // Crash // @@ -63,20 +54,18 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Black; this.ClientSize = new System.Drawing.Size(717, 465); - this.Controls.Add(this.btnStartOver); - this.Controls.Add(this.lbCrash); + this.Controls.Add(this.txtCrash); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "Crash"; this.Text = "Crash"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + this.Load += new System.EventHandler(this.Crash_Load); this.ResumeLayout(false); - this.PerformLayout(); } #endregion - private System.Windows.Forms.Label lbCrash; - private System.Windows.Forms.Button btnStartOver; + private System.Windows.Forms.RichTextBox txtCrash; } } \ No newline at end of file diff --git a/Project Ports/Crash.cs b/Project Ports/Crash.cs index a5273d3..0bfb955 100644 --- a/Project Ports/Crash.cs +++ b/Project Ports/Crash.cs @@ -5,6 +5,7 @@ using System.Data; using System.Drawing; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; using PortEngine; @@ -18,12 +19,25 @@ namespace Project_Ports InitializeComponent(); } - private void btnStartOver_Click(object sender, EventArgs e) + private void Crash_Load(object sender, EventArgs e) { - Properties.Settings.Default.hijacked = true; - Properties.Settings.Default.chatterStoryline = true; - this.Close(); - + this.BringToFront(); + Thread.Sleep(2000); + txtCrash.AppendText("PortOS.GUI has crashed..." + Environment.NewLine); + Thread.Sleep(2000); + txtCrash.AppendText("SYSTEM ERROR: Crashed" + Environment.NewLine); + Thread.Sleep(2000); + txtCrash.AppendText("Rebooting PortOS..." + Environment.NewLine); + if (Properties.Settings.Default.hijacked2 == true) + { + MessageBox.Show("Coming soon!"); + } + else + { + Boot boot = new Boot(); + boot.Show(); + this.Close(); + } } } } diff --git a/Project Ports/Desktop.Designer.cs b/Project Ports/Desktop.Designer.cs index 38fe9e5..fcc5430 100644 --- a/Project Ports/Desktop.Designer.cs +++ b/Project Ports/Desktop.Designer.cs @@ -47,6 +47,7 @@ this.appButton = new System.Windows.Forms.Button(); this.desktopWatermark = new System.Windows.Forms.Label(); this.btnhijack2 = new System.Windows.Forms.Button(); + this.btnCrash = new System.Windows.Forms.Button(); this.appMenu.SuspendLayout(); this.programStrip.SuspendLayout(); this.panel1.SuspendLayout(); @@ -73,6 +74,7 @@ // appMenu // this.appMenu.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.appMenu.Controls.Add(this.btnCrash); this.appMenu.Controls.Add(this.btnhijack2); this.appMenu.Controls.Add(this.programStrip); this.appMenu.Controls.Add(this.panel2); @@ -242,6 +244,19 @@ this.btnhijack2.Visible = false; this.btnhijack2.Click += new System.EventHandler(this.btnhijack2_Click); // + // btnCrash + // + this.btnCrash.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnCrash.ForeColor = System.Drawing.Color.White; + this.btnCrash.Location = new System.Drawing.Point(192, 351); + this.btnCrash.Name = "btnCrash"; + this.btnCrash.Size = new System.Drawing.Size(75, 23); + this.btnCrash.TabIndex = 7; + this.btnCrash.Text = "Crash"; + this.btnCrash.UseVisualStyleBackColor = true; + this.btnCrash.Visible = false; + this.btnCrash.Click += new System.EventHandler(this.btnCrash_Click); + // // Desktop // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -290,5 +305,6 @@ private System.Windows.Forms.ToolStripMenuItem quantumNetBrowserToolStripMenuItem; private System.Windows.Forms.Label desktopWatermark; private System.Windows.Forms.Button btnhijack2; + private System.Windows.Forms.Button btnCrash; } } \ No newline at end of file diff --git a/Project Ports/Desktop.cs b/Project Ports/Desktop.cs index 62f8c78..68456d0 100644 --- a/Project Ports/Desktop.cs +++ b/Project Ports/Desktop.cs @@ -53,6 +53,7 @@ namespace Project_Ports #if DEBUG testWindowToolStripMenuItem.Visible = true; btnhijack2.Visible = true; + btnCrash.Visible = true; #endif dclock.Start(); desktopWatermark.Text = "Project: Ports " + Properties.Settings.Default.version + Environment.NewLine + "Working Progress"; @@ -124,5 +125,12 @@ namespace Project_Ports crash.Show(); } + + private void btnCrash_Click(object sender, EventArgs e) + { + Crash crash = new Crash(); + crash.Show(); + this.Close(); + } } } diff --git a/Project Ports/Desktop.resx b/Project Ports/Desktop.resx index d77d5fb..c218578 100644 --- a/Project Ports/Desktop.resx +++ b/Project Ports/Desktop.resx @@ -123,9 +123,6 @@ 21, 15 - - 21, 15 - True diff --git a/Project Ports/MainMenu.cs b/Project Ports/MainMenu.cs index a1eb5aa..ab5f1e8 100644 --- a/Project Ports/MainMenu.cs +++ b/Project Ports/MainMenu.cs @@ -42,18 +42,18 @@ namespace Project_Ports private void btnPlay_Click(object sender, EventArgs e) { - Desktop desktop = new Desktop(); + Desktop desktop = new Desktop(); #if DEBUG Properties.Settings.Default.hijacked = false; desktop.Show(); - #endif + #endif if (Properties.Settings.Default.hijacked == true) { hijackScreen hijack = new hijackScreen(); hijack.Show(); - } else + } + else { - desktop.Show(); } diff --git a/Project Ports/Project Ports.csproj b/Project Ports/Project Ports.csproj index 5f13fa3..f9a93b6 100644 --- a/Project Ports/Project Ports.csproj +++ b/Project Ports/Project Ports.csproj @@ -51,6 +51,12 @@ AboutPorts.cs + + Form + + + Boot.cs + Form @@ -121,6 +127,9 @@ AboutPorts.cs + + Boot.cs + Crash.cs @@ -171,6 +180,7 @@ + diff --git a/Project Ports/Properties/Settings.Designer.cs b/Project Ports/Properties/Settings.Designer.cs index c9730c8..acb72c0 100644 --- a/Project Ports/Properties/Settings.Designer.cs +++ b/Project Ports/Properties/Settings.Designer.cs @@ -58,5 +58,17 @@ namespace Project_Ports.Properties { this["version"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool hijacked2 { + get { + return ((bool)(this["hijacked2"])); + } + set { + this["hijacked2"] = value; + } + } } } diff --git a/Project Ports/Properties/Settings.settings b/Project Ports/Properties/Settings.settings index 0d54ca1..f43d837 100644 --- a/Project Ports/Properties/Settings.settings +++ b/Project Ports/Properties/Settings.settings @@ -11,5 +11,8 @@ Alpha 0.2 + + False + \ No newline at end of file -- cgit v1.2.3