chore.修改关卡掉落的回调

This commit is contained in:
MistEO
2022-01-09 03:25:17 +08:00
parent 9f9cfb6b38
commit bd4ffffafa
3 changed files with 8 additions and 8 deletions

View File

@@ -195,21 +195,21 @@ Todo
"fingerprint": "e464bafaa3f92877bbc4fb20209e4169ae49d587499c8d2e72026b96356c591f6a17477a5b345518a00b23be78252e0825070585d33f2109390807672c252a0b",
"md5": "b40ea51ec7802afa2e86951bffbbc21f",
"cost": 6.0624,
"statistics": [ // 本次执行期间总的材料掉落
"stats": [ // 本次执行期间总的材料掉落
{
"itemId": "3301",
"itemName": "技巧概要·卷1",
"count": 4
"quantity": 4
},
{
"itemId": "3302",
"itemName": "技巧概要·卷2",
"count": 3
"quantity": 3
},
{
"itemId": "3303",
"itemName": "技巧概要·卷3",
"count": 4
"quantity": 4
}
]
}

View File

@@ -74,7 +74,7 @@ void asst::StageDropsTaskPlugin::drop_info_callback()
info["itemId"] = id;
const std::string& name = item.get_item_name(id);
info["itemName"] = name.empty() ? "未知材料" : name;
info["count"] = count;
info["quantity"] = count;
statistics_vec.emplace_back(std::move(info));
}
//// 排个序,数量多的放前面
@@ -83,7 +83,7 @@ void asst::StageDropsTaskPlugin::drop_info_callback()
// return lhs.at("count").as_integer() > rhs.at("count").as_integer();
// });
drops_details["statistics"] = json::array(std::move(statistics_vec));
drops_details["stats"] = json::array(std::move(statistics_vec));
json::value info = basic_info();
info["what"] = "StageDrops";

View File

@@ -294,11 +294,11 @@ namespace MeoAsstGui
mainModel.AddLog("当次掉落:\n" + cur_drops);
string all_drops = "";
JArray statistics = (JArray)subTaskDetails["statistics"];
JArray statistics = (JArray)subTaskDetails["stats"];
foreach (var item in statistics)
{
string itemName = item["itemName"].ToString();
int count = (int)item["count"];
int count = (int)item["quantity"];
all_drops += $"{itemName} : {count}\n";
}
all_drops = all_drops.EndsWith("\n") ? all_drops.TrimEnd('\n') : "无";