Skip to content

Commit

Permalink
重绘创建 5v5 练习模式功能卡片
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzaphkiel committed Sep 19, 2023
1 parent 4ca640b commit 3ee1dba
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 36 deletions.
Binary file modified app/resource/i18n/Seraphine.zh_CN.qm
Binary file not shown.
72 changes: 51 additions & 21 deletions app/resource/i18n/Seraphine.zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<context>
<name>AutoAcceptMatchingCard</name>
<message>
<location filename="../../view/auxiliary_interface.py" line="593"/>
<location filename="../../view/auxiliary_interface.py" line="635"/>
<source>Delay seconds after match made:</source>
<translation>在对局找到后接受对局前延迟的秒数:</translation>
</message>
Expand Down Expand Up @@ -34,17 +34,17 @@
<translation type="obsolete">已启用,延迟:</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="667"/>
<location filename="../../view/auxiliary_interface.py" line="709"/>
<source> seconds</source>
<translation> 秒</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="670"/>
<location filename="../../view/auxiliary_interface.py" line="712"/>
<source>Disabled</source>
<translation>未启用</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="667"/>
<location filename="../../view/auxiliary_interface.py" line="709"/>
<source>Enabled, delay: </source>
<translation>已启用,延迟:</translation>
</message>
Expand All @@ -62,7 +62,7 @@
<translation type="obsolete">关</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="722"/>
<location filename="../../view/auxiliary_interface.py" line="764"/>
<source>Champion name</source>
<translation>请输入英雄名</translation>
</message>
Expand All @@ -72,19 +72,19 @@
<translation type="obsolete">将要自动选择的英雄</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="737"/>
<location filename="../../view/auxiliary_interface.py" line="779"/>
<source>Enabled, champion: </source>
<translation>已启用,自动选择:</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="739"/>
<location filename="../../view/auxiliary_interface.py" line="781"/>
<source>Disabled</source>
<translation>未启用</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="684"/>
<location filename="../../view/auxiliary_interface.py" line="726"/>
<source>Champion will be seleted automatically:</source>
<translation>将要自动选择的英雄</translation>
<translation>将要自动选择的英雄</translation>
</message>
</context>
<context>
Expand Down Expand Up @@ -162,7 +162,7 @@
<message>
<location filename="../../view/auxiliary_interface.py" line="63"/>
<source>Password will NOT be set if line edit is empty</source>
<translation>编辑框留空则将不设置房间密码</translation>
<translation type="obsolete">编辑框留空则将不设置房间密码</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="68"/>
Expand Down Expand Up @@ -219,6 +219,11 @@
<source>Accept match making automatically after the number of seconds you set</source>
<translation>在你设置的秒数之后自动接收对局匹配</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="63"/>
<source>Only bots can be added to the lobby</source>
<translation>只能添加人机玩家</translation>
</message>
</context>
<context>
<name>CareerInterface</name>
Expand Down Expand Up @@ -386,23 +391,48 @@
<message>
<location filename="../../view/auxiliary_interface.py" line="500"/>
<source>Lobby name</source>
<translation>房间名</translation>
<translation type="obsolete">房间名</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="507"/>
<location filename="../../view/auxiliary_interface.py" line="513"/>
<source>Create</source>
<translation>创建</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="505"/>
<source>Lobby password</source>
<translation>房间密码</translation>
<translation type="obsolete">房间密码</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="502"/>
<source>Lobby&apos;s name: (cannot be empty)</source>
<translation>房间名:(不可为空)</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="506"/>
<source>Password: (can be empty)</source>
<translation type="obsolete">房间密码:(可为空)</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="549"/>
<source>Please input lobby&apos;s name</source>
<translation>请输入房间名</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="554"/>
<source>Please input password</source>
<translation>请输入房间密码</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="506"/>
<source>Password: (password will NOT be set if it&apos;s empty)</source>
<translation>房间密码:(若留空则不设密码)</translation>
</message>
</context>
<context>
<name>DodgeCard</name>
<message>
<location filename="../../view/auxiliary_interface.py" line="781"/>
<location filename="../../view/auxiliary_interface.py" line="823"/>
<source>Dodge</source>
<translation>秒退</translation>
</message>
Expand Down Expand Up @@ -1177,37 +1207,37 @@ when they are used by Seraphine, which will cost more time</source>
<context>
<name>SpectateCard</name>
<message>
<location filename="../../view/auxiliary_interface.py" line="542"/>
<location filename="../../view/auxiliary_interface.py" line="584"/>
<source>Summoner&apos;s name</source>
<translation>召唤师名</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="547"/>
<location filename="../../view/auxiliary_interface.py" line="589"/>
<source>Spectate</source>
<translation>观战</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="574"/>
<location filename="../../view/auxiliary_interface.py" line="616"/>
<source>Summoner not found</source>
<translation>召唤师未找到</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="574"/>
<location filename="../../view/auxiliary_interface.py" line="616"/>
<source>Please check the summoner&apos;s name and retry</source>
<translation>请检查召唤师名后重试</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="577"/>
<location filename="../../view/auxiliary_interface.py" line="619"/>
<source>Summoner isn&apos;t in game</source>
<translation>召唤师不在游戏中</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="579"/>
<location filename="../../view/auxiliary_interface.py" line="621"/>
<source>Spectate successfully</source>
<translation>观战拉起成功</translation>
</message>
<message>
<location filename="../../view/auxiliary_interface.py" line="579"/>
<location filename="../../view/auxiliary_interface.py" line="621"/>
<source>Please wait</source>
<translation>请等待游戏观战启动</translation>
</message>
Expand Down
72 changes: 57 additions & 15 deletions app/view/auxiliary_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init__(self, parent=None):

self.createPracticeLobbyCard = CreatePracticeLobbyCard(
self.tr("Create 5v5 practice lobby"),
self.tr("Password will NOT be set if line edit is empty"),
self.tr("Only bots can be added to the lobby"),
self.gameGroup)
# 自动接受对局
self.autoAcceptMatchingCard = AutoAcceptMatchingCard(
Expand Down Expand Up @@ -490,31 +490,73 @@ def __init__(self, title, content, parent):
target=lambda: connector.removeTokens()).start())


class CreatePracticeLobbyCard(SettingCard):
class CreatePracticeLobbyCard(ExpandGroupSettingCard):

def __init__(self, title, content, parent):
super().__init__(Icon.TEXTEDIT, title, content, parent)

self.inputWidget = QWidget(self.view)
self.inputLayout = QVBoxLayout(self.inputWidget)

self.nameLayout = QHBoxLayout()
self.nameLabel = QLabel(self.tr("Lobby's name: (cannot be empty)"))
self.nameLineEdit = LineEdit()
self.nameLineEdit.setMinimumWidth(216)
self.nameLineEdit.setClearButtonEnabled(True)
self.nameLineEdit.setPlaceholderText(self.tr("Lobby name"))

self.passwordLayout = QHBoxLayout()
self.passwordLabel = QLabel(
self.tr("Password: (password will NOT be set if it's empty)"))
self.passwordLineEdit = LineEdit()
self.passwordLineEdit.setMinimumWidth(190)
self.passwordLineEdit.setClearButtonEnabled(True)
self.passwordLineEdit.setPlaceholderText(self.tr("Lobby password"))

self.pushButtonWidget = QWidget(self.view)
self.pushButtonLayout = QHBoxLayout(self.pushButtonWidget)

self.pushButton = PushButton(self.tr("Create"))

self.__initLayout()
self.__initWidget()

def __initLayout(self):
self.inputLayout.setSpacing(19)
self.inputLayout.setAlignment(Qt.AlignTop)
self.inputLayout.setContentsMargins(48, 18, 44, 18)

self.nameLayout.setContentsMargins(0, 0, 0, 0)
self.nameLayout.addWidget(self.nameLabel, alignment=Qt.AlignLeft)
self.nameLayout.addWidget(self.nameLineEdit, alignment=Qt.AlignRight)

self.passwordLayout.setContentsMargins(0, 0, 0, 0)
self.passwordLayout.addWidget(
self.passwordLabel, alignment=Qt.AlignLeft)
self.passwordLayout.addWidget(
self.passwordLineEdit, alignment=Qt.AlignRight)

self.inputLayout.addLayout(self.nameLayout)
self.inputLayout.addLayout(self.passwordLayout)
self.inputLayout.setSizeConstraint(QHBoxLayout.SetMinimumSize)

self.pushButtonLayout.setContentsMargins(48, 18, 44, 18)
self.pushButtonLayout.addWidget(self.pushButton, 0, Qt.AlignRight)
self.pushButtonLayout.setSizeConstraint(QHBoxLayout.SetMinimumSize)

self.viewLayout.setSpacing(0)
self.viewLayout.setContentsMargins(0, 0, 0, 0)
self.addGroupWidget(self.inputWidget)
self.addGroupWidget(self.pushButtonWidget)

def __initWidget(self):
self.nameLineEdit.setMinimumWidth(250)
self.nameLineEdit.setClearButtonEnabled(True)
self.nameLineEdit.setPlaceholderText(
self.tr("Please input lobby's name"))

self.passwordLineEdit.setMinimumWidth(250)
self.passwordLineEdit.setClearButtonEnabled(True)
self.passwordLineEdit.setPlaceholderText(
self.tr("Please input password"))

self.pushButton.setMinimumWidth(100)
self.pushButton.setEnabled(False)

self.hBoxLayout.addWidget(self.nameLineEdit)
self.hBoxLayout.addSpacing(16)
self.hBoxLayout.addWidget(self.passwordLineEdit)
self.hBoxLayout.addSpacing(16)
self.hBoxLayout.addWidget(self.pushButton)
self.hBoxLayout.addSpacing(16)

self.nameLineEdit.textChanged.connect(self.__onNameLineEditTextChanged)
self.pushButton.clicked.connect(self.__onPushButtonClicked)

Expand Down

0 comments on commit 3ee1dba

Please sign in to comment.