fix: 修复抄作业功能界面打印失效的问题

This commit is contained in:
MistEO
2022-12-25 00:57:40 +08:00
parent e767612249
commit 96e7ab0eb7
7 changed files with 14 additions and 23 deletions

View File

@@ -183,7 +183,7 @@ void asst::BattleProcessTask::notify_action(const battle::copilot::Action& actio
{ ActionType::BulletTime, "BulletTime" }, { ActionType::Output, "Output" },
};
json::value info = basic_info_with_what("Action");
json::value info = basic_info_with_what("CopilotAction");
info["details"] |= json::object {
{ "action", ActionNames.at(action.type) },
{ "target", action.group_name },
@@ -324,9 +324,10 @@ void asst::BattleProcessTask::sleep_with_use_ready_skill(unsigned millisecond)
LogTraceScope(__FUNCTION__ + std::to_string(millisecond));
using namespace std::chrono_literals;
auto start = std::chrono::steady_clock::now();
const auto start = std::chrono::steady_clock::now();
const auto delay = millisecond * 1ms;
while (!need_exit() && std::chrono::steady_clock::now() - start < millisecond * 1ms) {
while (!need_exit() && std::chrono::steady_clock::now() - start < delay) {
use_all_ready_skill();
std::this_thread::yield();
}

View File

@@ -943,7 +943,7 @@ namespace MaaWpfGui
copilotModel.AddLog(Localization.GetString("BattleFormationSelected") + subTaskDetails["selected"]);
break;
case "BattleAction":
case "CopilotAction":
{
string doc = subTaskDetails["doc"].ToString();
if (doc.Length != 0)
@@ -952,24 +952,14 @@ namespace MaaWpfGui
copilotModel.AddLog(doc, color.Length == 0 ? UILogColor.Message : color);
}
var action = subTaskDetails["action"].ToString();
if (action.Length != 0)
{
copilotModel.AddLog(Localization.GetString("CurrentSteps") + action);
}
copilotModel.AddLog(
string.Format(Localization.GetString("CurrentSteps"),
subTaskDetails["action"].ToString(),
subTaskDetails["target"].ToString()));
}
break;
case "BattleActionDoc":
// {
// string title_color = subTaskDetails["title_color"].ToString();
// copilotModel.AddLog(subTaskDetails["title"].ToString(), title_color.Length == 0 ? LogColor.Message : title_color);
// string details_color = subTaskDetails["details_color"].ToString();
// copilotModel.AddLog(subTaskDetails["details"].ToString(), details_color.Length == 0 ? LogColor.Message : details_color);
// }
break;
case "UnsupportedLevel":
copilotModel.AddLog(Localization.GetString("UnsupportedLevel"), UILogColor.Error);
break;

View File

@@ -451,7 +451,7 @@
<system:String x:Key="StageInfoError">Stage recognition error</system:String>
<system:String x:Key="BattleFormation">Start formation</system:String>
<system:String x:Key="BattleFormationSelected" xml:space="preserve">Selection of operator: </system:String>
<system:String x:Key="CurrentSteps" xml:space="preserve">Current step: </system:String>
<system:String x:Key="CurrentSteps">Current step: {0} {1}</system:String>
<system:String x:Key="UnsupportedLevel">Unsupported levels, please update the MAA, or check input file</system:String>
<system:String x:Key="RecruitTagsDetected" xml:space="preserve">Identify results: </system:String>
<system:String x:Key="ConnectFailed">Connection Failed</system:String>

View File

@@ -418,7 +418,7 @@
<system:String x:Key="StageInfoError">ステージ認識エラー</system:String>
<system:String x:Key="BattleFormation">編成開始</system:String>
<system:String x:Key="BattleFormationSelected">オペレーターを選択:</system:String>
<system:String x:Key="CurrentSteps">現在の手順:</system:String>
<system:String x:Key="CurrentSteps">現在の手順:{0} {1}</system:String>
<system:String x:Key="UnsupportedLevel">このステージはサポートされていません。MAAのバージョンをアップデートするか、攻略ファイルを確認してください</system:String>
<system:String x:Key="RecruitTagsDetected">認識結果:</system:String>
<system:String x:Key="ConnectFailed">接続失敗</system:String>

View File

@@ -450,7 +450,7 @@
<system:String x:Key="StageInfoError">스테이지 인식 오류</system:String>
<system:String x:Key="BattleFormation">편성 시작</system:String>
<system:String x:Key="BattleFormationSelected">오퍼레이터를 선택:</system:String>
<system:String x:Key="CurrentSteps">현재 단계:</system:String>
<system:String x:Key="CurrentSteps">현재 단계: {0} {1}</system:String>
<system:String x:Key="UnsupportedLevel">지원하지 않는 스테이지입니다. MAA를 업데이트하거나, 작업 파일을 확인하십시오.</system:String>
<system:String x:Key="RecruitTagsDetected">인식 결과:</system:String>
<system:String x:Key="ConnectFailed">연결 실패</system:String>

View File

@@ -451,7 +451,7 @@
<system:String x:Key="StageInfoError">关卡识别错误</system:String>
<system:String x:Key="BattleFormation">开始编队</system:String>
<system:String x:Key="BattleFormationSelected">选择干员:</system:String>
<system:String x:Key="CurrentSteps">当前步骤:</system:String>
<system:String x:Key="CurrentSteps">当前步骤:{0} {1}</system:String>
<system:String x:Key="UnsupportedLevel">不支持的关卡,请更新 MAA 软件版本,或检查作业文件</system:String>
<system:String x:Key="RecruitTagsDetected">识别结果:</system:String>
<system:String x:Key="ConnectFailed">连接失败</system:String>

View File

@@ -403,7 +403,7 @@
<system:String x:Key="StageInfoError">關卡辨識錯誤</system:String>
<system:String x:Key="BattleFormation">開始編隊</system:String>
<system:String x:Key="BattleFormationSelected">選擇幹員:</system:String>
<system:String x:Key="CurrentSteps">當前步驟:</system:String>
<system:String x:Key="CurrentSteps">當前步驟:{0} {1}</system:String>
<system:String x:Key="UnsupportedLevel">不支持的關卡,請更新 MAA 軟體版本,或檢查作業檔案</system:String>
<system:String x:Key="RecruitTagsDetected">辨識結果:</system:String>
<system:String x:Key="ConnectFailed">連接失敗</system:String>