Skip to content

Commit

Permalink
Added state for changed song. Version set to 1.1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JustPaRcS committed Apr 5, 2020
1 parent 3b05561 commit 3d84897
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 17 deletions.
18 changes: 17 additions & 1 deletion PistolWhipModSelector/PistolWhipModSelector/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 25 additions & 3 deletions PistolWhipModSelector/PistolWhipModSelector/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ private void MainForm_Load(object sender, EventArgs e)
GlobalVariables.GetCustomSongFolderPath(audioLines[3].ID);

this.FillOriginalSongNamesList();
this.ChangeState("Ready", Color.Green);
}
private void ReloadAllButton_Click(object sender, EventArgs e)
{
Expand Down Expand Up @@ -123,6 +124,8 @@ private void OriginalSongNamesListBox_SelectedIndexChanged(object sender, EventA
CustomSongsReplaceButton.Enabled = true;
CustomSongsResetButton.Enabled = true;
ReloadAllButton.Enabled = true;

this.ChangeState("Ready", Color.Green);
}

private void CustomSongsDataGridView_DragDrop(object sender, DragEventArgs e)
Expand Down Expand Up @@ -181,10 +184,28 @@ private void CustomSongsEditButton_Click(object sender, EventArgs e)
}
}

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("https://github.com/JustPaRcS/PistolWhipModSelector");
}

private void CustomSongsDataGridView_SelectionChanged(object sender, EventArgs e)
{
this.ChangeState("Ready", Color.Green);
}

private void ReplaceSong(string destinationPath)
{
string targetPath = GlobalVariables.SongsFolderPath + "\\" + GlobalVariables.CurrentID + ".wem";
File.Copy(destinationPath, targetPath, true);
try
{
File.Copy(destinationPath, targetPath, true);
this.ChangeState("Finished replacing", Color.Green);
}
catch (IOException e)
{
this.ChangeState("Error: " + e.Message, Color.Red);
}
}

private string GetDestinationPath()
Expand All @@ -201,9 +222,10 @@ private string GetDestinationPath()
return null;
}

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
private void ChangeState(string text, Color color)
{
System.Diagnostics.Process.Start("https://github.com/JustPaRcS/PistolWhipModSelector");
CopyStateLabel.Text = text;
CopyStateLabel.ForeColor = color;
}
}
}
9 changes: 0 additions & 9 deletions PistolWhipModSelector/PistolWhipModSelector/MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,4 @@
<metadata name="songPath.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="songTitle.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="songAuthor.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="songPath.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
Expand All @@ -23,9 +24,9 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<ApplicationVersion>1.1.0.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand All @@ -47,6 +48,18 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>DDCD64778B74B9AF8DA937C0BC9034CE503115FD</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>PistolWhipModSelector_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down Expand Up @@ -118,6 +131,7 @@
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="ClassDiagram1.cd" />
<None Include="PistolWhipModSelector_TemporaryKey.pfx" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public PistolWhipModSettings()
this.CheckMainSettingsExist();

this.LoadXmlDoc();

this.UpdateVersion();
}

private void CheckMainSettingsFolderExist()
Expand Down Expand Up @@ -146,5 +148,16 @@ public string GetGameFolderPath()
XmlNode node = xmlDoc.SelectSingleNode("//PistolWhipModSettings/settings/gameFolderPath");
return node.InnerText;
}
public void UpdateVersion()
{
XmlNode node = xmlDoc.SelectSingleNode("//PistolWhipModSettings/info/version");
string version = Assembly.GetExecutingAssembly().GetName().Version.ToString();

if (node.InnerText != version)
{
node.InnerText = version;
this.SaveXmlDoc();
}
}
}
}

0 comments on commit 3d84897

Please sign in to comment.