mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 18:20:39 +08:00
@@ -558,6 +558,13 @@ bool asst::AdbController::screencap(cv::Mat& image_payload, bool allow_reconnect
|
||||
case AdbProperty::ScreencapMethod::MumuExtras: {
|
||||
auto img_opt = m_mumu_extras.screencap();
|
||||
screencap_ret = img_opt.has_value();
|
||||
|
||||
if (!screencap_ret && allow_reconnect) {
|
||||
m_mumu_extras.reload();
|
||||
img_opt = m_mumu_extras.screencap();
|
||||
screencap_ret = img_opt.has_value();
|
||||
}
|
||||
|
||||
if (screencap_ret) {
|
||||
image_payload = img_opt.value();
|
||||
}
|
||||
|
||||
@@ -33,6 +33,13 @@ bool MumuExtras::init(
|
||||
return inited_;
|
||||
}
|
||||
|
||||
bool MumuExtras::reload()
|
||||
{
|
||||
inited_ = load_mumu_library() && connect_mumu() && init_screencap();
|
||||
LogInfo << "Reload MumuExtras: " << VAR(inited_);
|
||||
return inited_;
|
||||
}
|
||||
|
||||
void MumuExtras::uninit()
|
||||
{
|
||||
inited_ = false;
|
||||
|
||||
@@ -24,8 +24,8 @@ public:
|
||||
|
||||
bool inited() const { return inited_; }
|
||||
|
||||
|
||||
bool init(const std::filesystem::path& mumu_path, int mumu_inst_index, int mumu_display_id);
|
||||
bool reload();
|
||||
void uninit();
|
||||
|
||||
std::optional<cv::Mat> screencap();
|
||||
|
||||
Reference in New Issue
Block a user