diff options
Diffstat (limited to 'PortEngine')
| -rw-r--r-- | PortEngine/ChatAPI.cs | 2 | ||||
| -rw-r--r-- | PortEngine/PortEngine.csproj | 1 | ||||
| -rw-r--r-- | PortEngine/Properties/Settings.Designer.cs | 14 | ||||
| -rw-r--r-- | PortEngine/Properties/Settings.settings | 3 | ||||
| -rw-r--r-- | PortEngine/TerminalAPI.cs | 55 | ||||
| -rw-r--r-- | PortEngine/app.config | 3 |
6 files changed, 76 insertions, 2 deletions
diff --git a/PortEngine/ChatAPI.cs b/PortEngine/ChatAPI.cs index 667a016..ae1f27b 100644 --- a/PortEngine/ChatAPI.cs +++ b/PortEngine/ChatAPI.cs @@ -12,7 +12,7 @@ namespace PortEngine { public static void SendMessage(TextBox txtPending, TextBox txtDestination) { - txtDestination.AppendText("<Player> " + txtPending.Text + Environment.NewLine); + txtDestination.AppendText("<" + Properties.Settings.Default.userDisplayName + "> " + txtPending.Text + Environment.NewLine); txtPending.Clear(); } } diff --git a/PortEngine/PortEngine.csproj b/PortEngine/PortEngine.csproj index e5ff357..dbea034 100644 --- a/PortEngine/PortEngine.csproj +++ b/PortEngine/PortEngine.csproj @@ -49,6 +49,7 @@ <DesignTimeSharedInput>True</DesignTimeSharedInput> <DependentUpon>Settings.settings</DependentUpon> </Compile> + <Compile Include="TerminalAPI.cs" /> <Compile Include="WindowManager\base.cs"> <SubType>Form</SubType> </Compile> diff --git a/PortEngine/Properties/Settings.Designer.cs b/PortEngine/Properties/Settings.Designer.cs index b3cd482..6462222 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.8.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -34,5 +34,17 @@ namespace PortEngine.Properties { this["graphicsFriendly"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("Player")] + public string userDisplayName { + get { + return ((string)(this["userDisplayName"])); + } + set { + this["userDisplayName"] = value; + } + } } } diff --git a/PortEngine/Properties/Settings.settings b/PortEngine/Properties/Settings.settings index 66e581e..14e29c9 100644 --- a/PortEngine/Properties/Settings.settings +++ b/PortEngine/Properties/Settings.settings @@ -5,5 +5,8 @@ <Setting Name="graphicsFriendly" Type="System.Boolean" Scope="User"> <Value Profile="(Default)">False</Value> </Setting> + <Setting Name="userDisplayName" Type="System.String" Scope="User"> + <Value Profile="(Default)">Player</Value> + </Setting> </Settings> </SettingsFile>
\ No newline at end of file diff --git a/PortEngine/TerminalAPI.cs b/PortEngine/TerminalAPI.cs new file mode 100644 index 0000000..4c09dad --- /dev/null +++ b/PortEngine/TerminalAPI.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace PortEngine +{ + public class TerminalAPI + { + public static void RunCommand(TextBox txtConsoleInput, TextBox txtConsoleOutput) + { + bool LastCommandWasClear = false; + + + switch (txtConsoleInput.Text.ToLower()) + { + + + case "help": + txtConsoleOutput.AppendText("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); + break; + case "clear": + txtConsoleOutput.Clear(); + LastCommandWasClear = true; + break; + case "test": + txtConsoleOutput.AppendText("This is a test!\r\nof the EBS!" + Environment.NewLine); + break; + default: + if (txtConsoleInput.Text.StartsWith("changeusername --")) + { + txtConsoleOutput.AppendText("You have changed your username to " + txtConsoleInput.Text.Substring(17)); + Properties.Settings.Default.userDisplayName = txtConsoleInput.Text.Substring(17); + } + else + { + txtConsoleOutput.AppendText("Bad command. Reference the command list for commands that exist." + Environment.NewLine); + } + break; + } + + if (LastCommandWasClear == true) + { + LastCommandWasClear = false; + } + else + { + txtConsoleOutput.AppendText(Environment.NewLine); + } + + } + } +} diff --git a/PortEngine/app.config b/PortEngine/app.config index e543569..cb6d547 100644 --- a/PortEngine/app.config +++ b/PortEngine/app.config @@ -10,6 +10,9 @@ <setting name="graphicsFriendly" serializeAs="String"> <value>False</value> </setting> + <setting name="userDisplayName" serializeAs="String"> + <value>Player</value> + </setting> </PortEngine.Properties.Settings> </userSettings> </configuration>
\ No newline at end of file |
