From cf72b65769809ac77331414aee299112b9bf4b37 Mon Sep 17 00:00:00 2001 From: Trey <32907415+TheEdgeNK@users.noreply.github.com> Date: Sun, 2 Sep 2018 11:56:23 -0400 Subject: WE FIXED THE STORYLINE!!! --- PortEngine/GeneralAPI.cs | 8 ++++++++ PortEngine/PortsTerminalAPI.cs | 17 ++-------------- PortEngine/Properties/Settings.Designer.cs | 32 +++++++++++++++--------------- PortEngine/Properties/Settings.settings | 16 +++++++-------- PortEngine/StorylineAPI.cs | 20 +++---------------- PortEngine/app.config | 10 +++++----- Project Ports/Programs/ChatApp.Designer.cs | 1 + Project Ports/Programs/ChatApp.cs | 24 +++++++++++++++------- Project Ports/hijackScreen.Designer.cs | 19 +++--------------- 9 files changed, 63 insertions(+), 84 deletions(-) diff --git a/PortEngine/GeneralAPI.cs b/PortEngine/GeneralAPI.cs index 6ba9769..174b8d6 100644 --- a/PortEngine/GeneralAPI.cs +++ b/PortEngine/GeneralAPI.cs @@ -29,6 +29,14 @@ namespace PortEngine public class GeneralAPI { + public static float ChatterStorylineState = Properties.Settings.Default.chatterStorylineStatus; + public static float HijackStorylineState = Properties.Settings.Default.hijackStorylineStatus; + public static int PlayerBalance = Properties.Settings.Default.userBalance; + public static string PlayerName = Properties.Settings.Default.userDisplayName; + public static int PlayerSecurityLevel = Properties.Settings.Default.userSecurityLevel; + public static float PlayerPowerLevel = Properties.Settings.Default.userPowerLevel; + + public static void appendUsername(Label txtUserDestination) { txtUserDestination.Text = Properties.Settings.Default.userDisplayName; diff --git a/PortEngine/PortsTerminalAPI.cs b/PortEngine/PortsTerminalAPI.cs index b41bd2c..ba59409 100644 --- a/PortEngine/PortsTerminalAPI.cs +++ b/PortEngine/PortsTerminalAPI.cs @@ -28,30 +28,17 @@ namespace PortEngine switch (pendingCommand) { case "help": - Console.WriteLine("help - lists the commands\r\ntest - displays a test message\r\nclear - clears the terminal\r\nchangeusername - changes your username for use with the Chatter application\r\n example: changeusername --TheBestUser" + Environment.NewLine); - + Console.WriteLine("help - lists the commands\r\ntest - displays a test message\r\nclear - clears the terminal" + Environment.NewLine); break; case "clear": Console.Clear(); LastCommandWasClear = true; - break; case "test": Console.WriteLine("This is a test!\r\nof the EBS!" + Environment.NewLine); - - break; - + break; default: - if (pendingCommand.StartsWith("changeusername --")) - { - Console.WriteLine("Changed username."); - Properties.Settings.Default.userDisplayName = pendingCommand.Substring(17); - break; - } - else - { Console.WriteLine("Syntax error. Reference the command list for commands that exist." + Environment.NewLine); - } break; } diff --git a/PortEngine/Properties/Settings.Designer.cs b/PortEngine/Properties/Settings.Designer.cs index 5e4656a..16d531b 100644 --- a/PortEngine/Properties/Settings.Designer.cs +++ b/PortEngine/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace PortEngine.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -59,9 +59,9 @@ namespace PortEngine.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("1")] - public string userSecurityLevel { + public int userSecurityLevel { get { - return ((string)(this["userSecurityLevel"])); + return ((int)(this["userSecurityLevel"])); } set { this["userSecurityLevel"] = value; @@ -71,9 +71,9 @@ namespace PortEngine.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("1")] - public string userPowerLevel { + public int userPowerLevel { get { - return ((string)(this["userPowerLevel"])); + return ((int)(this["userPowerLevel"])); } set { this["userPowerLevel"] = value; @@ -82,10 +82,10 @@ namespace PortEngine.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool storylineStatus { + [global::System.Configuration.DefaultSettingValueAttribute("1")] + public float storylineStatus { get { - return ((bool)(this["storylineStatus"])); + return ((float)(this["storylineStatus"])); } set { this["storylineStatus"] = value; @@ -94,25 +94,25 @@ namespace PortEngine.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool hijack1EventCompleted { + [global::System.Configuration.DefaultSettingValueAttribute("1")] + public float hijackStorylineStatus { get { - return ((bool)(this["hijack1EventCompleted"])); + return ((float)(this["hijackStorylineStatus"])); } set { - this["hijack1EventCompleted"] = value; + this["hijackStorylineStatus"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool chatter1EventCompleted { + [global::System.Configuration.DefaultSettingValueAttribute("1")] + public float chatterStorylineStatus { get { - return ((bool)(this["chatter1EventCompleted"])); + return ((float)(this["chatterStorylineStatus"])); } set { - this["chatter1EventCompleted"] = value; + this["chatterStorylineStatus"] = value; } } } diff --git a/PortEngine/Properties/Settings.settings b/PortEngine/Properties/Settings.settings index 100f3c4..61f2593 100644 --- a/PortEngine/Properties/Settings.settings +++ b/PortEngine/Properties/Settings.settings @@ -11,20 +11,20 @@ 0 - + 1 - + 1 - - True + + 1 - - False + + 1 - - False + + 1 \ No newline at end of file diff --git a/PortEngine/StorylineAPI.cs b/PortEngine/StorylineAPI.cs index db03baf..a109c8b 100644 --- a/PortEngine/StorylineAPI.cs +++ b/PortEngine/StorylineAPI.cs @@ -30,20 +30,10 @@ namespace PortEngine { public class StorylineAPI { - public static bool StorylineStatus = Properties.Settings.Default.storylineStatus; - public static bool IsHijack1Completed = Properties.Settings.Default.hijack1EventCompleted; - public static bool IsChatter1Completed = Properties.Settings.Default.chatter1EventCompleted; - public static string PlayerDisplayName = Properties.Settings.Default.userDisplayName; - static BackgroundWorker WorkerBee = new BackgroundWorker(); - - public static void StorylineState(bool IsStorylineEnabled) - { - StorylineStatus = IsStorylineEnabled; - } public static void StartHijackEvent1(TextBox txtHijack1) { - if (IsHijack1Completed == false) + if (GeneralAPI.HijackStorylineState == 1) { Thread.Sleep(2000); txtHijack1.AppendText("PortOS is now booting..." + Environment.NewLine); @@ -121,7 +111,7 @@ namespace PortEngine public static void StartChatterEvent1(TextBox txtSentMessageDump) { - if (IsChatter1Completed == false) + if (GeneralAPI.ChatterStorylineState == 1) { txtSentMessageDump.AppendText("Adam has entered the channel..." + Environment.NewLine); Thread.Sleep(2000); @@ -133,7 +123,7 @@ namespace PortEngine Thread.Sleep(10000); txtSentMessageDump.AppendText(" Great!" + Environment.NewLine); Thread.Sleep(2000); - txtSentMessageDump.AppendText(" Hello, " + PlayerDisplayName + Environment.NewLine); + txtSentMessageDump.AppendText(" Hello, " + GeneralAPI.PlayerName + Environment.NewLine); Thread.Sleep(2000); txtSentMessageDump.AppendText(" If you open your app launcher, there is an application called the 'QuantumNet Browser'" + Environment.NewLine); Thread.Sleep(2000); @@ -161,10 +151,6 @@ namespace PortEngine Thread.Sleep(2000); txtSentMessageDump.AppendText("Adam has disconnected from the channel. " + Environment.NewLine); } - else - { - txtSentMessageDump.AppendText(PlayerDisplayName + " has entered the channel!"); - } } diff --git a/PortEngine/app.config b/PortEngine/app.config index 62af220..8d3e43f 100644 --- a/PortEngine/app.config +++ b/PortEngine/app.config @@ -23,13 +23,13 @@ 1 - True + 1 - - False + + 1 - - False + + 1 diff --git a/Project Ports/Programs/ChatApp.Designer.cs b/Project Ports/Programs/ChatApp.Designer.cs index c8a6502..c1a3b38 100644 --- a/Project Ports/Programs/ChatApp.Designer.cs +++ b/Project Ports/Programs/ChatApp.Designer.cs @@ -48,6 +48,7 @@ this.txtSentMessages.ReadOnly = true; this.txtSentMessages.Size = new System.Drawing.Size(439, 187); this.txtSentMessages.TabIndex = 0; + this.txtSentMessages.TextChanged += new System.EventHandler(this.txtSentMessages_TextChanged); // // txtMsgContents // diff --git a/Project Ports/Programs/ChatApp.cs b/Project Ports/Programs/ChatApp.cs index 3af3f64..2fd2070 100644 --- a/Project Ports/Programs/ChatApp.cs +++ b/Project Ports/Programs/ChatApp.cs @@ -41,21 +41,31 @@ namespace Project_Ports private void btnSendMSG_Click(object sender, EventArgs e) { - //ChatAPI.SendMessage(txtMsgContents, txtSentMessages); + ChatAPI.SendMessage(txtMsgContents, txtSentMessages); } private void txtMsgContents_KeyDown(object sender, KeyEventArgs e) { - //if (e.KeyCode == Keys.Enter) - //{ - //ChatAPI.SendMessage(txtMsgContents, txtSentMessages); - //e.SuppressKeyPress = true; - //} + if (e.KeyCode == Keys.Enter) + { + ChatAPI.SendMessage(txtMsgContents, txtSentMessages); + e.SuppressKeyPress = true; + } } private void ChatApp_Load(object sender, EventArgs e) { - StorylineAPI.StartChatterEvent1(txtMsgContents); + txtSentMessages.AppendText(GeneralAPI.PlayerName + " has entered the channel!"); + + } + + private async void txtSentMessages_TextChanged(object sender, EventArgs e) + { + if (txtSentMessages.Text == GeneralAPI.PlayerName + " has entered the channel!" + Environment.NewLine) + { + await Task.Delay(1000); + StorylineAPI.StartChatterEvent1(txtSentMessages); + } } } } diff --git a/Project Ports/hijackScreen.Designer.cs b/Project Ports/hijackScreen.Designer.cs index 1f3394a..c605dfb 100644 --- a/Project Ports/hijackScreen.Designer.cs +++ b/Project Ports/hijackScreen.Designer.cs @@ -29,7 +29,6 @@ private void InitializeComponent() { this.hijackPanel = new System.Windows.Forms.Panel(); - this.button1 = new System.Windows.Forms.Button(); this.txtHijack = new System.Windows.Forms.TextBox(); this.hijackPanel.SuspendLayout(); this.SuspendLayout(); @@ -40,38 +39,27 @@ | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.hijackPanel.BackColor = System.Drawing.Color.Black; - this.hijackPanel.Controls.Add(this.button1); this.hijackPanel.Controls.Add(this.txtHijack); this.hijackPanel.Location = new System.Drawing.Point(0, 0); this.hijackPanel.Name = "hijackPanel"; this.hijackPanel.Size = new System.Drawing.Size(986, 571); this.hijackPanel.TabIndex = 3; // - // button1 - // - this.button1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.button1.Dock = System.Windows.Forms.DockStyle.Right; - this.button1.Location = new System.Drawing.Point(911, 0); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 571); - this.button1.TabIndex = 4; - this.button1.Text = "skip"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // // txtHijack // this.txtHijack.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.txtHijack.BackColor = System.Drawing.Color.Black; + this.txtHijack.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.txtHijack.Cursor = System.Windows.Forms.Cursors.IBeam; this.txtHijack.Font = new System.Drawing.Font("Consolas", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtHijack.ForeColor = System.Drawing.Color.White; this.txtHijack.Location = new System.Drawing.Point(15, 12); this.txtHijack.Multiline = true; this.txtHijack.Name = "txtHijack"; this.txtHijack.ReadOnly = true; - this.txtHijack.Size = new System.Drawing.Size(878, 547); + this.txtHijack.Size = new System.Drawing.Size(957, 547); this.txtHijack.TabIndex = 3; // // hijackScreen @@ -95,6 +83,5 @@ private System.Windows.Forms.Panel hijackPanel; private System.Windows.Forms.TextBox txtHijack; - private System.Windows.Forms.Button button1; } } \ No newline at end of file -- cgit v1.2.3