feat: enhance swipe and back navigation logic

- Adjusted configuration for reset after swipes to 10 seconds and added action to go back.
- Updated flow control to skip back action if a recent reset was triggered within 5 seconds.
- Implemented a mechanism to enable back navigation when consecutive misses reach a threshold.
- Added GUI options to enable or disable back navigation on misses, ensuring consistency with user settings.
- Introduced new diagnostic tools for runtime flag checks and screenshot diagnostics.
- Created PowerShell scripts for restoring Start Menu shortcuts and performing system health checks.
- Added tests for swipe operations and back navigation to validate new logic.
This commit is contained in:
Your Name committed 2026-01-06 16:55:00 +08:00
1 parent 0c3a763d63
commit dcded08796
19 files changed
+936 -22

No files matched your search

+21 -1
View File
@@ -317,7 +317,7 @@ def main():
side=LEFT, padx=(0, 12)
)
# 连续无福袋退出阈值变量(提前声明,实际声明在下方唯一位置以便与配置同步)
#(变量将在后面统一声明,避免重复创建 IntVar 导致绑定不一致)
# (变量将在后面统一声明,避免重复创建 IntVar 导致绑定不一致)
# 启用返回键回退开关变量(提前声明)
enable_back_on_misses_var = tk.BooleanVar(
value=bool(cfg.get("enable_back_on_misses", True))
@@ -1860,6 +1860,12 @@ def main():
)
cfg2["fudai_exit_after_misses"] = int(fudai_exit_after_misses_var.get() or 30)
cfg2["enable_back_on_misses"] = bool(enable_back_on_misses_var.get())
# 如果勾选了启用返回键回退,同时将滑动重置的回退方式设置为按返回键,保持与 UI 预期一致
if bool(enable_back_on_misses_var.get()):
cfg2["reset_after_swipes_action"] = "back"
else:
# 保留已有配置,若不存在则设为默认的滑动回退
cfg2.setdefault("reset_after_swipes_action", "swipe")
cfg2["fudai_disable_content_recognition"] = bool(
fudai_disable_content_recognition_var.get()
)
@@ -2606,6 +2612,13 @@ def main():
log_search_frame = ttk.Frame(log_box)
log_search_frame.pack(fill=X, padx=10, pady=(10, 5))
# 关键字筛选(与行为日志一致)
log_filter_var = tk.StringVar(value="")
ttk.Label(log_search_frame, text="筛选:").pack(side=LEFT)
ttk.Entry(log_search_frame, textvariable=log_filter_var, width=16).pack(
side=LEFT, padx=(0, 8)
)
log_search_var = tk.StringVar(value="")
log_search_entry = ttk.Entry(
log_search_frame, textvariable=log_search_var, width=20
@@ -3090,6 +3103,13 @@ def main():
while True:
line = q.get_nowait()
# 运行日志关键字筛选(与行为日志一致)
try:
kw = log_filter_var.get().strip()
if kw and kw not in line:
continue
except Exception:
pass
try:
# 插入日志行并应用颜色标签
start_pos = log_text.index("end-1c")
+6
View File
@@ -985,6 +985,12 @@ class Runner:
cmd.append("--enable-back-on-misses")
else:
cmd.append("--disable-back-on-misses")
# 确保从 GUI 启动时传递回退方式(若启用返回键回退,则将 reset action 设为 back)
try:
if getattr(params, "enable_back_on_misses", False):
cmd += ["--reset-after-swipes-action", "back"]
except Exception:
pass
# 只养号模式:如果启用则传递到 run_cli.py
try: