From fb7a0ecfdc46c5c5a294a5c4b6bd0c796add37f4 Mon Sep 17 00:00:00 2001 From: Codex Agent Date: Sun, 22 Nov 2026 15:24:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=A1=E5=8C=85=E7=A1=AE=E8=AE=A4=E6=8B=96?= =?UTF-8?q?=E6=8B=BD=E6=B2=A1=E7=94=9F=E6=95=88=E6=97=B6=E4=B8=8B=E7=A7=BB?= =?UTF-8?q?=2080px=20=E5=86=8D=E6=8B=96=E4=B8=80=E6=AC=A1(5=20=E5=B1=82?= =?UTF-8?q?=E9=80=89=E5=8C=85=E5=8D=A1=E6=AD=BB=2040=20=E5=88=86=E9=92=9F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lc_mcp/aalc_patches.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/lc_mcp/aalc_patches.py b/lc_mcp/aalc_patches.py index c516eb5..8d94c1f 100644 --- a/lc_mcp/aalc_patches.py +++ b/lc_mcp/aalc_patches.py @@ -1953,6 +1953,10 @@ def install_theme_pack_systems(log=print, env=None, route=None, route_name='路 except Exception as e: log('[lc_mcp] 卡包按体系加分跳过: 无法导入 %s' % e) return None + try: + from module.automation import auto + except Exception: + auto = None # 单测没有 automation 模块: 只少「拖拽没确认再拖一次」的兜底 original = getattr(mirror_mod, 'select_theme_pack', None) theme_list = getattr(theme_pack_mod, 'theme_list', None) try: @@ -1995,7 +1999,29 @@ def install_theme_pack_systems(log=print, env=None, route=None, route_name='路 THEME_PACK_BOOSTED.update(info) return result - with _override(theme_list, 'get_effective_theme_pack_list', get_effective_theme_pack_list): + # 2026-11-22: 5 层选卡包卡了 40 分钟。上游用 mouse_drag_down(pack) 把卡包"拉下来"确认, + # 卡包模板的匹配点常落在放大镜上, 从那里往下拖不生效; 拖完还停在选包页就下移 80px 再拖一次。 + real_drag = getattr(auto, 'mouse_drag_down', None) if auto is not None else None + + def mouse_drag_down(x, y, *a, **kw): + if real_drag is None: + return None + real_drag(x, y, *a, **kw) + try: + still = auto.find_element(THEME_PACK_REFRESH, take_screenshot=True) + except Exception: + still = None + if still: + log('[lc_mcp] 卡包拖拽没确认, 下移 80px 再拖一次 (%d,%d)' % (x, y + 80)) + decisions.record('theme_pack', None, 'drag_retry', pos=[int(x), int(y)]) + real_drag(x, y + 80, *a, **kw) + return None + + if auto is None: + with _override(theme_list, 'get_effective_theme_pack_list', get_effective_theme_pack_list): + return original(*args, **kwargs) + with _override(theme_list, 'get_effective_theme_pack_list', get_effective_theme_pack_list), \ + _override(auto, 'mouse_drag_down', mouse_drag_down): return original(*args, **kwargs) select_theme_pack.__wrapped__ = original