Skip to content

Commit

Permalink
Comparer: fix 'ResolvePngLink' not working in patcher.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kagamia committed May 12, 2017
1 parent a880d58 commit 57e0991
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 30 deletions.
6 changes: 6 additions & 0 deletions UpdateLogs/dev.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

## 2017.5.12

### Comparer
- 修复了在补丁对比过程中ResolvePngLink无法正常工作的bug。


## 2017.4.25

### CharaSim
Expand Down
4 changes: 3 additions & 1 deletion WzComparerR2/Comparer/EasyComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ private void CompareImg(Wz_Image imgNew, Wz_Image imgOld, string imgName, string
}
StateDetail = "正在输出对比报告";
sw.WriteLine("<table class=\"img\">");
sw.WriteLine("<tr><th colspan=\"3\"><a name=\"{1}\">{0}</a> 修改:{2} 新增:{3} 移除:{4}</th></tr>", imgName, anchorName, count[0], count[1], count[2]);
sw.WriteLine("<tr><th class=\"{5}\" colspan=\"3\"><a name=\"{1}\">{0}</a> 修改:{2} 新增:{3} 移除:{4}</th></tr>",
imgName, anchorName, count[0], count[1], count[2], count.Any(c => c > 0) ? "" : "noChange");
sw.WriteLine(sb.ToString());
sw.WriteLine("<tr><td colspan=\"3\"><a href=\"#{1}\">{0}</a></td></tr>", "回到目录", menuAnchorName);
sw.WriteLine("</table>");
Expand Down Expand Up @@ -511,6 +512,7 @@ public virtual void CreateStyleSheet(string outputDir)
sw.WriteLine("p.wzf { }");
sw.WriteLine("table, tr, th, td { border:1px solid #ff8000; border-collapse:collapse; }");
sw.WriteLine("th { text-align:left; }");
sw.WriteLine("th.noChange { color:#aaa; }");
sw.WriteLine("table.lst0 { }");
sw.WriteLine("table.lst1 { }");
sw.WriteLine("table.lst2 { }");
Expand Down
56 changes: 29 additions & 27 deletions WzComparerR2/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,36 +169,36 @@ void CharaSimLoader_WzFileFinding(object sender, FindWzEventArgs e)
List<Wz_Node> preSearch = new List<Wz_Node>();
if (e.WzType != Wz_Type.Unknown) //用wztype作为输入参数
{
foreach (Wz_Structure wzs in openedWz)
IEnumerable<Wz_Structure> preSearchWz = e.WzFile?.WzStructure != null ?
Enumerable.Repeat(e.WzFile.WzStructure, 1) :
this.openedWz;
foreach (var wzs in preSearchWz)
{
if (e.WzFile == null || e.WzFile.WzStructure == wzs)
Wz_File baseWz = null;
bool find = false;
foreach (Wz_File wz_f in wzs.wz_files)
{
Wz_File baseWz = null;
bool find = false;
foreach (Wz_File wz_f in wzs.wz_files)
if (wz_f.Type == e.WzType)
{
if (wz_f.Type == e.WzType)
{
preSearch.Add(wz_f.Node);
find = true;
//e.WzFile = wz_f;
}
if (wz_f.Type == Wz_Type.Base)
{
baseWz = wz_f;
}
preSearch.Add(wz_f.Node);
find = true;
//e.WzFile = wz_f;
}
if (wz_f.Type == Wz_Type.Base)
{
baseWz = wz_f;
}
}

// detect data.wz
if (baseWz != null && !find)
// detect data.wz
if (baseWz != null && !find)
{
string key = e.WzType.ToString();
foreach (Wz_Node node in baseWz.Node.Nodes)
{
string key = e.WzType.ToString();
foreach (Wz_Node node in baseWz.Node.Nodes)
if (node.Text == key && node.Nodes.Count > 0)
{
if (node.Text == key && node.Nodes.Count > 0)
{
preSearch.Add(node);
}
preSearch.Add(node);
}
}
}
Expand All @@ -214,14 +214,16 @@ void CharaSimLoader_WzFileFinding(object sender, FindWzEventArgs e)
}
return;
}
//拼接剩余路径
string[] fullPath2 = new string[fullPath.Length - 1];
Array.Copy(fullPath, 1, fullPath2, 0, fullPath2.Length);


if (preSearch.Count <= 0)
{
return;
}

//拼接剩余路径
string[] fullPath2 = new string[fullPath.Length - 1];
Array.Copy(fullPath, 1, fullPath2, 0, fullPath2.Length);

foreach (var wzFileNode in preSearch)
{
e.WzNode = wzFileNode.FindNodeByPath(true, true, fullPath2);
Expand Down
4 changes: 2 additions & 2 deletions WzComparerR2/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.8.3")]
[assembly: AssemblyFileVersion("2.0.8.70425")]
[assembly: AssemblyVersion("2.0.8.4")]
[assembly: AssemblyFileVersion("2.0.8.70512")]

0 comments on commit 57e0991

Please sign in to comment.