aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew <alee14498@gmail.com>2018-08-27 21:06:43 -0400
committerAndrew <alee14498@gmail.com>2018-08-27 21:06:43 -0400
commitf0be68047a246208aa30974990e7c3ec8dd8252a (patch)
tree8320564185b1234f25d51ba135c844b0284caa07
parent129cc4373485a1d1151442ca250ddd8b0d3a8a15 (diff)
downloadProject-Silicon-f0be68047a246208aa30974990e7c3ec8dd8252a.tar.gz
Project-Silicon-f0be68047a246208aa30974990e7c3ec8dd8252a.tar.bz2
Project-Silicon-f0be68047a246208aa30974990e7c3ec8dd8252a.zip
Added crashing
-rw-r--r--PortEngine/CrashAPI.cs19
-rw-r--r--PortEngine/PortEngine.csproj1
-rw-r--r--Project Ports/Crash.Designer.cs82
-rw-r--r--Project Ports/Crash.cs29
-rw-r--r--Project Ports/Crash.resx120
-rw-r--r--Project Ports/Desktop.Designer.cs1
-rw-r--r--Project Ports/Desktop.cs3
-rw-r--r--Project Ports/Programs/TestWindow.Designer.cs14
-rw-r--r--Project Ports/Programs/TestWindow.cs5
-rw-r--r--Project Ports/Project Ports.csproj9
10 files changed, 283 insertions, 0 deletions
diff --git a/PortEngine/CrashAPI.cs b/PortEngine/CrashAPI.cs
new file mode 100644
index 0000000..9796524
--- /dev/null
+++ b/PortEngine/CrashAPI.cs
@@ -0,0 +1,19 @@
+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 544ab0e..98948a0 100644
--- a/PortEngine/PortEngine.csproj
+++ b/PortEngine/PortEngine.csproj
@@ -43,6 +43,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="ChatAPI.cs" />
+ <Compile Include="CrashAPI.cs" />
<Compile Include="EarnSite.cs">
<SubType>UserControl</SubType>
</Compile>
diff --git a/Project Ports/Crash.Designer.cs b/Project Ports/Crash.Designer.cs
new file mode 100644
index 0000000..2be9530
--- /dev/null
+++ b/Project Ports/Crash.Designer.cs
@@ -0,0 +1,82 @@
+namespace Project_Ports
+{
+ partial class Crash
+ {
+ /// <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 Windows Form 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.lbCrash = new System.Windows.Forms.Label();
+ this.btnStartOver = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // lbCrash
+ //
+ 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);
+ //
+ // Crash
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ 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.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+ this.Name = "Crash";
+ this.Text = "Crash";
+ this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label lbCrash;
+ private System.Windows.Forms.Button btnStartOver;
+ }
+} \ No newline at end of file
diff --git a/Project Ports/Crash.cs b/Project Ports/Crash.cs
new file mode 100644
index 0000000..a5273d3
--- /dev/null
+++ b/Project Ports/Crash.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using PortEngine;
+
+namespace Project_Ports
+{
+ public partial class Crash : Form
+ {
+ public Crash()
+ {
+ InitializeComponent();
+ }
+
+ private void btnStartOver_Click(object sender, EventArgs e)
+ {
+ Properties.Settings.Default.hijacked = true;
+ Properties.Settings.Default.chatterStoryline = true;
+ this.Close();
+
+ }
+ }
+}
diff --git a/Project Ports/Crash.resx b/Project Ports/Crash.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/Project Ports/Crash.resx
@@ -0,0 +1,120 @@
+<?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>
+</root> \ No newline at end of file
diff --git a/Project Ports/Desktop.Designer.cs b/Project Ports/Desktop.Designer.cs
index 672b046..130d80b 100644
--- a/Project Ports/Desktop.Designer.cs
+++ b/Project Ports/Desktop.Designer.cs
@@ -123,6 +123,7 @@
this.testWindowToolStripMenuItem.Name = "testWindowToolStripMenuItem";
this.testWindowToolStripMenuItem.Size = new System.Drawing.Size(200, 22);
this.testWindowToolStripMenuItem.Text = "TestWindow";
+ this.testWindowToolStripMenuItem.Visible = false;
this.testWindowToolStripMenuItem.Click += new System.EventHandler(this.testWindowToolStripMenuItem_Click_1);
//
// chatterToolStripMenuItem
diff --git a/Project Ports/Desktop.cs b/Project Ports/Desktop.cs
index 389b812..2742742 100644
--- a/Project Ports/Desktop.cs
+++ b/Project Ports/Desktop.cs
@@ -50,6 +50,9 @@ namespace Project_Ports
private void Desktop_Load(object sender, EventArgs e)
{
+ #if DEBUG
+ testWindowToolStripMenuItem.Visible = true;
+ #endif
dclock.Start();
desktopWatermark.Text = "Project: Ports " + Properties.Settings.Default.version + Environment.NewLine + "Working Progress";
appMenu.Hide();
diff --git a/Project Ports/Programs/TestWindow.Designer.cs b/Project Ports/Programs/TestWindow.Designer.cs
index bb99823..540eaaf 100644
--- a/Project Ports/Programs/TestWindow.Designer.cs
+++ b/Project Ports/Programs/TestWindow.Designer.cs
@@ -28,12 +28,24 @@
/// </summary>
private void InitializeComponent()
{
+ this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(22, 298);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(75, 23);
+ this.button1.TabIndex = 0;
+ this.button1.Text = "Crash test";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
// TestWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.button1);
this.Name = "TestWindow";
this.Size = new System.Drawing.Size(443, 341);
this.Load += new System.EventHandler(this.TestWindow_Load);
@@ -42,5 +54,7 @@
}
#endregion
+
+ private System.Windows.Forms.Button button1;
}
}
diff --git a/Project Ports/Programs/TestWindow.cs b/Project Ports/Programs/TestWindow.cs
index 4f27de8..b3ea2ca 100644
--- a/Project Ports/Programs/TestWindow.cs
+++ b/Project Ports/Programs/TestWindow.cs
@@ -23,5 +23,10 @@ namespace Project_Ports
WindowManager wm = new WindowManager();
}
+ private void button1_Click(object sender, EventArgs e)
+ {
+ Crash crash = new Crash();
+ crash.Show();
+ }
}
}
diff --git a/Project Ports/Project Ports.csproj b/Project Ports/Project Ports.csproj
index bb81c0d..5f13fa3 100644
--- a/Project Ports/Project Ports.csproj
+++ b/Project Ports/Project Ports.csproj
@@ -63,6 +63,12 @@
<Compile Include="Desktop.Designer.cs">
<DependentUpon>Desktop.cs</DependentUpon>
</Compile>
+ <Compile Include="Crash.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Crash.Designer.cs">
+ <DependentUpon>Crash.cs</DependentUpon>
+ </Compile>
<Compile Include="hijackScreen.cs">
<SubType>Form</SubType>
</Compile>
@@ -115,6 +121,9 @@
<EmbeddedResource Include="AboutPorts.resx">
<DependentUpon>AboutPorts.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="Crash.resx">
+ <DependentUpon>Crash.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="DebugMode.resx">
<DependentUpon>DebugMode.cs</DependentUpon>
</EmbeddedResource>