diff --git a/ui/designer/components/chartAndScoreInput.ui b/ui/designer/components/chartAndScoreInput.ui
new file mode 100644
index 0000000..fb36bc3
--- /dev/null
+++ b/ui/designer/components/chartAndScoreInput.ui
@@ -0,0 +1,83 @@
+
+
+ ChartAndScoreInput
+
+
+
+ 0
+ 0
+ 400
+ 450
+
+
+
+ ChartAndScoreInput
+
+
+ -
+
+
+ selectChart
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+
+
+
+ -
+
+
+ editScore
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+
+
+
+
+
+
+
+ ChartSelector
+ QWidget
+ ui.implements.components.chartSelector
+ 1
+
+
+ ScoreEditor
+ QWidget
+ ui.implements.components.scoreEditor
+ 1
+
+
+
+
+
diff --git a/ui/designer/components/chartAndScoreInput_ui.py b/ui/designer/components/chartAndScoreInput_ui.py
new file mode 100644
index 0000000..592a880
--- /dev/null
+++ b/ui/designer/components/chartAndScoreInput_ui.py
@@ -0,0 +1,69 @@
+# -*- coding: utf-8 -*-
+
+################################################################################
+## Form generated from reading UI file 'chartAndScoreInput.ui'
+##
+## Created by: Qt User Interface Compiler version 6.5.2
+##
+## WARNING! All changes made in this file will be lost when recompiling UI file!
+################################################################################
+
+from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
+ QMetaObject, QObject, QPoint, QRect,
+ QSize, QTime, QUrl, Qt)
+from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
+ QFont, QFontDatabase, QGradient, QIcon,
+ QImage, QKeySequence, QLinearGradient, QPainter,
+ QPalette, QPixmap, QRadialGradient, QTransform)
+from PySide6.QtWidgets import (QApplication, QGroupBox, QSizePolicy, QVBoxLayout,
+ QWidget)
+
+from ui.implements.components.chartSelector import ChartSelector
+from ui.implements.components.scoreEditor import ScoreEditor
+
+class Ui_ChartAndScoreInput(object):
+ def setupUi(self, ChartAndScoreInput):
+ if not ChartAndScoreInput.objectName():
+ ChartAndScoreInput.setObjectName(u"ChartAndScoreInput")
+ ChartAndScoreInput.resize(400, 450)
+ ChartAndScoreInput.setWindowTitle(u"ChartAndScoreInput")
+ self.verticalLayout = QVBoxLayout(ChartAndScoreInput)
+ self.verticalLayout.setObjectName(u"verticalLayout")
+ self.groupBox = QGroupBox(ChartAndScoreInput)
+ self.groupBox.setObjectName(u"groupBox")
+ self.verticalLayout_2 = QVBoxLayout(self.groupBox)
+ self.verticalLayout_2.setObjectName(u"verticalLayout_2")
+ self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
+ self.chartSelector = ChartSelector(self.groupBox)
+ self.chartSelector.setObjectName(u"chartSelector")
+
+ self.verticalLayout_2.addWidget(self.chartSelector)
+
+
+ self.verticalLayout.addWidget(self.groupBox)
+
+ self.groupBox_2 = QGroupBox(ChartAndScoreInput)
+ self.groupBox_2.setObjectName(u"groupBox_2")
+ self.verticalLayout_3 = QVBoxLayout(self.groupBox_2)
+ self.verticalLayout_3.setObjectName(u"verticalLayout_3")
+ self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
+ self.scoreEditor = ScoreEditor(self.groupBox_2)
+ self.scoreEditor.setObjectName(u"scoreEditor")
+
+ self.verticalLayout_3.addWidget(self.scoreEditor)
+
+
+ self.verticalLayout.addWidget(self.groupBox_2)
+
+
+ self.retranslateUi(ChartAndScoreInput)
+
+ QMetaObject.connectSlotsByName(ChartAndScoreInput)
+ # setupUi
+
+ def retranslateUi(self, ChartAndScoreInput):
+ self.groupBox.setTitle(QCoreApplication.translate("ChartAndScoreInput", u"selectChart", None))
+ self.groupBox_2.setTitle(QCoreApplication.translate("ChartAndScoreInput", u"editScore", None))
+ pass
+ # retranslateUi
+
diff --git a/ui/designer/tabs/tabInputScore.ui b/ui/designer/tabs/tabInputScore.ui
index 3c61652..6077d33 100644
--- a/ui/designer/tabs/tabInputScore.ui
+++ b/ui/designer/tabs/tabInputScore.ui
@@ -6,7 +6,7 @@
0
0
- 514
+ 500
400
@@ -15,66 +15,15 @@
-
-
-
- tab.selectChart
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
-
-
-
- -
-
-
- tab.scoreEdit
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
-
-
+
- ChartSelector
+ ChartAndScoreInput
QWidget
- ui.implements.components.chartSelector
- 1
-
-
- ScoreEditor
- QWidget
- ui.implements.components.scoreEditor
+ ui.implements.components.chartAndScoreInput
1
diff --git a/ui/designer/tabs/tabInputScore_ui.py b/ui/designer/tabs/tabInputScore_ui.py
index 3172a4d..195e33f 100644
--- a/ui/designer/tabs/tabInputScore_ui.py
+++ b/ui/designer/tabs/tabInputScore_ui.py
@@ -1,69 +1,44 @@
-# -*- coding: utf-8 -*-
-
-################################################################################
-## Form generated from reading UI file 'tabInputScore.ui'
-##
-## Created by: Qt User Interface Compiler version 6.5.2
-##
-## WARNING! All changes made in this file will be lost when recompiling UI file!
-################################################################################
-
-from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
- QMetaObject, QObject, QPoint, QRect,
- QSize, QTime, QUrl, Qt)
-from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
- QFont, QFontDatabase, QGradient, QIcon,
- QImage, QKeySequence, QLinearGradient, QPainter,
- QPalette, QPixmap, QRadialGradient, QTransform)
-from PySide6.QtWidgets import (QApplication, QGroupBox, QSizePolicy, QVBoxLayout,
- QWidget)
-
-from ui.implements.components.chartSelector import ChartSelector
-from ui.implements.components.scoreEditor import ScoreEditor
-
-class Ui_TabInputScore(object):
- def setupUi(self, TabInputScore):
- if not TabInputScore.objectName():
- TabInputScore.setObjectName(u"TabInputScore")
- TabInputScore.resize(514, 400)
- TabInputScore.setWindowTitle(u"TabInputScore")
- self.verticalLayout = QVBoxLayout(TabInputScore)
- self.verticalLayout.setObjectName(u"verticalLayout")
- self.groupBox = QGroupBox(TabInputScore)
- self.groupBox.setObjectName(u"groupBox")
- self.verticalLayout_2 = QVBoxLayout(self.groupBox)
- self.verticalLayout_2.setObjectName(u"verticalLayout_2")
- self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
- self.chartSelector = ChartSelector(self.groupBox)
- self.chartSelector.setObjectName(u"chartSelector")
-
- self.verticalLayout_2.addWidget(self.chartSelector)
-
-
- self.verticalLayout.addWidget(self.groupBox)
-
- self.groupBox_2 = QGroupBox(TabInputScore)
- self.groupBox_2.setObjectName(u"groupBox_2")
- self.verticalLayout_3 = QVBoxLayout(self.groupBox_2)
- self.verticalLayout_3.setObjectName(u"verticalLayout_3")
- self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
- self.scoreEditor = ScoreEditor(self.groupBox_2)
- self.scoreEditor.setObjectName(u"scoreEditor")
-
- self.verticalLayout_3.addWidget(self.scoreEditor)
-
-
- self.verticalLayout.addWidget(self.groupBox_2)
-
-
- self.retranslateUi(TabInputScore)
-
- QMetaObject.connectSlotsByName(TabInputScore)
- # setupUi
-
- def retranslateUi(self, TabInputScore):
- self.groupBox.setTitle(QCoreApplication.translate("TabInputScore", u"tab.selectChart", None))
- self.groupBox_2.setTitle(QCoreApplication.translate("TabInputScore", u"tab.scoreEdit", None))
- pass
- # retranslateUi
-
+# -*- coding: utf-8 -*-
+
+################################################################################
+## Form generated from reading UI file 'tabInputScore.ui'
+##
+## Created by: Qt User Interface Compiler version 6.5.2
+##
+## WARNING! All changes made in this file will be lost when recompiling UI file!
+################################################################################
+
+from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
+ QMetaObject, QObject, QPoint, QRect,
+ QSize, QTime, QUrl, Qt)
+from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
+ QFont, QFontDatabase, QGradient, QIcon,
+ QImage, QKeySequence, QLinearGradient, QPainter,
+ QPalette, QPixmap, QRadialGradient, QTransform)
+from PySide6.QtWidgets import (QApplication, QSizePolicy, QVBoxLayout, QWidget)
+
+from ui.implements.components.chartAndScoreInput import ChartAndScoreInput
+
+class Ui_TabInputScore(object):
+ def setupUi(self, TabInputScore):
+ if not TabInputScore.objectName():
+ TabInputScore.setObjectName(u"TabInputScore")
+ TabInputScore.resize(500, 400)
+ TabInputScore.setWindowTitle(u"TabInputScore")
+ self.verticalLayout = QVBoxLayout(TabInputScore)
+ self.verticalLayout.setObjectName(u"verticalLayout")
+ self.chartAndScoreInput = ChartAndScoreInput(TabInputScore)
+ self.chartAndScoreInput.setObjectName(u"chartAndScoreInput")
+
+ self.verticalLayout.addWidget(self.chartAndScoreInput)
+
+
+ self.retranslateUi(TabInputScore)
+
+ QMetaObject.connectSlotsByName(TabInputScore)
+ # setupUi
+
+ def retranslateUi(self, TabInputScore):
+ pass
+ # retranslateUi
+
diff --git a/ui/implements/components/chartAndScoreInput.py b/ui/implements/components/chartAndScoreInput.py
new file mode 100644
index 0000000..ef4cade
--- /dev/null
+++ b/ui/implements/components/chartAndScoreInput.py
@@ -0,0 +1,27 @@
+from ui.designer.components.chartAndScoreInput_ui import Ui_ChartAndScoreInput
+from PySide6.QtWidgets import QWidget
+from PySide6.QtCore import Signal
+from ui.implements.components.songIdSelector import SongIdSelectorMode
+
+class ChartAndScoreInput(Ui_ChartAndScoreInput, QWidget):
+ scoreCommited = Signal()
+
+ def __init__(self, parent=None):
+ super().__init__(parent)
+ self.setupUi(self)
+
+ self.chartSelector.valueChanged.connect(self.updateScoreEditorChart)
+ self.scoreEditor.accepted.connect(self.commit)
+
+ def updateScoreEditorChart(self):
+ chart = self.chartSelector.value()
+ self.scoreEditor.setChart(chart)
+
+ def commit(self):
+ self.scoreCommited.emit()
+
+ def setSongIdSelectorMode(self, mode: SongIdSelectorMode):
+ self.chartSelector.setSongIdSelectorMode(mode)
+
+ def value(self):
+ return self.scoreEditor.value()
diff --git a/ui/implements/tabs/tabInputScore.py b/ui/implements/tabs/tabInputScore.py
index cb1b769..c54dafe 100644
--- a/ui/implements/tabs/tabInputScore.py
+++ b/ui/implements/tabs/tabInputScore.py
@@ -1,8 +1,5 @@
-import traceback
-
from arcaea_offline.database import Database
-from PySide6.QtCore import QCoreApplication, QModelIndex
-from PySide6.QtWidgets import QMessageBox, QWidget
+from PySide6.QtWidgets import QWidget
from ui.designer.tabs.tabInputScore_ui import Ui_TabInputScore
@@ -11,23 +8,14 @@ class TabInputScore(Ui_TabInputScore, QWidget):
def __init__(self, parent=None):
super().__init__(parent)
self.setupUi(self)
-
- self.chartSelector.valueChanged.connect(self.updateScoreEditorChart)
- self.scoreEditor.accepted.connect(self.commit)
-
- def updateScoreEditorChart(self):
- chart = self.chartSelector.value()
- self.scoreEditor.setChart(chart)
+ self.chartAndScoreInput.scoreCommited.connect(self.commit)
def commit(self):
- try:
- Database().insert_score(self.scoreEditor.value())
- self.scoreEditor.reset()
- except Exception as e:
- QMessageBox.critical(
- self,
- # fmt: off
- QCoreApplication.translate("General", "tracebackFormatExceptionOnly.title"),
- QCoreApplication.translate("General", "tracebackFormatExceptionOnly.content").format(traceback.format_exception_only(e))
- # fmt: on
- )
+ score = self.chartAndScoreInput.value()
+ if not score:
+ return
+ Database().insert_score(score)
+ self.chartAndScoreInput.scoreEditor.reset()
+ self.chartAndScoreInput.scoreEditor.setChart(
+ self.chartAndScoreInput.chartSelector.value()
+ )
diff --git a/ui/resources/lang/en_US.ts b/ui/resources/lang/en_US.ts
index 97322e1..9f557fb 100644
--- a/ui/resources/lang/en_US.ts
+++ b/ui/resources/lang/en_US.ts
@@ -1,6 +1,19 @@
+
+ ChartAndScoreInput
+
+
+ selectChart
+ Select a Chart
+
+
+
+ editScore
+ Edit Score
+
+
ChartSelector
@@ -160,19 +173,6 @@
Select...
-
- General
-
-
- tracebackFormatExceptionOnly.title
- Error
-
-
-
- tracebackFormatExceptionOnly.content
- Unexpected error<br>{0}
-
-
MainWindow
@@ -654,19 +654,6 @@ validation
Import packlist and songlist from .apk file
-
- TabInputScore
-
-
- tab.selectChart
- Select a Chart
-
-
-
- tab.scoreEdit
- Score Input
-
-
TabOcrDisabled
@@ -942,107 +929,112 @@ validation
TabTools_StepCalculator
-
+
legacyPlay.noOptions
No options
-
+
legacyPlayPlus.useFragments
Use Fragments
-
+
play.memoryBoost
Memory boost
-
+
partner.title
Partner
-
+
partner.stepValueLabel
STEP value
-
+
partner.skill.title
Partner Skill
-
+
partner.skill.stepBonus
Step bonus
-
+
partner.skill.finalMultiplier
Final multiplier
-
+
partner.skill.presets
Preset Datas
-
+
partner.skill.presets.awakenedEto
Eto (Awakened)
-
+
partner.skill.presets.awakenedIlith
Ilith (Awakened)
-
+
partner.skill.presets.awakenedLuna
Luna (Awakened)
-
+
partner.skill.presets.amaneBelowEx
Amane (Below EX)
-
+
partner.skill.presets.maya
Maya
-
+
calculate.toStep
Calculate to Step
-
+
calculate.toStep.playResultLabel
Play result
-
+
calculate.toStep.calculatePlayResultFromScoreButton
Calculate from Score
-
+
calculate.toStep.resultLabel
Result
-
+
+ detailedLogOutput
+
+
+
+
calculate.fromStep
Calculate from Step
-
+
calculate.fromStep.targetStepLabel
Target step value
-
+
calculate.fromStep.resultLabel
Result (play rating)
diff --git a/ui/resources/lang/zh_CN.ts b/ui/resources/lang/zh_CN.ts
index a0171f9..17509fb 100644
--- a/ui/resources/lang/zh_CN.ts
+++ b/ui/resources/lang/zh_CN.ts
@@ -1,6 +1,19 @@
+
+ ChartAndScoreInput
+
+
+ selectChart
+ 选择一个谱面
+
+
+
+ editScore
+ 编辑分数
+
+
ChartSelector
@@ -160,19 +173,6 @@
选择
-
- General
-
-
- tracebackFormatExceptionOnly.title
- 错误
-
-
-
- tracebackFormatExceptionOnly.content
- 错误:{0}
-
-
MainWindow
@@ -653,19 +653,6 @@
从 .apk 文件导入 packlist 和 songlist
-
- TabInputScore
-
-
- tab.selectChart
- 选择谱面
-
-
-
- tab.scoreEdit
- 录入分数
-
-
TabOcrDisabled
@@ -941,107 +928,112 @@
TabTools_StepCalculator
-
+
legacyPlay.noOptions
没有选项
-
+
legacyPlayPlus.useFragments
使用残片
-
+
play.memoryBoost
源韵强化
-
+
partner.title
搭档
-
+
partner.stepValueLabel
STEP 值
-
+
partner.skill.title
搭档技能
-
+
partner.skill.stepBonus
步数加成
-
+
partner.skill.finalMultiplier
最终乘算
-
+
partner.skill.presets
预置数据
-
+
partner.skill.presets.awakenedEto
爱托(觉醒)
-
+
partner.skill.presets.awakenedIlith
依莉丝(觉醒)
-
+
partner.skill.presets.awakenedLuna
露娜(觉醒)
-
+
partner.skill.presets.amaneBelowEx
天音(EX 以下)
-
+
partner.skill.presets.maya
摩耶
-
+
calculate.toStep
正算
-
+
calculate.toStep.playResultLabel
单曲 PTT
-
+
calculate.toStep.calculatePlayResultFromScoreButton
从分数计算
-
+
calculate.toStep.resultLabel
结果
-
+
+ detailedLogOutput
+
+
+
+
calculate.fromStep
逆算
-
+
calculate.fromStep.targetStepLabel
目标 STEP 值
-
+
calculate.fromStep.resultLabel
结果(单曲 PTT)