Skip to content

Commit

Permalink
Fixed non scaleable songsTreeView. Added section count on songsTreeVi…
Browse files Browse the repository at this point in the history
…ew sections. Fixed bug where file that is not found result in crashing.
  • Loading branch information
JustPaRcS committed Aug 31, 2021
1 parent 0223e4d commit 26b0c79
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.

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

6 changes: 4 additions & 2 deletions PistolWhipModSelector/PistolWhipModSelector/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using PistolWhipModSelector.Settings;
using PistolWhipModSelector.SaveOriginalFiles;
using System.IO;
using System.Reflection;

namespace PistolWhipModSelector
{
Expand All @@ -22,6 +23,7 @@ public MainForm(ModsFolder modsFolder)
{
this.modsFolder = modsFolder;
InitializeComponent();
this.Text = "Pistol Whip Custom Songs v" + Assembly.GetExecutingAssembly().GetName().Version.ToString();
}

private void MainForm_Load(object sender, EventArgs e)
Expand Down Expand Up @@ -82,7 +84,7 @@ private void FillOriginalSongNamesList()
newNode.Tag = properties.ID;
foreach (TreeNode node in songsTreeView.Nodes)
{
if (node.Text == properties.AudioSectionName)
if (node.Text.StartsWith(properties.AudioSectionName))
{
node.Nodes.Add(newNode);
found = true;
Expand All @@ -91,7 +93,7 @@ private void FillOriginalSongNamesList()
}
if (!found)
{
TreeNode newSection = new TreeNode(properties.AudioSectionName);
TreeNode newSection = new TreeNode(properties.AudioSectionName + " (" + audioLines.Where(x=> x.AudioSectionName == properties.AudioSectionName).Count() + ")");

newSection.Nodes.Add(newNode);
songsTreeView.Nodes.Add(newSection);
Expand Down
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 @@ -24,7 +24,7 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.4.0.0</ApplicationVersion>
<ApplicationVersion>1.4.1.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
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.4.0.0")]
[assembly: AssemblyFileVersion("1.4.0.0")]
[assembly: AssemblyVersion("1.4.1.0")]
[assembly: AssemblyFileVersion("1.4.1.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ private List<AudioLineProperties> GetAudioLines(bool tryAgain = false)
if (memoryAudioSectionFound && !String.IsNullOrWhiteSpace(line) && line.Contains("\\Music\\") && !line.Contains("sfx_") && !line.Contains("\\TestContent\\") && !line.Contains("mus_landing_area_lp") && !line.Contains("mus_tutorial") && !line.Contains("visualizer"))
{
AudioLineProperties currentAudioLine = this.TrimAudioLines(line);
if(!audios.Exists(x=> x.ID == currentAudioLine.ID))
audios.Add(currentAudioLine);
if (!audios.Exists(x => x.ID == currentAudioLine.ID))
{
if (File.Exists(GlobalVariables.SongsFolderPath + @"\" + currentAudioLine.ID + ".wem")){
audios.Add(currentAudioLine);
}
}
}
else
{
Expand Down

0 comments on commit 26b0c79

Please sign in to comment.