Skip to content
Permalink
Browse files

- fixed LoadFromFolder custom font handling

- improved arrangement detection/validation
- improvements to Xbox360 GameVersion detection
- added optionalProperties metadata to Song2014 xml for Japanese Artist and Song
  • Loading branch information
cozy1 committed Nov 13, 2019
1 parent 3745126 commit fa63cc4e0075e62c28608ecf2074178ebbab8f59
Showing with 623 additions and 476 deletions.
  1. +0 −18 RocksmithTookitGUI/Config/ConfigGlobals.cs
  2. +19 −0 RocksmithTookitGUI/Config/GlobalsConfig.cs
  3. +18 −52 RocksmithTookitGUI/DLCPackageCreator/ArrangementForm.cs
  4. +207 −207 RocksmithTookitGUI/DLCPackageCreator/DLCPackageCreator.Designer.cs
  5. +42 −20 RocksmithTookitGUI/DLCPackageCreator/DLCPackageCreator.cs
  6. +0 −3 RocksmithTookitGUI/DLCPackageCreator/DLCPackageCreator.resx
  7. +4 −4 RocksmithTookitGUI/DLCPackageCreator/ToneForm.cs
  8. +1 −1 RocksmithTookitGUI/DLCPackageCreator/VocalsForm.cs
  9. +3 −1 RocksmithTookitGUI/DLCPackerUnpacker/DLCPackerUnpacker.Designer.cs
  10. +9 −9 RocksmithTookitGUI/DLCPackerUnpacker/DLCPackerUnpacker.cs
  11. +4 −1 RocksmithTookitGUI/DLCPackerUnpacker/DLCPackerUnpacker.resx
  12. +1 −1 RocksmithTookitGUI/MainForm.cs
  13. +31 −31 RocksmithTookitGUI/Program.cs
  14. +2 −2 RocksmithTookitGUI/Properties/AssemblyInfo.cs
  15. +4 −0 RocksmithTookitGUI/ReleaseNotes.txt
  16. +1 −1 RocksmithTookitGUI/RocksmithToolkitGUI.csproj
  17. +2 −2 RocksmithToolkitGUI.Tests/DDCTest.cs
  18. +2 −2 RocksmithToolkitGUI.Tests/DLCPackageCreatorTest.cs
  19. +2 −2 RocksmithToolkitGUI.Tests/DLCPackerUnpackerTest.cs
  20. +4 −1 RocksmithToolkitLib.Tests/Resources/HowToUnitTest.txt
  21. +3 −2 RocksmithToolkitLib/DLCPackage/AggregateGraph2014/AggregateGraph2014.cs
  22. +2 −2 RocksmithToolkitLib/DLCPackage/Arrangement.cs
  23. +1 −1 RocksmithToolkitLib/DLCPackage/DLCPackageCreator.cs
  24. +8 −7 RocksmithToolkitLib/DLCPackage/DLCPackageData.cs
  25. +11 −7 RocksmithToolkitLib/DLCPackage/Manifest2014/Header/AttributesHeader2014.cs
  26. +112 −82 RocksmithToolkitLib/DLCPackage/Packer.cs
  27. +2 −0 RocksmithToolkitLib/DLCPackage/SongInfo.cs
  28. +5 −3 RocksmithToolkitLib/Extensions/GeneralExtension.cs
  29. +8 −0 RocksmithToolkitLib/GlobalsLib.cs
  30. +39 −1 RocksmithToolkitLib/Ogg/WemFile.cs
  31. +2 −2 RocksmithToolkitLib/Properties/AssemblyInfo.cs
  32. +2 −1 RocksmithToolkitLib/RocksmithToolkitLib.csproj
  33. +1 −0 RocksmithToolkitLib/Sng/Sng2014FileWriter.cs
  34. +2 −3 RocksmithToolkitLib/Sng/SngFileWriter.cs
  35. +2 −2 RocksmithToolkitLib/XML/GlyphDefinitions.cs
  36. +63 −1 RocksmithToolkitLib/XML/Song2014.cs
  37. +2 −2 RocksmithToolkitUpdater/Properties/AssemblyInfo.cs
  38. +2 −2 VersionInfo.txt

This file was deleted.

@@ -0,0 +1,19 @@
using NLog;
namespace RocksmithToolkitGUI.Config
{
public static class GlobalsConfig
{
public static string DefaultToneFile { get; set; }
public static string DefaultProjectFolder { get; set; }
public static Logger Log { get; set; }
}

}

// CODE GRAVE YARD

// override destination platform using GeneralConfig settings
// var defaultGameVersion = (GameVersion)Enum.Parse(typeof(GameVersion), ConfigRepository.Instance()["general_defaultgameversion"]);
// var defaultPlatform = (GamePlatform)Enum.Parse(typeof(GamePlatform), ConfigRepository.Instance()["general_defaultplatform"]);
// var destPlatform = new Platform(defaultPlatform, defaultGameVersion);

@@ -194,7 +194,7 @@ private set
var diaMsg = "Invalid Arrangement Default/Bonus/Alternate Conditon ... " + Environment.NewLine + Environment.NewLine +
"Toolkit will reset the arrangement to" + Environment.NewLine +
"the default represent condition." + Environment.NewLine;
BetterDialog2.ShowDialog(diaMsg, "Arrangement Represent ...", null, null, "OK", Bitmap.FromHicon(SystemIcons.Warning.Handle), "Warning", 150, 150);
BetterDialog2.ShowDialog(diaMsg, "Arrangement Represent", null, null, "OK", Bitmap.FromHicon(SystemIcons.Warning.Handle), "Warning", 150, 150);
value.Represent = true;
value.BonusArr = false;
}
@@ -342,34 +342,20 @@ public void LoadArrangementData(string xmlFilePath)
Arrangement.MasterId = masterId;
}

private static ArrangementType DetectArrangementType(string filename)
{
using (XmlReader reader = XmlReader.Create(filename))
{
reader.MoveToContent();
if (reader.LocalName == "vocals")
return ArrangementType.Vocal;
if (reader.LocalName == "showlights")
return ArrangementType.ShowLight;

// Return guitar for everything else
return ArrangementType.Guitar;
}
}

public bool AddXmlArrangement(string xmlFilePath)
{
// only use this method when adding new arrangements
if (EditMode)
return false;

Arrangement = new Arrangement
{
SongFile = new SongFile { File = "" },
SongXml = new SongXML { File = xmlFilePath }
};
Arrangement = new Arrangement { SongFile = new SongFile { File = "" }, SongXml = new SongXML { File = xmlFilePath } };

ArrangementType arrType = DetectArrangementType(xmlFilePath);
ArrangementType arrType = Song2014.DetectArrangementType(xmlFilePath);
if (arrType == ArrangementType.Unknown)
{
BetterDialog2.ShowDialog("Unknown Arrangement Type" + Environment.NewLine + "Could not add file: " + Path.GetFileName(xmlFilePath), "Invalid Arrangement", null, null, "OK", Bitmap.FromHicon(SystemIcons.Warning.Handle), "Warning", 150, 150);
return false;
}

// SETUP FIELDS
if (arrType == ArrangementType.Vocal)
@@ -382,39 +368,20 @@ public bool AddXmlArrangement(string xmlFilePath)
|| xmlFilePath.IndexOf("jlyric", StringComparison.OrdinalIgnoreCase) >= 0)
{
cmbArrangementName.SelectedItem = ArrangementName.JVocals;

//// Try to find a custom font dds file
//var projectDir = Path.GetDirectoryName(xmlFilePath);
//// e.g. path D:\\Temp\RS Root\dlc\Nanase-Aikawa_Yumemiru-Shoujo-ja-Irarenai_v2_RS2014_Pc\EOF\innayumemirushoujojairarenai_jvocals.xml
//if (Path.GetFileName(projectDir).Equals("EOF"))
// projectDir = Path.GetDirectoryName(projectDir);

//var customFontPath = Directory.EnumerateFiles(projectDir, "*.dds", SearchOption.AllDirectories)
// .Where(fn => Path.GetFileName(fn).Equals("lyrics.dds") || Path.GetFileName(fn).StartsWith("lyrics_")).FirstOrDefault();

//if (!String.IsNullOrEmpty(customFontPath))
// Arrangement.LyricArt = customFontPath;
}
else
{
cmbArrangementName.SelectedItem = ArrangementName.Vocals;
}
}
else if (arrType == ArrangementType.ShowLight)
{
cmbArrangementType.SelectedItem = ArrangementType.ShowLight;
Arrangement.ArrangementType = ArrangementType.ShowLight;
}
else // add Instrument Arrangement
else // Instrument Arrangements (Bass and Guitar)
{
try
{
_song2014 = Song2014.LoadFromFile(xmlFilePath);
}
catch (Exception ex)
{
BetterDialog2.ShowDialog("Could not add file to Arrangements: " + Path.GetFileName(xmlFilePath) + Environment.NewLine +
ex.InnerException.Message, "Invalid Instrument Arrangement", null, null, "OK", Bitmap.FromHicon(SystemIcons.Warning.Handle), "Warning", 150, 150);
return false;
}
_song2014 = Song2014.LoadFromFile(xmlFilePath);

if (_song2014 == null)
return false;
@@ -455,11 +422,10 @@ public bool AddXmlArrangement(string xmlFilePath)
}
}

// SONG AND ARRANGEMENT INFO / ROUTE MASK
// DECIPHER CORRECT ROUTE MASK
var arr = _song2014.Arrangement.ToLowerInvariant();

// TODO: monitor this code
if (arr.Contains("guitar") || arr.Contains("lead") || arr.Contains("rhythm") || arr.Contains("combo"))
if (arrType == ArrangementType.Guitar)
{
cmbArrangementType.SelectedItem = ArrangementType.Guitar;
Arrangement.ArrangementType = ArrangementType.Guitar;
@@ -483,7 +449,7 @@ public bool AddXmlArrangement(string xmlFilePath)
RouteMask = RouteMask.Rhythm;
}
}
else if (arr.Contains("bass"))
else if (arrType == ArrangementType.Bass) //(arr.Contains("bass"))
{
cmbArrangementType.SelectedItem = ArrangementType.Bass;
Arrangement.ArrangementType = ArrangementType.Bass;
@@ -1049,15 +1015,15 @@ private void btnBrowseXml_Click(object sender, EventArgs e)
{
using (var ofd = new OpenFileDialog())
{
ofd.InitialDirectory = ConfigGlobals.DefaultProjectFolder;
ofd.InitialDirectory = GlobalsConfig.DefaultProjectFolder;
ofd.Filter = "Rocksmith EOF XML Files (*.xml)|*.xml";
if (ofd.ShowDialog() != DialogResult.OK)
{
return;
}

XmlPath = ofd.FileName;
ConfigGlobals.DefaultProjectFolder = Path.GetDirectoryName(XmlPath);
GlobalsConfig.DefaultProjectFolder = Path.GetDirectoryName(XmlPath);

if (IsAlreadyAdded(XmlPath))
{
@@ -1125,7 +1091,7 @@ private void btnOk_Click(object sender, EventArgs e)
return;

LoadArrangementData(XmlPath);
ConfigGlobals.DefaultProjectFolder = Path.GetDirectoryName(XmlPath);
GlobalsConfig.DefaultProjectFolder = Path.GetDirectoryName(XmlPath);
DialogResult = DialogResult.OK;
Close();
}

0 comments on commit fa63cc4

Please sign in to comment.
You can’t perform that action at this time.