Skip to content

Commit

Permalink
feat: universe_count
Browse files Browse the repository at this point in the history
  • Loading branch information
moesnow committed Oct 21, 2023
1 parent 3389999 commit 5690d6a
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 6 deletions.
8 changes: 8 additions & 0 deletions app/setting_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,13 @@ def __init__(self, parent=None):
None,
"universe_bonus_enable"
)
self.universeCountCard = RangeSettingCard1(
"universe_count",
[0, 34],
FIF.HISTORY,
self.tr("运行次数"),
self.tr("注意中途停止不会计数,0 代表不指定,使用模拟宇宙原版逻辑"),
)
self.guiUniverseCard = PrimaryPushSettingCard(
self.tr('启动'),
FIF.SETTING,
Expand Down Expand Up @@ -544,6 +551,7 @@ def __initLayout(self):
# self.UniverseGroup.addSettingCard(self.universePathCard)
self.UniverseGroup.addSettingCard(self.universeTimeoutCard)
self.UniverseGroup.addSettingCard(self.universeBonusEnableCard)
self.UniverseGroup.addSettingCard(self.universeCountCard)
self.UniverseGroup.addSettingCard(self.universeRunTimeCard)
self.UniverseGroup.addSettingCard(self.guiUniverseCard)
self.UniverseGroup.addSettingCard(self.updateUniverseCard)
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 @@ -86,6 +86,7 @@ fight_timestamp: 0 # 上次运行锄大地的时间戳(每天运行)
universe_enable: false # 启用模拟宇宙
# universe_operation_mode: exe # 运行方式 源码: source 集成: exe
universe_bonus_enable: false # 领取沉浸奖励
universe_count: 34 # 运行次数
universe_path: .\3rdparty\Auto_Simulated_Universe # 模拟宇宙路径
universe_timeout: 20 # 模拟宇宙超时(单位小时)
universe_requirements: false # 是否安装过依赖(更新后会重置为false)
Expand Down
40 changes: 37 additions & 3 deletions assets/config/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@
"image_path": "./assets/images/screen/universe/leave_temporarily.png",
"actions": [
{
"target_screen": "main",
"target_screen": "universe_report",
"actions_list": [
{
"action": "auto.click_element",
Expand All @@ -445,7 +445,40 @@
{
"action": "time.sleep",
"args": [
2
1
]
},
{
"action": "auto.click_element",
"args": [
"./assets/images/base/confirm.png",
"image",
0.9,
10
]
},
{
"action": "time.sleep",
"args": [
4
]
}
]
}
]
},
{
"name": "模拟宇宙-分析报告",
"id": "universe_report",
"image_path": "./assets/images/screen/universe/universe_report.png",
"actions": [
{
"target_screen": "universe_main",
"actions_list": [
{
"action": "auto.press_key",
"args": [
"esc"
]
}
]
Expand Down Expand Up @@ -1210,7 +1243,8 @@
"args": [
"./assets/images/base/confirm.png",
"image",
0.9
0.9,
10
]
}
]
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,9 +3,10 @@
## v1.6.4

### 新功能
- 支持自定义模拟宇宙每周运行次数
- 支持完成“通关「模拟宇宙」(任意世界)的1个区域”
- 支持“开拓者(穹)•毁灭”和“开拓者(穹)•存护” [#26](https://github.com/moesnow/March7thAssistant/pull/26)
- 增加模拟宇宙完整性检测 [#27](https://github.com/moesnow/March7thAssistant/pull/27)
- 支持“开拓者(穹)•毁灭”和“开拓者(穹)•存护” [#26](https://github.com/moesnow/March7thAssistant/pull/26)
### 修复
- 修复“游戏退出失败”的问题(回退实验性改动)

Expand Down
Binary file modified assets/images/screen/universe/leave_temporarily.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/screen/universe/universe_report.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions tasks/weekly/universe.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def before_start():
return check_result

@staticmethod
def start(get_reward=False, nums=None, save=True):
def start(get_reward=False, nums=config.universe_count, save=True):
logger.hr(_("准备模拟宇宙"), 2)
if Universe.before_start():

Expand All @@ -75,7 +75,6 @@ def start(get_reward=False, nums=None, save=True):
command.append(f"--nums={nums}")
if subprocess_with_timeout(command, config.universe_timeout * 3600, config.universe_path, config.env):

screen.change_to('main')
if save:
config.save_timestamp("universe_timestamp")
if get_reward:
Expand Down

0 comments on commit 5690d6a

Please sign in to comment.