MCPcopy Create free account
hub / github.com/Hashiao/wuwaBackendTool / backToMain

Method backToMain

mainbackendworkernew.cpp:862–889  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

860}
861
862bool MainBackendWorkerNew::backToMain(){
863 qInfo() << QString("尝试恢复到主界面");
864
865 cv::Mat missionImg = cv::imread(QString("%1/mission.bmp").arg(Utils::IMAGE_DIR_EI()).toLocal8Bit().toStdString(), cv::IMREAD_UNCHANGED);
866 cv::Mat bagImg = cv::imread(QString("%1/bag.bmp").arg(Utils::IMAGE_DIR_EI()).toLocal8Bit().toStdString(), cv::IMREAD_UNCHANGED);
867 bool isFindBagFinal = false; // 是否找到背包图片
868 for(int i = 0; i < 7 && isBusy(); i++){
869 double similarity;
870 int x, y, timeCostMs;
871 bool isFind = loopFindPic(bagImg, 0.75, defaultMaxWaitMs, 250, "未能找到背包按钮 尝试esc后 继续寻找", similarity, x, y, timeCostMs);
872 if(!isBusy()){
873 return true;
874 }
875
876 if(!isFind){
877 Utils::keyPress(Utils::hwnd, VK_ESCAPE, 1);
878 }
879 else{
880 isFindBagFinal = true;
881 break;
882 }
883 }
884 if(!isBusy()){
885 return true;
886 }
887
888 return isFindBagFinal;
889}
890
891bool MainBackendWorkerNew::enterSolaGuide(){
892 qInfo() << QString("尝试进入到索拉指南");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected