Skip to content

Commit

Permalink
feat: add daily_enable
Browse files Browse the repository at this point in the history
  • Loading branch information
moesnow committed Dec 30, 2023
1 parent 749ca09 commit 30a5107
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/

### Python Patch ###
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
Expand Down
7 changes: 7 additions & 0 deletions app/setting_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ def __init__(self, parent=None):
# "请解锁混沌回忆并配置了队伍1后再打开该选项",
# "daily_forgottenhall_enable"
# )
self.dailyEnableCard = SwitchSettingCard1(
FIF.TILES,
self.tr('启用每日实训'),
"",
"daily_enable"
)
self.dailyUniverseEnableCard = SwitchSettingCard1(
FIF.TILES,
self.tr('通过 “模拟宇宙” 完成任务'),
Expand Down Expand Up @@ -550,6 +556,7 @@ def __initLayout(self):
self.DailyGroup.addSettingCard(self.assistEnableCard)
# self.DailyGroup.addSettingCard(self.srpassEnableCard)
# self.DailyGroup.addSettingCard(self.dailyForgottenhallEnableCard)
self.DailyGroup.addSettingCard(self.dailyEnableCard)
self.DailyGroup.addSettingCard(self.dailyUniverseEnableCard)
self.DailyGroup.addSettingCard(self.dailyHimekoTryEnableCard)
self.DailyGroup.addSettingCard(self.dailyMemoryOneEnableCard)
Expand Down
1 change: 1 addition & 0 deletions assets/config/config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ dispatch_enable: true # 领取委托奖励
mail_enable: true # 领取邮件奖励
assist_enable: true # 领取支援奖励

daily_enable: true # 启用日常
daily_universe_enable: false # 通过 “模拟宇宙” 完成任务
daily_himeko_try_enable: false # 通过 “姬子试用” 完成任务
daily_memory_one_enable: false # 通过 “回忆一” 完成任务
Expand Down
3 changes: 2 additions & 1 deletion assets/docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
## v1.7.2

### 新功能
- 支持关闭每日实训(可搭配每天一次模拟宇宙来完成500活跃度)
- 支持新历战余响「蛀星的旧靥」
- 支持忘却之庭和支援角色选择“阮·梅”
### 修复
- 传送忘却之庭小概率错误点击信用点图标 [#91](https://github.com/moesnow/March7thAssistant/pull/91)
- 传送忘却之庭小概率错误点击成信用点图标 [#91](https://github.com/moesnow/March7thAssistant/pull/91)

## v1.7.1

Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import sys

os.chdir(os.path.dirname(sys.executable) if getattr(sys, 'frozen', False) else os.path.dirname(os.path.abspath(__file__)))

from managers.notify_manager import notify
Expand All @@ -8,7 +9,6 @@
from managers.ocr_manager import ocr
from managers.translate_manager import _
from tasks.game.game import Game
from tasks.game.stop import Stop
from tasks.daily.daily import Daily
from tasks.reward.reward import Reward
from tasks.daily.fight import Fight
Expand Down Expand Up @@ -39,7 +39,7 @@ def main(action=None):
Version.start()
Game.start()
if action == "daily":
Daily.daily()
Daily.daily(force=True)
Reward.start()
elif action == "power":
Power.start()
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ onepush
winotify
markdown
cpufeature
PyQt-Fluent-Widgets
PyQt-Fluent-Widgets==1.4.3
pylnk3
16 changes: 9 additions & 7 deletions tasks/daily/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,22 @@ def start():

Reward.start()

def daily():
@staticmethod
def daily(force=False):
logger.hr(_("开始日常任务"), 0)
if Date.is_next_4_am(config.last_run_timestamp):

# 活动
Activity.start()

screen.change_to("guide2")
config.set_value("daily_tasks", {})
if config.daily_enable or force:
screen.change_to("guide2")

tasks = Tasks("./assets/config/task_mappings.json")
tasks.start()
tasks = Tasks("./assets/config/task_mappings.json")
tasks.start()

config.set_value("daily_tasks", tasks.daily_tasks)
config.save_timestamp("last_run_timestamp")
config.set_value("daily_tasks", tasks.daily_tasks)
config.save_timestamp("last_run_timestamp")
else:
logger.info(_("日常任务尚未刷新"))

Expand Down

0 comments on commit 30a5107

Please sign in to comment.