diff --git a/src/MaaCore/Controller/ControlScaleProxy.cpp b/src/MaaCore/Controller/ControlScaleProxy.cpp index d127a1ab69..212674e507 100644 --- a/src/MaaCore/Controller/ControlScaleProxy.cpp +++ b/src/MaaCore/Controller/ControlScaleProxy.cpp @@ -1,6 +1,7 @@ #include "ControlScaleProxy.h" #include "Config/GeneralConfig.h" +#include "Utils/Logger.hpp" asst::ControlScaleProxy::ControlScaleProxy(std::shared_ptr controller, ControllerType controller_type, ProxyCallback proxy_callback) @@ -56,6 +57,8 @@ bool asst::ControlScaleProxy::click(const Point& p) int x = static_cast(p.x * m_control_scale); int y = static_cast(p.y * m_control_scale); + Log.trace("Click with scaled coordinates", p, m_control_scale); + return m_controller->click(Point(x, y)); } @@ -72,6 +75,8 @@ bool asst::ControlScaleProxy::swipe(const Point& p1, const Point& p2, int durati int x2 = static_cast(p2.x * m_control_scale); int y2 = static_cast(p2.y * m_control_scale); + Log.trace("Swipe with scaled coordinates", p1, p2, m_control_scale); + return m_controller->swipe(Point(x1, y1), Point(x2, y2), duration, extra_swipe, slope_in, slope_out, with_pause); } diff --git a/src/MaaCore/Controller/MinitouchController.cpp b/src/MaaCore/Controller/MinitouchController.cpp index d62d36221f..19e62161c5 100644 --- a/src/MaaCore/Controller/MinitouchController.cpp +++ b/src/MaaCore/Controller/MinitouchController.cpp @@ -130,7 +130,6 @@ bool asst::MinitouchController::use_swipe_with_pause() const noexcept bool asst::MinitouchController::click(const Point& p) { - if (!m_minitoucher) { Log.error("minitoucher is not initialized"); return false; diff --git a/src/MaaCore/Controller/PlayToolsController.cpp b/src/MaaCore/Controller/PlayToolsController.cpp index 8bfb5a3596..8b5b99e7c5 100644 --- a/src/MaaCore/Controller/PlayToolsController.cpp +++ b/src/MaaCore/Controller/PlayToolsController.cpp @@ -118,6 +118,7 @@ bool asst::PlayToolsController::stop_game() bool asst::PlayToolsController::click(const Point& p) { + Log.trace("PlayTools click:", p); return toucher_down(p) && toucher_up(p); } @@ -143,6 +144,8 @@ bool asst::PlayToolsController::swipe( y1 = std::clamp(y1, 0, height - 1); } + Log.trace("PlayTools swipe", p1, p2, duration, extra_swipe, slope_in, slope_out); + toucher_down(p1); auto cubic_spline = [](double slope_0, double slope_1, double t) {