Added server selection form

This commit is contained in:
Chord 2017-03-19 11:20:57 -04:00
parent 4320354a35
commit bf35d3aea1
9 changed files with 685 additions and 10 deletions

View file

@ -176,6 +176,12 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ServerList.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ServerList.Designer.cs">
<DependentUpon>ServerList.cs</DependentUpon>
</Compile>
<Compile Include="SettingsForm.cs">
<SubType>Form</SubType>
</Compile>
@ -199,6 +205,9 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="ServerList.resx">
<DependentUpon>ServerList.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SettingsForm.resx">
<DependentUpon>SettingsForm.cs</DependentUpon>
</EmbeddedResource>
@ -245,4 +254,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>

View file

@ -82,5 +82,31 @@ namespace PSLauncher.Properties {
this["ClearOutputOnLaunch"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool CoreCombat {
get {
return ((bool)(this["CoreCombat"]));
}
set {
this["CoreCombat"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<ArrayOfString xmlns:xsi=\"http://www.w3." +
"org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n <s" +
"tring>PSForever,play.psforever.net,51000</string>\r\n</ArrayOfString>")]
public global::System.Collections.Specialized.StringCollection ServerList {
get {
return ((global::System.Collections.Specialized.StringCollection)(this["ServerList"]));
}
set {
this["ServerList"] = value;
}
}
}
}

View file

@ -17,5 +17,14 @@
<Setting Name="ClearOutputOnLaunch" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="CoreCombat" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="ServerList" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;string&gt;PSForever,play.psforever.net,51000&lt;/string&gt;
&lt;/ArrayOfString&gt;</Value>
</Setting>
</Settings>
</SettingsFile>

237
PSLauncher/ServerList.Designer.cs generated Normal file
View file

@ -0,0 +1,237 @@
namespace PSLauncher
{
partial class ServerList
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ServerList));
this.serverDisplay = new System.Windows.Forms.ListBox();
this.moveUp = new System.Windows.Forms.Button();
this.moveDown = new System.Windows.Forms.Button();
this.hostnameInput = new System.Windows.Forms.TextBox();
this.portInput = new System.Windows.Forms.TextBox();
this.deleteItem = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.addButton = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.okButton = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label();
this.serverNameInput = new System.Windows.Forms.TextBox();
this.cancelButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// serverDisplay
//
this.serverDisplay.FormattingEnabled = true;
this.serverDisplay.Location = new System.Drawing.Point(13, 13);
this.serverDisplay.Name = "serverDisplay";
this.serverDisplay.Size = new System.Drawing.Size(272, 108);
this.serverDisplay.TabIndex = 0;
this.serverDisplay.SelectedIndexChanged += new System.EventHandler(this.serverDisplay_SelectedIndexChanged);
//
// moveUp
//
this.moveUp.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.moveUp.BackColor = System.Drawing.SystemColors.ButtonHighlight;
this.moveUp.Enabled = false;
this.moveUp.Image = ((System.Drawing.Image)(resources.GetObject("moveUp.Image")));
this.moveUp.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
this.moveUp.Location = new System.Drawing.Point(291, 13);
this.moveUp.Name = "moveUp";
this.moveUp.Size = new System.Drawing.Size(24, 26);
this.moveUp.TabIndex = 1;
this.moveUp.UseVisualStyleBackColor = false;
this.moveUp.Click += new System.EventHandler(this.moveUp_Click);
//
// moveDown
//
this.moveDown.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.moveDown.BackColor = System.Drawing.SystemColors.ButtonHighlight;
this.moveDown.Enabled = false;
this.moveDown.Image = ((System.Drawing.Image)(resources.GetObject("moveDown.Image")));
this.moveDown.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
this.moveDown.Location = new System.Drawing.Point(291, 44);
this.moveDown.Name = "moveDown";
this.moveDown.Size = new System.Drawing.Size(24, 26);
this.moveDown.TabIndex = 2;
this.moveDown.UseVisualStyleBackColor = false;
this.moveDown.Click += new System.EventHandler(this.moveDown_Click);
//
// hostnameInput
//
this.hostnameInput.Location = new System.Drawing.Point(11, 207);
this.hostnameInput.Name = "hostnameInput";
this.hostnameInput.Size = new System.Drawing.Size(144, 20);
this.hostnameInput.TabIndex = 3;
this.hostnameInput.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textInput_KeyPress);
//
// portInput
//
this.portInput.Location = new System.Drawing.Point(168, 207);
this.portInput.Name = "portInput";
this.portInput.Size = new System.Drawing.Size(50, 20);
this.portInput.TabIndex = 4;
this.portInput.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.portInput_KeyPress);
//
// deleteItem
//
this.deleteItem.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.deleteItem.BackColor = System.Drawing.SystemColors.ButtonHighlight;
this.deleteItem.Enabled = false;
this.deleteItem.Image = ((System.Drawing.Image)(resources.GetObject("deleteItem.Image")));
this.deleteItem.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
this.deleteItem.Location = new System.Drawing.Point(291, 95);
this.deleteItem.Name = "deleteItem";
this.deleteItem.Size = new System.Drawing.Size(24, 26);
this.deleteItem.TabIndex = 5;
this.deleteItem.UseVisualStyleBackColor = false;
this.deleteItem.Click += new System.EventHandler(this.deleteItem_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(8, 185);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(70, 13);
this.label1.TabIndex = 6;
this.label1.Text = "Hostname/IP";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(165, 185);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(26, 13);
this.label2.TabIndex = 7;
this.label2.Text = "Port";
//
// addButton
//
this.addButton.Location = new System.Drawing.Point(230, 205);
this.addButton.Name = "addButton";
this.addButton.Size = new System.Drawing.Size(42, 23);
this.addButton.TabIndex = 8;
this.addButton.Text = "Add";
this.addButton.UseVisualStyleBackColor = true;
this.addButton.Click += new System.EventHandler(this.addButton_Click);
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(157, 210);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(10, 13);
this.label3.TabIndex = 9;
this.label3.Text = ":";
//
// okButton
//
this.okButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.okButton.Location = new System.Drawing.Point(93, 239);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(62, 23);
this.okButton.TabIndex = 28;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(9, 131);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(69, 13);
this.label4.TabIndex = 30;
this.label4.Text = "Server Name";
//
// serverNameInput
//
this.serverNameInput.Location = new System.Drawing.Point(12, 153);
this.serverNameInput.Name = "serverNameInput";
this.serverNameInput.Size = new System.Drawing.Size(206, 20);
this.serverNameInput.TabIndex = 29;
this.serverNameInput.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textInput_KeyPress);
//
// cancelButton
//
this.cancelButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.cancelButton.Location = new System.Drawing.Point(173, 239);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(62, 23);
this.cancelButton.TabIndex = 31;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// ServerList
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(327, 274);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.label4);
this.Controls.Add(this.serverNameInput);
this.Controls.Add(this.okButton);
this.Controls.Add(this.label3);
this.Controls.Add(this.addButton);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.deleteItem);
this.Controls.Add(this.portInput);
this.Controls.Add(this.hostnameInput);
this.Controls.Add(this.moveDown);
this.Controls.Add(this.moveUp);
this.Controls.Add(this.serverDisplay);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ServerList";
this.Text = "Server List";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ListBox serverDisplay;
private System.Windows.Forms.Button moveUp;
private System.Windows.Forms.Button moveDown;
private System.Windows.Forms.TextBox hostnameInput;
private System.Windows.Forms.TextBox portInput;
private System.Windows.Forms.Button deleteItem;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button addButton;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox serverNameInput;
private System.Windows.Forms.Button cancelButton;
}
}

196
PSLauncher/ServerList.cs Normal file
View file

@ -0,0 +1,196 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PSLauncher.Properties;
using System.Collections.Specialized;
using System.Diagnostics;
namespace PSLauncher
{
public partial class ServerList : Form
{
struct ServerEntry
{
public string name;
public string hostname;
public int port;
}
List<ServerEntry> entries = new List<ServerEntry>();
public ServerList()
{
InitializeComponent();
this.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Application.ExecutablePath);
StringCollection serverList = Settings.Default.ServerList;
foreach(String entry in serverList)
{
String [] tokens = entry.Split(',');
if(tokens.Length != 3)
{
Debug.WriteLine("Failed to load server entry " + entry);
continue;
}
ServerEntry newEntry = new ServerEntry();
newEntry.name = tokens[0];
newEntry.hostname = tokens[1];
newEntry.port = int.Parse(tokens[2]);
addEntry(newEntry);
}
}
private void textInput_KeyPress(object sender, KeyPressEventArgs e)
{
TextBox control = sender as TextBox;
// disallow commas as they are used for tokenizing
if(e.KeyChar == ',')
{
e.Handled = true;
}
else
{
e.Handled = false;
}
}
private void portInput_KeyPress(object sender, KeyPressEventArgs e)
{
Debug.WriteLine("Char: " + e.KeyChar.ToString());
if(e.KeyChar >= '0' && e.KeyChar <= '9' || e.KeyChar == '\b')
{
if(portInput.Text.Length >= 5 && e.KeyChar != '\b')
e.Handled = true;
else
e.Handled = false;
}
else
{
e.Handled = true;
}
}
private void addButton_Click(object sender, EventArgs e)
{
if (hostnameInput.Text.Length == 0 || serverNameInput.Text.Length == 0
|| portInput.Text.Length == 0)
return;
// validate server entry fields
ServerEntry entry = new ServerEntry();
entry.name = serverNameInput.Text;
entry.hostname = hostnameInput.Text;
entry.port = Convert.ToInt32(portInput.Text);
// add the entry to the top of the list
addEntry(entry, 0);
}
private void addEntry(ServerEntry entry, int position=-1)
{
if (position == -1)
position = entries.Count;
entries.Insert(position, entry);
serverDisplay.Items.Insert(position, entry.name + " - " + entry.hostname + ":" + entry.port);
}
private void okButton_Click(object sender, EventArgs e)
{
StringCollection serverList = new StringCollection();
foreach (ServerEntry entry in entries)
{
string[] tokens = new string[3];
tokens[0] = entry.name;
tokens[1] = entry.hostname;
tokens[2] = Convert.ToString(entry.port);
serverList.Add(string.Join(",", tokens));
}
Settings.Default.ServerList = serverList;
this.DialogResult = DialogResult.OK;
}
private void cancelButton_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
private void moveUp_Click(object sender, EventArgs e)
{
int selected = serverDisplay.SelectedIndex;
Debug.WriteLine("Move " + selected + " ^");
if (selected == -1 || selected == 0)
return;
entries.Insert(selected - 1, entries[selected]);
serverDisplay.Items.Insert(selected - 1, serverDisplay.Items[selected]);
entries.RemoveAt(selected+1);
serverDisplay.Items.RemoveAt(selected+1);
serverDisplay.SelectedIndex = selected - 1;
}
private void moveDown_Click(object sender, EventArgs e)
{
int selected = serverDisplay.SelectedIndex;
Debug.WriteLine("Move " + selected + " v");
if (selected == -1 || (selected+1) == entries.Count)
return;
entries.Insert(selected + 2, entries[selected]);
serverDisplay.Items.Insert(selected + 2, serverDisplay.Items[selected]);
entries.RemoveAt(selected);
serverDisplay.Items.RemoveAt(selected);
serverDisplay.SelectedIndex = selected + 1;
}
private void deleteItem_Click(object sender, EventArgs e)
{
int selected = serverDisplay.SelectedIndex;
entries.RemoveAt(selected);
serverDisplay.Items.RemoveAt(selected);
if(entries.Count > 0)
{
if(selected >= entries.Count)
{
serverDisplay.SelectedIndex = selected-1;
}
else
{
serverDisplay.SelectedIndex = selected;
}
}
}
private void serverDisplay_SelectedIndexChanged(object sender, EventArgs e)
{
moveDown.Enabled = moveUp.Enabled = deleteItem.Enabled = serverDisplay.SelectedIndex != -1;
}
}
}

147
PSLauncher/ServerList.resx Normal file
View file

@ -0,0 +1,147 @@
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="moveUp.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGwAAAJlJREFUOE+lktENgCAMRJmN4VjDLfmttmnJXalR4yWXUOQ9E6WJyK/ykDLnPLQ+
rhBDA8Rh8ZKEGBo8AY8xrFlCDA1XEO69W7OEGBwquJIgkwUlHA0JMpsAD1frV4J4E0IheRQEnAX4DJlN
4LWPmQTrXiBTCexX6RoFvmcSZLJgXZZKoNEzyJAAcyfQEEMDRCGsb1uIweF7pZ0wbIqJ5IDpuQAAAABJ
RU5ErkJggg==
</value>
</data>
<data name="moveDown.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGwAAAKFJREFUOE+lkUEKwzAMBPM2P87f6C99dbPCKrOKS1K6IGI5O0NpjjnnX+MLMsaY
nHUdMcYWRFBrLeax4Cy+VuerQB0yVaBySHYCvdOZzE4QEj0pyDsNmYug955AFXzekbkIBGSRAt3lmcxW
kJLd+VbAcp38ZWSqIP6onSRhdciYgJ+KEsLqGGPLCiUVVoyxBUlJhRVjbClZEoMVY7j8PvN4A80ziomU
990nAAAAAElFTkSuQmCC
</value>
</data>
<data name="deleteItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGwAAAIZJREFUOE+1j10KwCAMgz2b755xl/IsvnaL2K20UfbDAmEako+ZROSTafjE12Go
tbbB43rK5xSAQq1VYFtmeQBoqZTSreVZvgTknM8yyyjA/qodsDF9gspD2Bj6B+DH+NqzhQQAG+POMnSX
AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC
</value>
</data>
</root>

View file

@ -37,6 +37,8 @@
this.findPTRDirDialogue = new System.Windows.Forms.FolderBrowserDialog();
this.clearOnLaunch = new System.Windows.Forms.CheckBox();
this.button1 = new System.Windows.Forms.Button();
this.coreCombat = new System.Windows.Forms.CheckBox();
this.editServerList = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label2
@ -58,10 +60,10 @@
this.selectDirectory.UseVisualStyleBackColor = true;
this.selectDirectory.Click += new System.EventHandler(this.button1_Click);
//
// planetside2PathTextField
// planetsidePathTextField
//
this.planetsidePathTextField.Location = new System.Drawing.Point(12, 33);
this.planetsidePathTextField.Name = "planetside2PathTextField";
this.planetsidePathTextField.Name = "planetsidePathTextField";
this.planetsidePathTextField.ReadOnly = true;
this.planetsidePathTextField.Size = new System.Drawing.Size(222, 20);
this.planetsidePathTextField.TabIndex = 8;
@ -69,7 +71,7 @@
//
// launchArgs
//
this.launchArgs.Location = new System.Drawing.Point(12, 117);
this.launchArgs.Location = new System.Drawing.Point(10, 182);
this.launchArgs.Name = "launchArgs";
this.launchArgs.Size = new System.Drawing.Size(222, 20);
this.launchArgs.TabIndex = 15;
@ -78,7 +80,7 @@
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(9, 98);
this.label10.Location = new System.Drawing.Point(7, 163);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(158, 13);
this.label10.TabIndex = 16;
@ -96,7 +98,7 @@
// clearOnLaunch
//
this.clearOnLaunch.AutoSize = true;
this.clearOnLaunch.Location = new System.Drawing.Point(13, 157);
this.clearOnLaunch.Location = new System.Drawing.Point(12, 123);
this.clearOnLaunch.Name = "clearOnLaunch";
this.clearOnLaunch.Size = new System.Drawing.Size(133, 17);
this.clearOnLaunch.TabIndex = 26;
@ -107,7 +109,7 @@
// button1
//
this.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.button1.Location = new System.Drawing.Point(91, 186);
this.button1.Location = new System.Drawing.Point(91, 226);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(62, 23);
this.button1.TabIndex = 27;
@ -115,11 +117,34 @@
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click_1);
//
// coreCombat
//
this.coreCombat.AutoSize = true;
this.coreCombat.Location = new System.Drawing.Point(12, 98);
this.coreCombat.Name = "coreCombat";
this.coreCombat.Size = new System.Drawing.Size(87, 17);
this.coreCombat.TabIndex = 28;
this.coreCombat.Text = "Core Combat";
this.coreCombat.UseVisualStyleBackColor = true;
this.coreCombat.CheckedChanged += new System.EventHandler(this.coreCombat_CheckedChanged);
//
// editServerList
//
this.editServerList.Location = new System.Drawing.Point(134, 94);
this.editServerList.Name = "editServerList";
this.editServerList.Size = new System.Drawing.Size(100, 23);
this.editServerList.TabIndex = 29;
this.editServerList.Text = "Edit Server List...";
this.editServerList.UseVisualStyleBackColor = true;
this.editServerList.Click += new System.EventHandler(this.editServerList_Click);
//
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(244, 211);
this.ClientSize = new System.Drawing.Size(244, 251);
this.Controls.Add(this.editServerList);
this.Controls.Add(this.coreCombat);
this.Controls.Add(this.planetsideVersion);
this.Controls.Add(this.button1);
this.Controls.Add(this.clearOnLaunch);
@ -130,9 +155,9 @@
this.Controls.Add(this.planetsidePathTextField);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(260, 250);
this.MaximumSize = new System.Drawing.Size(260, 290);
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(260, 250);
this.MinimumSize = new System.Drawing.Size(260, 290);
this.Name = "SettingsForm";
this.Text = "Settings";
this.ResumeLayout(false);
@ -151,5 +176,7 @@
private System.Windows.Forms.FolderBrowserDialog findPTRDirDialogue;
private System.Windows.Forms.CheckBox clearOnLaunch;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.CheckBox coreCombat;
private System.Windows.Forms.Button editServerList;
}
}

View file

@ -25,6 +25,7 @@ namespace PSLauncher
planetsidePathTextField.Text = Settings.Default.PSPath;
launchArgs.Text = Settings.Default.ExtraArgs;
clearOnLaunch.Checked = Settings.Default.ClearOutputOnLaunch;
coreCombat.Checked = Settings.Default.CoreCombat;
checkPath(Path.Combine(planetsidePathTextField.Text, PS_EXE_NAME), false);
}
@ -105,5 +106,17 @@ namespace PSLauncher
{
this.DialogResult = DialogResult.OK;
}
private void coreCombat_CheckedChanged(object sender, EventArgs e)
{
Settings.Default.CoreCombat = this.coreCombat.Checked;
}
private void editServerList_Click(object sender, EventArgs e)
{
ServerList a = new ServerList();
a.StartPosition = FormStartPosition.CenterParent;
a.ShowDialog(this);
}
}
}

View file

@ -22,6 +22,17 @@
<setting name="ClearOutputOnLaunch" serializeAs="String">
<value>True</value>
</setting>
<setting name="CoreCombat" serializeAs="String">
<value>True</value>
</setting>
<setting name="ServerList" serializeAs="Xml">
<value>
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<string>PSForever,play.psforever.net,51000</string>
</ArrayOfString>
</value>
</setting>
</PSLauncher.Properties.Settings>
</userSettings>
</configuration>