Skip to content

feat: 同步 WPF 版周计划功能,为刷理智任务添加每周执行日设置 - #94

Open
HosamaJJF wants to merge 1 commit into
MaaAssistantArknights:masterfrom
HosamaJJF:feat/weekly-schedule
Open

feat: 同步 WPF 版周计划功能,为刷理智任务添加每周执行日设置#94
HosamaJJF wants to merge 1 commit into
MaaAssistantArknights:masterfrom
HosamaJJF:feat/weekly-schedule

Conversation

@HosamaJJF

@HosamaJJF HosamaJJF commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

在 mac 版 GUI 的刷理智任务设置中新增周计划选项,与 WPF 版本行为一致。

修改内容

  • 启用周计划后可在设置中勾选每周哪几天执行该任务
  • 非启用日自动跳过并记录日志,不会发送给 MaaCore
  • 星期按游戏时间计算(每日 4:00 刷新),根据设置中的游戏区服自动适配时区。

涉及文件

  • FightConfiguration.swift — 新增 WeeklySchedule 结构体及 useWeeklySchedule / weeklySchedule 属性
  • FightSettingsView.swift — 新增周计划设置区域(开关 + 7 天勾选 + 提示文字)
  • MAAViewModel.swift — 新增 inGameDayOfWeek 游戏星期计算及 startTasks() 跳过逻辑
  • LegacyConfigurations.swift — 旧配置迁移路径初始化新字段
  • Localizable.xcstrings — 新增中/英/日/韩/繁翻译

截图

1. 设置界面未勾选周计划选项

截屏2026-06-07 22 35 32

2. 设置界面勾选周计划选项

截屏2026-06-07 22 28 08

3. 日志界面

截屏2026-06-07 22 28 56

测试

  • 本地构建并启动 macOS GUI。
  • 添加多个刷理智任务并设置执行日。
  • 确认仅当日对应刷理智任务运行。

Summary by Sourcery

在 macOS 图形界面中为自动刷理智(auto fight / 理智刷)任务添加可配置的每周计划,并在派遣任务时遵守游戏内的工作日规则。

New Features:

  • 允许在 macOS 图形界面中为战斗任务启用每周计划,并为每个工作日单独设置开关。
  • 根据服务器区服和每日 4:00 结算时间计算游戏内的星期,以决定某个战斗任务今天是否应当运行。

Enhancements:

  • 迁移现有战斗配置,为每周计划相关字段初始化合理的默认值。
Original summary in English

Summary by Sourcery

Add configurable weekly schedules to auto fight (理智刷) tasks in the macOS GUI and honor in-game weekday rules when dispatching tasks.

New Features:

  • Allow fight tasks to enable a weekly schedule with per-weekday toggles in the macOS GUI.
  • Compute in-game weekday based on server region and 4:00 daily reset to decide whether a fight task should run today.

Enhancements:

  • Migrate existing fight configurations to initialize weekly schedule fields with sensible defaults.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我在这里给出了一些高层次的反馈:

  • WeeklySchedule.isEnabled(for:) 中,建议对超出范围的 weekday 值返回 false 而不是 true,这样当 weekday 计算错误时,可以以“失败关闭”的方式处理。
  • startTasks() 中,由于周计划导致跳过战斗任务时的日志消息中,可以包含任务名称或配置的 weekday,以便更容易调试为什么某个特定任务被跳过。
给 AI Agents 的提示
Please address the comments from this code review:

## Overall Comments
- In `WeeklySchedule.isEnabled(for:)`, consider returning `false` for out-of-range weekday values instead of `true` to fail closed if `weekday` is ever miscomputed.
- In `startTasks()`, the log message for skipping a fight task due to the weekly schedule could include the task’s name or configured weekday to make it easier to debug why a specific task was skipped.

Sourcery 对开源项目是免费的——如果你喜欢我们的评审,请考虑分享它们 ✨
帮我变得更有用!请对每条评论点 👍 或 👎,我会根据这些反馈来改进对你的代码评审。
Original comment in English

Hey - I've left some high level feedback:

  • In WeeklySchedule.isEnabled(for:), consider returning false for out-of-range weekday values instead of true to fail closed if weekday is ever miscomputed.
  • In startTasks(), the log message for skipping a fight task due to the weekly schedule could include the task’s name or configured weekday to make it easier to debug why a specific task was skipped.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `WeeklySchedule.isEnabled(for:)`, consider returning `false` for out-of-range weekday values instead of `true` to fail closed if `weekday` is ever miscomputed.
- In `startTasks()`, the log message for skipping a fight task due to the weekly schedule could include the task’s name or configured weekday to make it easier to debug why a specific task was skipped.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

在 macOS GUI 的刷理智任务设置中新增周计划选项,与 WPF 版本行为一致。
用户可启用周计划并选择每周哪几天执行该任务,非启用日自动跳过并记录日志。
星期按游戏时间计算(每日 4:00 刷新),根据设置中的游戏区服自动适配时区。

- FightConfiguration: 新增 WeeklySchedule 结构体及 useWeeklySchedule、weeklySchedule 属性
- FightSettingsView: 新增周计划设置区域(主开关 + 7 天勾选 + 提示文字)
- MAAViewModel: 新增 inGameDayOfWeek 游戏星期计算及 startTasks() 跳过逻辑
- LegacyConfigurations: 旧配置迁移路径初始化新字段
- Localizable.xcstrings: 新增中/英/日/韩/繁翻译
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant