Skip to content

Commit

Permalink
- added conditional check to Packer to ensure congruency between mani…
Browse files Browse the repository at this point in the history
…fest and arrangement data
  • Loading branch information
cozy1 committed Nov 13, 2017
1 parent 469b5fc commit 2e77549
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 113 deletions.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions RocksmithTookitGUI/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ private void EnableUpdate(object sender, RunWorkerCompletedEventArgs e)
//MessageBox.Show("ToolkitVersionOnline.UpdateAvailable: " + onlineVersion.UpdateAvailable + Environment.NewLine +
// "ToolkitVersionOnline.Revision: " + onlineVersion.Revision, "DEBUG ME");

// if (onlineVersion.UpdateAvailable) // || GeneralExtensions.IsInDesignMode)
if (true) // for testing
//if (true) // for debugging and testing
if (onlineVersion.UpdateAvailable || GeneralExtensions.IsInDesignMode)
{
btnUpdate.BackColor = Color.LightSteelBlue;
btnUpdate.FlatStyle = FlatStyle.Standard;
Expand Down
2 changes: 1 addition & 1 deletion RocksmithTookitGUI/RocksmithToolkitGUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@
<Link>VersionInfo.txt</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<EmbeddedResource Include="Resources\BetaInfo.rtf" />
<EmbeddedResource Include="BetaInfo.rtf" />
<Content Include="songcreator.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public ManifestFunctions(GameVersion gameVersion)

public void GenerateTechniques(Attributes2014 attribute, Song2014 song)
{
// results from this method do not match ODLC but are workable
// NOTE: results from this method do not match ODLC but are workable
//
//"Techniques" : {
// "DiffLevelID" : {//used to display which techs are set at current lvl.
Expand Down Expand Up @@ -535,17 +535,29 @@ public Int32 GetMaxDifficulty(Song2014 xml)

public void GenerateTuningData(Attributes2014 attribute, dynamic song)
{
// packer currently does very limited error checking (used mainly by advanced toolkit users)
// this is a good place to ensure manifest data is the same as song xml data
if (song.Version == "7")
{
if (song.CentOffset == null)
song.CentOffset = 0.0;

attribute.CentOffset = Convert.ToDouble(song.CentOffset);
}

if (song.Tuning == null)
return;
song.Tuning = new TuningStrings { String0 = 0, String1 = 0, String2 = 0, String3 = 0, String4 = 0, String5 = 0 };

attribute.Tuning = song.Tuning;

var tuning = new TuningDefinition();
var tuningName = tuning.NameFromStrings(attribute.Tuning);

if (tuningName == "E Standard")
attribute.ArrangementProperties.StandardTuning = 1;
else
attribute.ArrangementProperties.StandardTuning = 0;

}

public void GenerateChords(Attributes2014 attribute, Song2014 song)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class AttributesHeader2014
// apply conditional serialization to BassPick
public int BassPick { get; set; } // added to resolve issue #272
public decimal CapoFret { get; set; }
public double? CentOffset { get; set; }
public double? CentOffset { get; set; } // tuning frequency, see Cents2Frequency method
public bool DLC { get; set; }
public string DLCKey { get; set; } // <=> SongKey
public double? DNA_Chords { get; set; }
Expand Down
19 changes: 15 additions & 4 deletions RocksmithToolkitLib/PsarcLoader/PsarcPackager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,33 @@ public PsarcPackager(bool deleteOnClose = false)
_deleteOnClose = deleteOnClose;
}

public DLCPackageData ReadPackage(string inputPath, bool ignoreMultitoneEx = false)
/// <summary>
/// Unpacks and Reads DLCPackageData
/// </summary>
/// <param name="fixMultitoneEx">convert multi tones to single tone, prevents some in-game hangs</param>
/// <param name="fixLowBass">fix low bass tuning issues</param>
/// <param name="decodeAudio">converts wem to ogg files</param>
/// <returns>DLCPackageData</returns>
public DLCPackageData ReadPackage(string srcPath, bool fixMultitoneEx = false, bool fixLowBass = false, bool decodeAudio = false)
{
// UNPACK
packageDir = Packer.Unpack(inputPath, Path.GetTempPath(), true);
packageDir = Packer.Unpack(srcPath, Path.GetTempPath(), decodeAudio);

// REORGANIZE
packageDir = DLCPackageData.DoLikeProject(packageDir);

// LOAD DATA
DLCPackageData info = new DLCPackageData();
var packagePlatform = inputPath.GetPlatform();
info = DLCPackageData.LoadFromFolder(packageDir, packagePlatform, packagePlatform, ignoreMultitoneEx);
var packagePlatform = srcPath.GetPlatform();
info = DLCPackageData.LoadFromFolder(packageDir, packagePlatform, packagePlatform, fixMultitoneEx, fixLowBass);

return info;
}

/// <summary>
/// Repacks DLCPackage Data
/// </summary>
/// <param name="srcPath">if provided (optional) sets the Platform to same as source file</param>
public void WritePackage(string destPath, DLCPackageData packageData, string srcPath = "")
{
// if the srcPath does not exist GetPlatform returns 'None'
Expand Down
1 change: 1 addition & 0 deletions RocksmithToolkitLib/RocksmithToolkitLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@
</Content>
<Content Include="RocksmithToolkitLib.TuningDefinition.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<SubType>Designer</SubType>
</Content>
<Content Include="Resources\pedals.json" />
<Content Include="RocksmithToolkitLib.SongAppId.xml">
Expand Down
2 changes: 1 addition & 1 deletion RocksmithToolkitLib/Sng/Sng2014FileWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using MiscUtil.Conversion;
using CON = RocksmithToolkitLib.Sng.Constants;

// TODO: new phylosophy ... charting tweaks should be done in EOF by the charter
// TODO: new philosophy ... charting tweaks should be done in EOF by the charter

namespace RocksmithToolkitLib.Sng2014HSL
{
Expand Down
2 changes: 1 addition & 1 deletion VersionInfo.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
2.8.4.1
6463237b
469b5fc4
BETA

0 comments on commit 2e77549

Please sign in to comment.