增加对itemEffectTip的格式转写,修复滑冰转写bug,增加对hero.equipment的检查

This commit is contained in:
ShakeFlower committed 2024-10-22 23:05:14 +08:00
1 parent b3724bc752
commit 8bb1a552cc
3 files changed
+25 -8

No files matched your search

+12 -6
View File
@@ -159,7 +159,14 @@ namespace H5MotaUpdate.ViewModels
heroItemData = (JObject)heroData["items"];
heroData["image"] = "hero.png";
heroData["followers"] = new JArray();
if (heroData["exp"] == null) heroData["exp"] = heroData["experience"];
if (heroData["exp"] == null)
{
heroData["exp"] = heroData["experience"];
}
if (heroData["equipment"] == null)
{
heroData["equipment"] = new JArray(); // 预防某些超级老样板没有hero.equipment}
}
heroData.Remove("experience");
JObject heroToolsData = (JObject)heroItemData["tools"];
@@ -299,13 +306,12 @@ namespace H5MotaUpdate.ViewModels
{
statusBarItemsArr.Add(status);
}
else if (new string[] { "enableHP", "enableAtk", "enableDef" }.Contains(status)) // hp,atk,def为2.7前默认显示的变量,必须显示
{
else if (new string[] { "enableHP", "enableAtk", "enableDef" }.Contains(status))
{// hp,atk,def为2.7前默认显示的变量,必须显示
statusBarItemsArr.Add(status);
}
else if (status == "enableExp" && flagsData["enableExperience"].Value<bool>() == true) // experience更新为exp
{
else if (status == "enableExp" && flagsData["enableExperience"].Value<bool>() == true)
{// experience更新为exp
statusBarItemsArr.Add(status);
}
}
+9 -2
View File
@@ -154,11 +154,18 @@ namespace H5MotaUpdate.ViewModels
if (onePoint == 167 && version.CompareTo(new Version(2, 6)) < 0)
{
// 2.6以后,滑冰转移到背景层
JArray bgMatrix = (JArray)jsonObject["bgmap"].DeepClone();
if (bgMatrix == null || bgMatrix.Count == 0)
if (jsonObject["bgmap"] == null)
{
jsonObject["bgmap"] = zeroBgMatrix.DeepClone();
}
else
{
JArray bgMatrix = (JArray)jsonObject["bgmap"];
if (bgMatrix.Count == 0)
{
jsonObject["bgmap"] = zeroBgMatrix.DeepClone();
}
}
jsonObject["bgmap"][i][j] = 167;
mapMatrix[i][j] = 0;
}
+4
View File
@@ -92,6 +92,10 @@ namespace H5MotaUpdate.ViewModels
if (newItemDatas.ContainsKey(key))
{
JObject itemData = (JObject)newItemDatas[key];
if (ele== "itemEffectTip")
{
valueString = "${" + valueString + "}";
}
itemData[ele] = valueString;
}
}