Add icons and improve version display

This commit is contained in:
Chord 2016-06-20 03:04:50 -04:00
parent fce71df0f3
commit 9f280093c2
11 changed files with 77 additions and 21 deletions

View file

@ -32,13 +32,15 @@
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.linkLabel1 = new System.Windows.Forms.LinkLabel(); this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.versionInfo = new System.Windows.Forms.TextBox(); this.versionInfo = new System.Windows.Forms.TextBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// okButton // okButton
// //
this.okButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.okButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.okButton.Location = new System.Drawing.Point(135, 107); this.okButton.Location = new System.Drawing.Point(135, 200);
this.okButton.Name = "okButton"; this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(75, 23); this.okButton.Size = new System.Drawing.Size(75, 23);
this.okButton.TabIndex = 25; this.okButton.TabIndex = 25;
@ -49,17 +51,17 @@
this.label1.Dock = System.Windows.Forms.DockStyle.Top; this.label1.Dock = System.Windows.Forms.DockStyle.Top;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.ForeColor = System.Drawing.SystemColors.ControlText; this.label1.ForeColor = System.Drawing.SystemColors.ControlText;
this.label1.Location = new System.Drawing.Point(9, 9); this.label1.Location = new System.Drawing.Point(9, 97);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(328, 23); this.label1.Size = new System.Drawing.Size(328, 23);
this.label1.TabIndex = 26; this.label1.TabIndex = 26;
this.label1.Text = "PS1 GameLauncher"; this.label1.Text = "PSForever Launcher";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// label2 // label2
// //
this.label2.Dock = System.Windows.Forms.DockStyle.Top; this.label2.Dock = System.Windows.Forms.DockStyle.Top;
this.label2.Location = new System.Drawing.Point(9, 32); this.label2.Location = new System.Drawing.Point(9, 120);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(328, 23); this.label2.Size = new System.Drawing.Size(328, 23);
this.label2.TabIndex = 27; this.label2.TabIndex = 27;
@ -70,7 +72,7 @@
// linkLabel1 // linkLabel1
// //
this.linkLabel1.Dock = System.Windows.Forms.DockStyle.Top; this.linkLabel1.Dock = System.Windows.Forms.DockStyle.Top;
this.linkLabel1.Location = new System.Drawing.Point(9, 55); this.linkLabel1.Location = new System.Drawing.Point(9, 143);
this.linkLabel1.Margin = new System.Windows.Forms.Padding(3, 5, 3, 5); this.linkLabel1.Margin = new System.Windows.Forms.Padding(3, 5, 3, 5);
this.linkLabel1.Name = "linkLabel1"; this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Padding = new System.Windows.Forms.Padding(0, 0, 0, 5); this.linkLabel1.Padding = new System.Windows.Forms.Padding(0, 0, 0, 5);
@ -85,7 +87,7 @@
// //
this.versionInfo.BorderStyle = System.Windows.Forms.BorderStyle.None; this.versionInfo.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.versionInfo.Dock = System.Windows.Forms.DockStyle.Top; this.versionInfo.Dock = System.Windows.Forms.DockStyle.Top;
this.versionInfo.Location = new System.Drawing.Point(9, 77); this.versionInfo.Location = new System.Drawing.Point(9, 165);
this.versionInfo.Margin = new System.Windows.Forms.Padding(3, 10, 3, 10); this.versionInfo.Margin = new System.Windows.Forms.Padding(3, 10, 3, 10);
this.versionInfo.Name = "versionInfo"; this.versionInfo.Name = "versionInfo";
this.versionInfo.ReadOnly = true; this.versionInfo.ReadOnly = true;
@ -95,16 +97,28 @@
this.versionInfo.Text = "Version 1.x.x.x"; this.versionInfo.Text = "Version 1.x.x.x";
this.versionInfo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.versionInfo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
// //
// pictureBox1
//
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Top;
this.pictureBox1.Image = global::PSLauncher.Properties.Resources.vector_logo_psforever;
this.pictureBox1.Location = new System.Drawing.Point(9, 9);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(328, 88);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 30;
this.pictureBox1.TabStop = false;
//
// About // About
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(346, 142); this.ClientSize = new System.Drawing.Size(346, 235);
this.Controls.Add(this.versionInfo); this.Controls.Add(this.versionInfo);
this.Controls.Add(this.linkLabel1); this.Controls.Add(this.linkLabel1);
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Controls.Add(this.okButton); this.Controls.Add(this.okButton);
this.Controls.Add(this.pictureBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
@ -113,7 +127,8 @@
this.ShowIcon = false; this.ShowIcon = false;
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "About PS1 GameLauncher"; this.Text = "About PSForever Launcher";
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -126,5 +141,6 @@
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private System.Windows.Forms.LinkLabel linkLabel1; private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.TextBox versionInfo; private System.Windows.Forms.TextBox versionInfo;
private System.Windows.Forms.PictureBox pictureBox1;
} }
} }

View file

@ -15,6 +15,8 @@ namespace PSLauncher
{ {
InitializeComponent(); InitializeComponent();
this.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Application.ExecutablePath);
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location); FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
string version = fvi.FileVersion; string version = fvi.FileVersion;

View file

@ -304,7 +304,7 @@
this.MainMenuStrip = this.menuStrip1; this.MainMenuStrip = this.menuStrip1;
this.MinimumSize = new System.Drawing.Size(420, 350); this.MinimumSize = new System.Drawing.Size(420, 350);
this.Name = "LauncherForm"; this.Name = "LauncherForm";
this.Text = "PS1 GameLauncher"; this.Text = "PSForever Launcher";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.LauncherForm_FormClosing); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.LauncherForm_FormClosing);
this.ResizeBegin += new System.EventHandler(this.LauncherForm_ResizeBegin); this.ResizeBegin += new System.EventHandler(this.LauncherForm_ResizeBegin);
this.ResizeEnd += new System.EventHandler(this.LauncherForm_ResizeEnd); this.ResizeEnd += new System.EventHandler(this.LauncherForm_ResizeEnd);

View file

@ -52,6 +52,9 @@ namespace PSLauncher
public LauncherForm() public LauncherForm()
{ {
InitializeComponent(); InitializeComponent();
this.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Application.ExecutablePath);
#if DEBUG #if DEBUG
Settings.Default.Reset(); Settings.Default.Reset();
Console.SetOut(new Util.ControlWriter(this.ps_consoleOutput)); Console.SetOut(new Util.ControlWriter(this.ps_consoleOutput));

View file

@ -9,7 +9,7 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PSLauncher</RootNamespace> <RootNamespace>PSLauncher</RootNamespace>
<AssemblyName>PS1_GameLauncher</AssemblyName> <AssemblyName>PSForever_Launcher</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile> <TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
@ -131,15 +131,19 @@
<PropertyGroup> <PropertyGroup>
<TargetZone>LocalIntranet</TargetZone> <TargetZone>LocalIntranet</TargetZone>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup />
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<SignManifests>false</SignManifests> <SignManifests>false</SignManifests>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<SignAssembly>false</SignAssembly> <SignAssembly>false</SignAssembly>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resources\icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.VisualBasic" /> <Reference Include="Microsoft.VisualBasic" />
<Reference Include="Newtonsoft.Json"> <Reference Include="Newtonsoft.Json">
@ -227,6 +231,12 @@
<Install>true</Install> <Install>true</Install>
</BootstrapperPackage> </BootstrapperPackage>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="Resources\vector-logo-psforever.png" />
</ItemGroup>
<ItemGroup>
<Content Include="Resources\icon.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View file

@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("PS1 GameLauncher")] [assembly: AssemblyTitle("PSForever Launcher")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("PSForever")] [assembly: AssemblyCompany("PSForever.net")]
[assembly: AssemblyProduct("PS1 GameLauncher")] [assembly: AssemblyProduct("PSForever Launcher")]
[assembly: AssemblyCopyright("")] [assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]

View file

@ -59,5 +59,15 @@ namespace PSLauncher.Properties {
resourceCulture = value; resourceCulture = value;
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap vector_logo_psforever {
get {
object obj = ResourceManager.GetObject("vector-logo-psforever", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
} }
} }

View file

@ -117,4 +117,8 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="vector-logo-psforever" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\vector-logo-psforever.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View file

@ -20,6 +20,8 @@ namespace PSLauncher
{ {
InitializeComponent(); InitializeComponent();
this.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Application.ExecutablePath);
planetsidePathTextField.Text = Settings.Default.PSPath; planetsidePathTextField.Text = Settings.Default.PSPath;
launchArgs.Text = Settings.Default.ExtraArgs; launchArgs.Text = Settings.Default.ExtraArgs;
clearOnLaunch.Checked = Settings.Default.ClearOutputOnLaunch; clearOnLaunch.Checked = Settings.Default.ClearOutputOnLaunch;
@ -61,17 +63,26 @@ namespace PSLauncher
return false; return false;
} }
var versionInfo = FileVersionInfo.GetVersionInfo(path); var vi = FileVersionInfo.GetVersionInfo(path);
if (versionInfo.FileVersion != "") if (vi.FileVersion != "")
{ {
planetsideVersion.Text = "Version " + versionInfo.FileVersion; // TODO: add advanced version handling
int[] iParts = new int[4] { vi.FileMajorPart, vi.FileMinorPart, vi.FileBuildPart, vi.FilePrivatePart };
string[] parts = new string[4];
for(var i = 0; i < 4; i++)
{
parts[i] = iParts[i].ToString();
}
planetsideVersion.Text = "Version " + string.Join(".", parts);
planetsideVersion.ForeColor = System.Drawing.Color.Green; planetsideVersion.ForeColor = System.Drawing.Color.Green;
} }
else else
{ {
planetsideVersion.Text = "Unknown version"; planetsideVersion.Text = "Missing version";
planetsideVersion.ForeColor = System.Drawing.Color.Yellow; planetsideVersion.ForeColor = System.Drawing.Color.Red;
} }
return true; return true;