style: 换个好函数名;代码格式化

This commit is contained in:
zzyyyl
2023-02-24 20:13:33 +08:00
parent ee4740e6ed
commit 5340114a73
3 changed files with 9 additions and 10 deletions

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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);
}