Skip to content
Permalink
Browse files
- improved error checking in CDLC Creator
- fixed issues with the way CDCL Creator handles jvocal repackaging
- improved compatibility with CustomFontGenerator (special thanks to iminashi)
  • Loading branch information
cozy1 committed Nov 1, 2019
1 parent dc9ace6 commit 374512640249fccdd5f829e9f977e2d67c732ae8
Show file tree
Hide file tree
Showing 37 changed files with 832 additions and 349 deletions.
@@ -2,10 +2,10 @@ param([string]$Assembly_File)

$content = [IO.File]::ReadAllText($Assembly_File)

$regexAIV = new-object System.Text.RegularExpressions.Regex ('(AssemblyInformationalVersion(Attribute)?\s*\(\s*\")(.*)(\"\s*\))',
$regexAV = new-object System.Text.RegularExpressions.Regex ('(AssemblyVersion(Attribute)?\s*\(\s*\")(.*)(\"\s*\))',
[System.Text.RegularExpressions.RegexOptions]::MultiLine)

$regexAV = new-object System.Text.RegularExpressions.Regex ('(AssemblyVersion(Attribute)?\s*\(\s*\")(.*)(\"\s*\))',
$regexAIV = new-object System.Text.RegularExpressions.Regex ('(AssemblyInformationalVersion(Attribute)?\s*\(\s*\")(.*)(\"\s*\))',
[System.Text.RegularExpressions.RegexOptions]::MultiLine)

$regexAC = new-object System.Text.RegularExpressions.Regex ('(AssemblyConfiguration(Attribute)?\s*\(\s*\")(.*)(\"\s*\))',
@@ -15,23 +15,25 @@ $regexAC = new-object System.Text.RegularExpressions.Regex ('(AssemblyConfigurat
$env:GIT_HASH = $env:APPVEYOR_REPO_COMMIT.Substring(0, 8)
$Assembly_Informational_Version = "$env:GIT_HASH"

# NOTE TO DEVS
# Manually edit the '$AssemblyVersion' and '$AssemblyConfiguration' values here
# before committing a major revisions/releases to github
# these will be automatically applied to all AssemblyInfo.cs files by AppVeyor ...
# Manually edit the '$AssemblyVersion', and '$AssemblyConfiguration' values here as needed
# before committing a major new revisions/releases to github after all testing is completed
# these will be automatically applied to the AssemblyInfo.cs files by AppVeyor ...
$Assembly_Version = "2.9.2.1"

# $AssemblyConfiguration = "BUILD", "BETA", "RELEASE", or (any other string)
# $AssemblyConfiguration = $env:APPVEYOR_REPO_COMMIT_TIMESTAMP.Substring(0,19)
# default usage is for sortable ISO8601 DateTime
# $AssemblyConfiguration = $env:APPVEYOR_REPO_COMMIT_TIMESTAMP.Substring(0,19)
$Assembly_Configuration = $env:APPVEYOR_REPO_COMMIT_TIMESTAMP.Substring(0,19)

# appveyor console output
Write-Host "- Patching: $Assembly_File"
Write-Host "- AssemblyVersion: $Assembly_Version"
Write-Host "- AssemblyInformationVersion: $env:GIT_HASH"
Write-Host "- AssemblyVersion: $Assembly_Configuration"
Write-Host "- AssemblyInformationVersion: $Assembly_Informational_Version"
Write-Host "- AssemblyConfiguration: $Assembly_Configuration"

# update assembly info
$content = $regexAC.Replace($content, '${1}' + $Assembly_Configuration + '${4}')
$content = $regexAIV.Replace($content, '${1}' + $Assembly_Informational_Version + '${4}')
$content = $regexAV.Replace($content, '${1}' + $Assembly_Version + '${4}')
$content = $regexAIV.Replace($content, '${1}' + $Assembly_Informational_Version + '${4}')
$content = $regexAC.Replace($content, '${1}' + $Assembly_Configuration + '${4}')

[IO.File]::WriteAllText($Assembly_File, $content)
BIN +0 Bytes (100%) RocksmithPreBuild.exe
Binary file not shown.
@@ -141,7 +141,7 @@ private static void Main(string[] args)
Console.WriteLine("");

// process (read or write) the PatchAssemblyVersion.ps1 file
Console.WriteLine(" - Reading: " + patchAssemblyVersionPath);
Console.Write(" - Reading: " + patchAssemblyVersionPath);
lines = File.ReadAllLines(patchAssemblyVersionPath).ToList();
if (lines.Any())
{
@@ -156,6 +156,7 @@ private static void Main(string[] args)
if (args[1].ToUpper() == "READ")
{
assemblyVersion = GetStringInBetween("\"", "\"", line);

Console.WriteLine(" - Read $Assembly_Version: " + assemblyVersion);
}
else
@@ -177,7 +177,7 @@ private set
var scrollSpeed = value.ScrollSpeed;
if (scrollSpeed == 0)
scrollSpeed = Convert.ToInt32(ConfigRepository.Instance().GetDecimal("creator_scrollspeed") * 10);

tbarScrollSpeed.Value = Math.Min(scrollSpeed, tbarScrollSpeed.Maximum);
UpdateScrollSpeedDisplay();

@@ -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, "<WARNING> 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;
}
@@ -369,7 +369,7 @@ public bool AddXmlArrangement(string xmlFilePath)
SongXml = new SongXML { File = xmlFilePath }
};

var arrType = DetectArrangementType(xmlFilePath);
ArrangementType arrType = DetectArrangementType(xmlFilePath);

// SETUP FIELDS
if (arrType == ArrangementType.Vocal)
@@ -383,17 +383,20 @@ public bool AddXmlArrangement(string xmlFilePath)
{
cmbArrangementName.SelectedItem = ArrangementName.JVocals;

// Try to find a custom font texture with the filename lyrics.dds
string fontTexture = Path.Combine(Path.GetDirectoryName(xmlFilePath), "lyrics.dds");
if (File.Exists(fontTexture))
{
Arrangement.LyricArt = fontTexture;
}
//// 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)
{
@@ -402,7 +405,17 @@ public bool AddXmlArrangement(string xmlFilePath)
}
else // add Instrument Arrangement
{
_song2014 = Song2014.LoadFromFile(xmlFilePath);
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;
}

if (_song2014 == null)
return false;

@@ -435,7 +448,7 @@ public bool AddXmlArrangement(string xmlFilePath)

if (!hasTuning)
{
MessageBox.Show("<Warning> Default E Standard tuning was selected for" + Environment.NewLine +
MessageBox.Show("<WARNING> Default E Standard tuning was selected for" + Environment.NewLine +
"this RS1 arrangement. Please confirm the arrangement " + Environment.NewLine +
"tuning and all other data before leaving the editor.",
"Default Tuning Selected", MessageBoxButtons.OK, MessageBoxIcon.Warning);
@@ -546,6 +559,7 @@ public bool AddXmlArrangement(string xmlFilePath)
return false;
}
}

return true;
}

@@ -590,12 +604,12 @@ private void EditShowlights()

private void EditVocals()
{
using (var form = new VocalsForm(Arrangement.LyricArt, Arrangement.SongXml.File))
using (var form = new VocalsForm(Arrangement.LyricsArtPath, Arrangement.SongXml.File))
{
if (DialogResult.OK != form.ShowDialog())
return;

Arrangement.LyricArt = File.Exists(form.ArtPath) ? form.ArtPath : null;
Arrangement.LyricsArtPath = File.Exists(form.ArtPath) ? form.ArtPath : null;

if (!String.IsNullOrEmpty(form.VocalsPath))
{
@@ -676,14 +690,24 @@ private bool FixBassTuning()

public bool IsAlreadyAdded(string xmlFilePath)
{
var xmlFileName = Path.GetFileName(xmlFilePath);
for (int i = 0; i < _parentControl.lstArrangements.Items.Count; i++)
{
var selectedArrangement = (Arrangement)_parentControl.lstArrangements.Items[i];
var selectedArrangementFileName = Path.GetFileName(selectedArrangement.SongXml.File);
var arrangementFileName = Path.GetFileName(Arrangement.SongXml.File);
// potential issue using full path so just use file names
// D:\\Temp\RS Root\dlc\Font Test Project\innayumemirushoujojairarenai_jvocals.xml
// D:\Temp\RS Root\dlc\Font Test Project\innayumemirushoujojairarenai_jvocals.xml

if (xmlFileName != selectedArrangementFileName)
continue;
if (!String.IsNullOrEmpty(arrangementFileName) && xmlFileName != arrangementFileName)
continue;

if (!xmlFilePath.Equals(selectedArrangement.SongXml.File)) continue;
if (xmlFilePath.Equals(Arrangement.SongXml.File)) continue;
return true;
}

return false;
}

@@ -1043,7 +1067,8 @@ private void btnBrowseXml_Click(object sender, EventArgs e)
return;
}

AddXmlArrangement(XmlPath);
if (!AddXmlArrangement(XmlPath))
XmlPath = String.Empty;
}
}

Some generated files are not rendered by default. Learn more.

0 comments on commit 3745126

Please sign in to comment.