hybrid config mode // removed feature

This commit is contained in:
TheEdgeNK 2018-09-01 01:27:41 -04:00
parent fb69cc80fc
commit 269f6d0f4c
16 changed files with 89 additions and 67 deletions

View file

@ -19,6 +19,7 @@
**************************************************************************/
using System;
using System.Collections.Generic;
using System.Timers;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -29,8 +30,10 @@ namespace PortEngine
{
public class ChatAPI
{
public static void SendMessage(TextBox txtPending, TextBox txtDestination)
{
;
txtDestination.AppendText("<" + Properties.Settings.Default.userDisplayName + "> " + txtPending.Text + Environment.NewLine);
txtPending.Clear();
}

View file

@ -29,7 +29,7 @@ namespace PortEngine
public class GeneralAPI
{
public static void setNameOnAppLauncher(Label txtUserDestination)
public static void appendUsername(Label txtUserDestination)
{
txtUserDestination.Text = Properties.Settings.Default.userDisplayName;
}

View file

@ -29,7 +29,16 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Hybrid|AnyCPU'">
<OutputPath>bin\Hybrid\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="ConsoleControl, Version=1.1.0.0, Culture=neutral, PublicKeyToken=7edd23586f5e297f, processorArchitecture=MSIL">
<HintPath>..\packages\ConsoleControl.1.1.0.0\lib\net40\ConsoleControl.dll</HintPath>
</Reference>
<Reference Include="ConsoleControlAPI, Version=1.1.0.0, Culture=neutral, PublicKeyToken=7c86b8a36b9c33e2, processorArchitecture=MSIL">
<HintPath>..\packages\ConsoleControl.1.1.0.0\lib\net40\ConsoleControlAPI.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
@ -113,10 +122,14 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -44,7 +44,7 @@ namespace PortEngine
default:
if (pendingCommand.StartsWith("changeusername --"))
{
Console.WriteLine("Username changed from " + Properties.Settings.Default.userDisplayName + " to " + pendingCommand.Substring(17));
Console.WriteLine("Changed username.");
Properties.Settings.Default.userDisplayName = pendingCommand.Substring(17);
break;
}

View file

@ -39,7 +39,7 @@ namespace PortEngine
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);
txtConsoleOutput.AppendText("help - lists the commands\r\ntest - displays a test message\r\nclear - clears the terminal\r\n" + Environment.NewLine);
break;
case "clear":
txtConsoleOutput.Clear();
@ -49,15 +49,7 @@ namespace PortEngine
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);
}
txtConsoleOutput.AppendText("Bad command. Reference the command list for commands that exist." + Environment.NewLine);
break;
}

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ConsoleControl" version="1.1.0.0" targetFramework="net461" />
</packages>

View file

@ -17,7 +17,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@ -26,11 +26,14 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Hybrid|AnyCPU'">
<OutputPath>bin\Hybrid\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
@ -53,10 +56,6 @@
<Project>{c1b21b60-7ccc-42fc-83aa-b41644faa952}</Project>
<Name>PortEngine</Name>
</ProjectReference>
<ProjectReference Include="..\Project Ports\Project Ports.csproj">
<Project>{7ff89341-be42-4ae1-b53e-f9fa4104d30f}</Project>
<Name>Project Ports</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -12,19 +12,26 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Hybrid|Any CPU = Hybrid|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7FF89341-BE42-4AE1-B53E-F9FA4104D30F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7FF89341-BE42-4AE1-B53E-F9FA4104D30F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7FF89341-BE42-4AE1-B53E-F9FA4104D30F}.Hybrid|Any CPU.ActiveCfg = Hybrid|Any CPU
{7FF89341-BE42-4AE1-B53E-F9FA4104D30F}.Hybrid|Any CPU.Build.0 = Hybrid|Any CPU
{7FF89341-BE42-4AE1-B53E-F9FA4104D30F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7FF89341-BE42-4AE1-B53E-F9FA4104D30F}.Release|Any CPU.Build.0 = Release|Any CPU
{C1B21B60-7CCC-42FC-83AA-B41644FAA952}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C1B21B60-7CCC-42FC-83AA-B41644FAA952}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C1B21B60-7CCC-42FC-83AA-B41644FAA952}.Hybrid|Any CPU.ActiveCfg = Hybrid|Any CPU
{C1B21B60-7CCC-42FC-83AA-B41644FAA952}.Hybrid|Any CPU.Build.0 = Hybrid|Any CPU
{C1B21B60-7CCC-42FC-83AA-B41644FAA952}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C1B21B60-7CCC-42FC-83AA-B41644FAA952}.Release|Any CPU.Build.0 = Release|Any CPU
{51B19B80-B154-4EFE-B838-FEC598F9E6D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{51B19B80-B154-4EFE-B838-FEC598F9E6D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{51B19B80-B154-4EFE-B838-FEC598F9E6D9}.Hybrid|Any CPU.ActiveCfg = Hybrid|Any CPU
{51B19B80-B154-4EFE-B838-FEC598F9E6D9}.Hybrid|Any CPU.Build.0 = Hybrid|Any CPU
{51B19B80-B154-4EFE-B838-FEC598F9E6D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{51B19B80-B154-4EFE-B838-FEC598F9E6D9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection

View file

@ -22,6 +22,9 @@
<setting name="hijacked2" serializeAs="String">
<value>False</value>
</setting>
<setting name="userDisplayName" serializeAs="String">
<value>Player</value>
</setting>
</Project_Ports.Properties.Settings>
</userSettings>
</configuration>

View file

@ -43,7 +43,7 @@ namespace Project_Ports
private void dclock_Tick(object sender, EventArgs e)
{
GeneralAPI.setNameOnAppLauncher(playerName);
GeneralAPI.appendUsername(playerName);
this.ltime.Text = DateTime.Now.ToString("hh:mm tt");
}

View file

@ -28,55 +28,33 @@
/// </summary>
private void InitializeComponent()
{
this.txtConsole = new System.Windows.Forms.TextBox();
this.txtInput = new System.Windows.Forms.TextBox();
this.terminalControl = new ConsoleControl.ConsoleControl();
this.SuspendLayout();
//
// txtConsole
// terminalControl
//
this.txtConsole.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.txtConsole.BackColor = System.Drawing.Color.Black;
this.txtConsole.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtConsole.Font = new System.Drawing.Font("Consolas", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtConsole.ForeColor = System.Drawing.Color.White;
this.txtConsole.Location = new System.Drawing.Point(-3, 0);
this.txtConsole.Multiline = true;
this.txtConsole.Name = "txtConsole";
this.txtConsole.ReadOnly = true;
this.txtConsole.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txtConsole.Size = new System.Drawing.Size(456, 321);
this.txtConsole.TabIndex = 3;
//
// txtInput
//
this.txtInput.BackColor = System.Drawing.SystemColors.WindowText;
this.txtInput.Font = new System.Drawing.Font("Lucida Console", 8F);
this.txtInput.ForeColor = System.Drawing.SystemColors.Window;
this.txtInput.Location = new System.Drawing.Point(0, 319);
this.txtInput.Name = "txtInput";
this.txtInput.Size = new System.Drawing.Size(456, 18);
this.txtInput.TabIndex = 4;
this.txtInput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtInput_KeyDown);
this.terminalControl.IsInputEnabled = true;
this.terminalControl.Location = new System.Drawing.Point(0, 0);
this.terminalControl.Name = "terminalControl";
this.terminalControl.SendKeyboardCommandsToProcess = false;
this.terminalControl.ShowDiagnostics = false;
this.terminalControl.Size = new System.Drawing.Size(709, 441);
this.terminalControl.TabIndex = 0;
this.terminalControl.Load += new System.EventHandler(this.terminalControl_Load);
//
// Terminal
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.txtInput);
this.Controls.Add(this.txtConsole);
this.Controls.Add(this.terminalControl);
this.Name = "Terminal";
this.Size = new System.Drawing.Size(456, 337);
this.Load += new System.EventHandler(this.Terminal_Load);
this.Size = new System.Drawing.Size(709, 441);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox txtConsole;
public System.Windows.Forms.TextBox txtInput;
private ConsoleControl.ConsoleControl terminalControl;
}
}

View file

@ -38,19 +38,9 @@ namespace Project_Ports
InitializeComponent();
}
private void Terminal_Load(object sender, EventArgs e)
private void terminalControl_Load(object sender, EventArgs e)
{
WindowManager wm = new WindowManager();
}
private void txtInput_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
TerminalAPI.RunCommand(txtInput, txtConsole);
e.SuppressKeyPress = true;
txtInput.Clear();
}
terminalControl.StartProcess("PortsTerminal.exe", "");
}
}
}

View file

@ -46,7 +46,16 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Hybrid|AnyCPU'">
<OutputPath>bin\Hybrid\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="ConsoleControl, Version=1.1.0.0, Culture=neutral, PublicKeyToken=7edd23586f5e297f, processorArchitecture=MSIL">
<HintPath>..\packages\ConsoleControl.1.1.0.0\lib\net40\ConsoleControl.dll</HintPath>
</Reference>
<Reference Include="ConsoleControlAPI, Version=1.1.0.0, Culture=neutral, PublicKeyToken=7c86b8a36b9c33e2, processorArchitecture=MSIL">
<HintPath>..\packages\ConsoleControl.1.1.0.0\lib\net40\ConsoleControlAPI.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@ -198,6 +207,7 @@
<EmbeddedResource Include="Storyline\Hijack2Terminal.resx">
<DependentUpon>Hijack2Terminal.cs</DependentUpon>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@ -219,6 +229,10 @@
<Project>{c1b21b60-7ccc-42fc-83aa-b41644faa952}</Project>
<Name>PortEngine</Name>
</ProjectReference>
<ProjectReference Include="..\PortsTerminal\PortsTerminal.csproj">
<Project>{51b19b80-b154-4efe-b838-fec598f9e6d9}</Project>
<Name>PortsTerminal</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.6.1">

View file

@ -12,7 +12,7 @@ namespace Project_Ports.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())));
@ -70,5 +70,17 @@ namespace Project_Ports.Properties {
this["hijacked2"] = 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;
}
}
}
}

View file

@ -14,5 +14,8 @@
<Setting Name="hijacked2" 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>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ConsoleControl" version="1.1.0.0" targetFramework="net461" />
</packages>