Merge pull request #2844 from MaaAssistantArknights/dev

Release v4.7.0-rc.1
This commit is contained in:
MistEO
2022-11-22 00:50:47 +08:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -57,6 +57,7 @@ Assistant::~Assistant()
bool asst::Assistant::set_instance_option(InstanceOptionKey key, const std::string& value)
{
Log.info(__FUNCTION__, "| key", static_cast<int>(key), "value", value);
switch (key) {
case InstanceOptionKey::MinitouchEnabled:
if (value == "0") {

View File

@@ -1531,10 +1531,11 @@ bool asst::Controller::connect(const std::string& adb_path, const std::string& a
call_and_hup_minitouch(m_adb.call_minitouch);
std::string orientation_str = call_command(cmd_replace(adb_cfg.orientation)).value_or("0");
auto [beg, end] = ranges::remove_if(orientation_str, [](char ch) -> bool { return !std::isdigit(ch); });
orientation_str.erase(beg, end);
if (!orientation_str.empty()) {
m_minitouch_props.orientation = std::stoi(orientation_str);
char first = orientation_str.front();
if (first == '0' || first == '1' || first == '2' || first == '3') {
m_minitouch_props.orientation = static_cast<int>(first - '0');
}
}
// try to find the fastest way