Skip to content

Commit

Permalink
feat: PureFiction
Browse files Browse the repository at this point in the history
  • Loading branch information
moesnow committed Jan 8, 2024
1 parent 2ae33ad commit 1c08a58
Show file tree
Hide file tree
Showing 21 changed files with 553 additions and 81 deletions.
5 changes: 3 additions & 2 deletions app/home_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ def paintEvent(self, e):
image_height = self.width() * self.banner.height() // self.banner.width()

# draw banner image with aspect ratio preservation
pixmap = self.banner.scaled(self.width(), image_height, aspectRatioMode=Qt.KeepAspectRatio, transformMode=Qt.SmoothTransformation)
pixmap = self.banner.scaled(
self.width(), image_height, aspectRatioMode=Qt.KeepAspectRatio, transformMode=Qt.SmoothTransformation)
path.addRect(QRectF(0, h, w, self.height() - h))
painter.fillPath(path, QBrush(pixmap))

Expand Down Expand Up @@ -147,7 +148,7 @@ def loadSamples(self):
)
basicInputView.addSampleCard(
icon="./assets/app/images/Bronya.jpg",
title="忘却之庭",
title="逐光捡金",
action="forgottenhall"
)

Expand Down
88 changes: 80 additions & 8 deletions app/setting_interface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# coding:utf-8
from qfluentwidgets import (SettingCardGroup, PushSettingCard, ScrollArea, InfoBar, PrimaryPushSettingCard, Pivot, qrouter)
from qfluentwidgets import (SettingCardGroup, PushSettingCard, ScrollArea,
InfoBar, PrimaryPushSettingCard, Pivot, qrouter)
from qfluentwidgets import FluentIcon as FIF
from PyQt5.QtCore import Qt, QUrl
from PyQt5.QtWidgets import QWidget, QLabel, QFileDialog, QVBoxLayout, QStackedWidget
Expand Down Expand Up @@ -69,7 +70,8 @@ def __init__(self, parent=None):
FIF.POWER_BUTTON,
self.tr('任务完成后'),
self.tr('其中“退出”指退出游戏,“循环”指根据开拓力7×24小时无人值守循环运行程序(仅限完整运行生效)'),
texts={'无': 'None', '退出': 'Exit', '循环': 'Loop', '关机': 'Shutdown', '休眠': 'Hibernate', '睡眠': 'Sleep'}
texts={'无': 'None', '退出': 'Exit', '循环': 'Loop',
'关机': 'Shutdown', '休眠': 'Hibernate', '睡眠': 'Sleep'}
)
self.playAudioCard = SwitchSettingCard1(
FIF.ALBUM,
Expand Down Expand Up @@ -332,7 +334,8 @@ def __init__(self, parent=None):
None
)

self.UniverseGroup = SettingCardGroup(self.tr("模拟宇宙 (Auto_Simulated_Universe)"), self.scrollWidget)
self.UniverseGroup = SettingCardGroup(
self.tr("模拟宇宙 (Auto_Simulated_Universe)"), self.scrollWidget)
self.universeEnableCard = SwitchSettingCard1(
FIF.VPN,
self.tr('启用模拟宇宙'),
Expand Down Expand Up @@ -435,7 +438,8 @@ def __init__(self, parent=None):
self.tr('打开角色文件夹'),
FIF.INFO,
self.tr("↓↓混沌回忆队伍↓↓"),
self.tr("数字代表秘技使用次数,其中 -1 代表最后一个放秘技和普攻的角色\n角色对应的英文名字可以在 \"March7thAssistant\\assets\\images\\character\" 中查看")
self.tr(
"数字代表秘技使用次数,其中 -1 代表最后一个放秘技和普攻的角色\n角色对应的英文名字可以在 \"March7thAssistant\\assets\\images\\character\" 中查看")
)
self.forgottenhallTeam1Card = PushSettingCardEval(
self.tr('修改'),
Expand All @@ -456,6 +460,58 @@ def __init__(self, parent=None):
"forgottenhall_timestamp"
)

self.PureFictionGroup = SettingCardGroup(self.tr("虚构叙事"), self.scrollWidget)
self.purefictionEnableCard = SwitchSettingCard1(
FIF.TILES,
self.tr('启用虚构叙事'),
"",
# self.tr('仅限完整运行生效'),
"purefiction_enable"
)
self.purefictionLevelCard = PushSettingCardEval(
self.tr('修改'),
FIF.MINIMIZE,
self.tr("关卡范围"),
"purefiction_level"
)
# self.forgottenhallRetriesCard = PushSettingCardEval(
# self.tr('修改'),
# FIF.REMOVE_FROM,
# self.tr("混沌回忆挑战失败后的重试次数"),
# "forgottenhall_retries"
# )
# self.purefictionRetriesCard = RangeSettingCard1(
# "purefiction_retries",
# [0, 10],
# FIF.REMOVE_FROM,
# self.tr("重试次数"),
# )
self.purefictionTeamInfoCard = PrimaryPushSettingCard(
self.tr('打开角色文件夹'),
FIF.INFO,
self.tr("↓↓混沌回忆队伍↓↓"),
self.tr(
"数字代表秘技使用次数,其中 -1 代表最后一个放秘技和普攻的角色\n角色对应的英文名字可以在 \"March7thAssistant\\assets\\images\\character\" 中查看")
)
self.purefictionTeam1Card = PushSettingCardEval(
self.tr('修改'),
FIF.FLAG,
self.tr("虚构叙事队伍1"),
"purefiction_team1"
)
self.purefictionTeam2Card = PushSettingCardEval(
self.tr('修改'),
FIF.FLAG,
self.tr("虚构叙事队伍2"),
"purefiction_team2"
)
self.purefictionRunTimeCard = PushSettingCardDate(
self.tr('修改'),
FIF.DATE_TIME,
self.tr("上次运行虚构叙事的时间"),
"purefiction_timestamp"
)

self.NotifyGroup = SettingCardGroup(self.tr("消息推送"), self.scrollWidget)
self.testNotifyCard = PrimaryPushSettingCard(
self.tr('发送消息'),
Expand Down Expand Up @@ -611,6 +667,14 @@ def __initLayout(self):
self.ForgottenhallGroup.addSettingCard(self.forgottenhallTeam2Card)
self.ForgottenhallGroup.addSettingCard(self.forgottenhallRunTimeCard)

self.PureFictionGroup.addSettingCard(self.purefictionEnableCard)
self.PureFictionGroup.addSettingCard(self.purefictionLevelCard)
# self.PureFictionGroup.addSettingCard(self.purefictionRetriesCard)
self.PureFictionGroup.addSettingCard(self.purefictionTeamInfoCard)
self.PureFictionGroup.addSettingCard(self.purefictionTeam1Card)
self.PureFictionGroup.addSettingCard(self.purefictionTeam2Card)
self.PureFictionGroup.addSettingCard(self.purefictionRunTimeCard)

self.NotifyGroup.addSettingCard(self.testNotifyCard)
self.NotifyGroup.addSettingCard(self.winotifyEnableCard)

Expand All @@ -632,6 +696,7 @@ def __initLayout(self):
self.FightGroup.titleLabel.setHidden(True)
self.UniverseGroup.titleLabel.setHidden(True)
self.ForgottenhallGroup.titleLabel.setHidden(True)
self.PureFictionGroup.titleLabel.setHidden(True)
self.NotifyGroup.titleLabel.setHidden(True)
self.KeybindingGroup.titleLabel.setHidden(True)
self.AboutGroup.titleLabel.setHidden(True)
Expand All @@ -645,6 +710,7 @@ def __initLayout(self):
self.addSubInterface(self.FightGroup, 'FightInterface', self.tr('锄大地'))
self.addSubInterface(self.UniverseGroup, 'UniverseInterface', self.tr('模拟宇宙'))
self.addSubInterface(self.ForgottenhallGroup, 'ForgottenhallInterface', self.tr('忘却之庭'))
self.addSubInterface(self.PureFictionGroup, 'PureFictionInterface', self.tr('虚构叙事'))
self.addSubInterface(self.NotifyGroup, 'NotifyInterface', self.tr('推送'))
self.addSubInterface(self.KeybindingGroup, 'KeybindingInterface', self.tr('按键'))
self.addSubInterface(self.AboutGroup, 'AboutInterface', self.tr('关于'))
Expand Down Expand Up @@ -733,7 +799,10 @@ def __connectSignalToSlot(self):
self.gameScreenshotCard.clicked.connect(self.__onGameScreenshotCardClicked)
self.gamePathCard.clicked.connect(self.__onGamePathCardClicked)

self.forgottenhallTeamInfoCard.clicked.connect(lambda: subprocess.check_call("start /WAIT explorer .\\assets\\images\\character", shell=True))
self.forgottenhallTeamInfoCard.clicked.connect(lambda: subprocess.check_call(
"start /WAIT explorer .\\assets\\images\\character", shell=True))
self.purefictionTeamInfoCard.clicked.connect(lambda: subprocess.check_call(
"start /WAIT explorer .\\assets\\images\\character", shell=True))

self.guiUniverseCard.clicked.connect(lambda: start_task("universe_gui"))
self.guiFightCard.clicked.connect(lambda: start_task("fight_gui"))
Expand All @@ -742,8 +811,11 @@ def __connectSignalToSlot(self):

self.testNotifyCard.clicked.connect(lambda: start_task("notify"))

self.githubCard.clicked.connect(lambda: QDesktopServices.openUrl(QUrl("https://github.com/moesnow/March7thAssistant")))
self.qqGroupCard.clicked.connect(lambda: QDesktopServices.openUrl(QUrl("https://qm.qq.com/q/9gFqUrUGVq")))
self.feedbackCard.clicked.connect(lambda: QDesktopServices.openUrl(QUrl("https://github.com/moesnow/March7thAssistant/issues")))
self.githubCard.clicked.connect(lambda: QDesktopServices.openUrl(
QUrl("https://github.com/moesnow/March7thAssistant")))
self.qqGroupCard.clicked.connect(lambda: QDesktopServices.openUrl(
QUrl("https://qm.qq.com/q/9gFqUrUGVq")))
self.feedbackCard.clicked.connect(lambda: QDesktopServices.openUrl(
QUrl("https://github.com/moesnow/March7thAssistant/issues")))

self.aboutCard.clicked.connect(lambda: checkUpdate(self.parent))
43 changes: 34 additions & 9 deletions assets/config/config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,27 +105,52 @@ forgottenhall_retries: 1 # 混沌回忆挑战失败后的重试次数
# 数字代表秘技使用次数,其中 -1 代表最后一个放秘技和普攻的角色
# 角色对应的英文名字可以在 "March7thAssistant\assets\images\character" 中查看
forgottenhall_team1: # 队伍1
- -
Asta
- - Asta
- -1
- - Natasha
- 0
- - JingYuan
- 1
- - Tingyun
- 2
- - JingYuan
- - Huohuo
- 1
forgottenhall_team2: # 队伍2
- -
Bronya
- - FuXuan
- 1
- - Luocha
- - Bronya
- 1
- - SilverWolf
- - Pela
- -1
- - Qingque
- 1
forgottenhall_timestamp: 0 # 上次运行混沌回忆的时间戳(每周运行,如已经满星则跳过)

purefiction_enable: false # 启用虚构叙事
purefiction_level: # 虚构叙事关卡范围
- 3
- 4
# 虚构叙事队伍
# 数字代表秘技使用次数,其中 -1 代表最后一个放秘技和普攻的角色
# 角色对应的英文名字可以在 "March7thAssistant\assets\images\character" 中查看
purefiction_team1: # 队伍1
- - Asta
- -1
- - JingYuan
- 1
- - Tingyun
- 2
- - Huohuo
- 1
purefiction_team2: # 队伍2
- - FuXuan
- 1
- - Bronya
- 1
- - Pela
- -1
- - Qingque
- 1
purefiction_timestamp: 0 # 上次运行虚构叙事的时间戳(每周运行,如已经满星则跳过)

auto_battle_detect_enable: true # 启用自动战斗检测
hotkey_technique: e # 游戏内设置的秘技按键

Expand Down
Loading

0 comments on commit 1c08a58

Please sign in to comment.