mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-20 02:55:38 +08:00
style: 换个好函数名;代码格式化
This commit is contained in:
@@ -896,7 +896,7 @@ bool asst::Controller::support_swipe_with_pause() const noexcept
|
||||
return m_minitouch_enabled && m_minitouch_available && m_swipe_with_pause_enabled && !m_adb.press_esc.empty();
|
||||
}
|
||||
|
||||
bool asst::Controller::support_swipe_without_adb() const noexcept
|
||||
bool asst::Controller::support_precise_swipe() const noexcept
|
||||
{
|
||||
return m_minitouch_enabled && m_minitouch_available;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace asst
|
||||
|
||||
bool press_esc();
|
||||
bool support_swipe_with_pause() const noexcept;
|
||||
bool support_swipe_without_adb() const noexcept;
|
||||
bool support_precise_swipe() const noexcept;
|
||||
|
||||
std::pair<int, int> get_scale_size() const noexcept;
|
||||
|
||||
|
||||
@@ -521,7 +521,7 @@ void asst::RoguelikeRecruitTaskPlugin::slowly_swipe(bool to_left, int swipe_dist
|
||||
{
|
||||
std::string swipe_task_name =
|
||||
to_left ? "RoguelikeRecruitOperListSlowlySwipeToTheLeft" : "RoguelikeRecruitOperListSlowlySwipeToTheRight";
|
||||
if (!ctrler()->support_swipe_without_adb()) { // adb 容易滑飞,不方便精细控制,不使用 swipe_dist 参数
|
||||
if (!ctrler()->support_precise_swipe()) { // 不能精准滑动时不使用 swipe_dist 参数
|
||||
ProcessTask(*this, { swipe_task_name }).run();
|
||||
return;
|
||||
}
|
||||
@@ -529,12 +529,11 @@ void asst::RoguelikeRecruitTaskPlugin::slowly_swipe(bool to_left, int swipe_dist
|
||||
if (!to_left) swipe_dist = -swipe_dist;
|
||||
auto swipe_task = Task.get(swipe_task_name);
|
||||
const Rect& StartPoint = swipe_task->specific_rect;
|
||||
ctrler()->swipe(
|
||||
StartPoint,
|
||||
{ StartPoint.x + swipe_dist - StartPoint.width, StartPoint.y, StartPoint.width, StartPoint.height },
|
||||
swipe_task->special_params.empty() ? 0 : swipe_task->special_params.at(0),
|
||||
(swipe_task->special_params.size() < 2) ? false : swipe_task->special_params.at(1),
|
||||
(swipe_task->special_params.size() < 3) ? 1 : swipe_task->special_params.at(2),
|
||||
(swipe_task->special_params.size() < 4) ? 1 : swipe_task->special_params.at(3));
|
||||
ctrler()->swipe(StartPoint,
|
||||
{ StartPoint.x + swipe_dist - StartPoint.width, StartPoint.y, StartPoint.width, StartPoint.height },
|
||||
swipe_task->special_params.empty() ? 0 : swipe_task->special_params.at(0),
|
||||
(swipe_task->special_params.size() < 2) ? false : swipe_task->special_params.at(1),
|
||||
(swipe_task->special_params.size() < 3) ? 1 : swipe_task->special_params.at(2),
|
||||
(swipe_task->special_params.size() < 4) ? 1 : swipe_task->special_params.at(3));
|
||||
sleep(swipe_task->post_delay);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user