Skip to content

Commit

Permalink
config: daily_universe_enable
Browse files Browse the repository at this point in the history
  • Loading branch information
moesnow committed Dec 28, 2023
1 parent b25ffc4 commit 25409a0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/card/messagebox3.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def _setUpUi(self, title, content, parent):
self.content_count = len(content)

font = QFont()
font.setPointSize(15)
font.setPointSize(10)

for index, (key, value) in enumerate(self.content.items(), start=0):
title_label_name = f'self.titleLabel{index}'
Expand Down Expand Up @@ -81,7 +81,7 @@ def __initLayout(self):
self.vBoxLayout.addWidget(self.buttonGroup, 0, Qt.AlignBottom)
self.vBoxLayout.setSizeConstraint(QVBoxLayout.SetMinimumSize)

self.textLayout.setSpacing(12)
self.textLayout.setSpacing(10)
self.textLayout.setContentsMargins(24, 24, 24, 24)
self.textLayout.addWidget(self.titleLabel, 0, Qt.AlignTop)
# self.textLayout.addWidget(self.contentLabel, 0, Qt.AlignTop)
Expand All @@ -92,7 +92,7 @@ def __initLayout(self):
self.textLayout.addWidget(getattr(self, title_label_name), 0, Qt.AlignTop)
self.textLayout.addWidget(getattr(self, line_edit_name), 0, Qt.AlignTop)

self.buttonLayout.setSpacing(12)
self.buttonLayout.setSpacing(10)
self.buttonLayout.setContentsMargins(24, 24, 24, 24)
self.buttonLayout.addWidget(self.yesButton, 1, Qt.AlignVCenter)
self.buttonLayout.addWidget(self.cancelButton, 1, Qt.AlignVCenter)
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.dailyUniverseEnableCard = SwitchSettingCard1(
FIF.TILES,
self.tr('通过 “模拟宇宙” 完成任务'),
"",
"daily_universe_enable"
)
self.dailyHimekoTryEnableCard = SwitchSettingCard1(
FIF.TILES,
self.tr('通过 “姬子试用” 完成任务'),
Expand Down Expand Up @@ -544,6 +550,7 @@ def __initLayout(self):
self.DailyGroup.addSettingCard(self.assistEnableCard)
# self.DailyGroup.addSettingCard(self.srpassEnableCard)
# self.DailyGroup.addSettingCard(self.dailyForgottenhallEnableCard)
self.DailyGroup.addSettingCard(self.dailyUniverseEnableCard)
self.DailyGroup.addSettingCard(self.dailyHimekoTryEnableCard)
self.DailyGroup.addSettingCard(self.dailyMemoryOneEnableCard)
self.DailyGroup.addSettingCard(self.dailyMemoryOneTeamCard)
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_universe_enable: false # 通过 “模拟宇宙” 完成任务
daily_himeko_try_enable: false # 通过 “姬子试用” 完成任务
daily_memory_one_enable: false # 通过 “回忆一” 完成任务
daily_memory_one_team: # 用于回忆一的队伍
Expand Down
4 changes: 2 additions & 2 deletions tasks/daily/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ def daily():
"累计消灭20个敌人": lambda: ForgottenHall.enemy_20(),
"利用弱点进入战斗并获胜3次": lambda: ForgottenHall.weakness_to_fight(),
"施放终结技造成制胜一击1次": lambda: ForgottenHall.ultimate(),
"通关「模拟宇宙」(任意世界)的1个区域": lambda: Universe.start(get_reward=False, nums=1, save=False),
"完成1次「模拟宇宙」": lambda: Universe.start(get_reward=False, nums=1, save=False),
"通关「模拟宇宙」(任意世界)的1个区域": lambda: Universe.run_daily(),
"完成1次「模拟宇宙」": lambda: Universe.run_daily(),
}

logger.hr(_("今日实训"), 2)
Expand Down
5 changes: 5 additions & 0 deletions tasks/weekly/universe.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,8 @@ def gui():
if subprocess.run(["start", "gui.exe"], shell=True, check=True, cwd=config.universe_path, env=config.env):
return True
return False

@staticmethod
def run_daily():
if config.daily_universe_enable:
return Universe.start(get_reward=False, nums=1, save=False)

0 comments on commit 25409a0

Please sign in to comment.