mirror of
https://github.com/283375/arcaea-offline-pyside-ui.git
synced 2025-04-18 16:50:17 +00:00
impr: TabTools_StepCalculator
ui
This commit is contained in:
parent
5aedf91c09
commit
e0d92b7784
@ -165,7 +165,7 @@
|
|||||||
<widget class="QRadioButton" name="legacyPlayPlus_x125fragRadioButton">
|
<widget class="QRadioButton" name="legacyPlayPlus_x125fragRadioButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true">x1.25
|
<string notr="true">x1.25
|
||||||
125</string>
|
250</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -361,6 +361,13 @@
|
|||||||
<property name="labelAlignment">
|
<property name="labelAlignment">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
</property>
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>calculate.toStep.playResultLabel</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QDoubleSpinBox" name="calculate_toStep_playResultSpinBox">
|
<widget class="QDoubleSpinBox" name="calculate_toStep_playResultSpinBox">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -380,10 +387,10 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="1" column="1">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QPushButton" name="calculate_toStep_calculatePlayResultFromScoreButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>calculate.toStep.playResultLabel</string>
|
<string>calculate.toStep.calculatePlayResultFromScoreButton</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -401,24 +408,36 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QLabel" name="calculate_toStep_resultLabel">
|
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||||
<property name="sizePolicy">
|
<item>
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
<widget class="QLabel" name="calculate_toStep_resultLabel">
|
||||||
<horstretch>0</horstretch>
|
<property name="text">
|
||||||
<verstretch>0</verstretch>
|
<string notr="true">...</string>
|
||||||
</sizepolicy>
|
</property>
|
||||||
</property>
|
<property name="alignment">
|
||||||
<property name="text">
|
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
||||||
<string notr="true">...</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
<item>
|
||||||
<item row="1" column="1">
|
<widget class="QLabel" name="calculate_toStep_detailedResultLabel">
|
||||||
<widget class="QPushButton" name="calculate_toStep_calculatePlayResultFromScoreButton">
|
<property name="font">
|
||||||
<property name="text">
|
<font>
|
||||||
<string>calculate.toStep.calculatePlayResultFromScoreButton</string>
|
<pointsize>8</pointsize>
|
||||||
</property>
|
</font>
|
||||||
</widget>
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QLabel { color: gray; }</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@ -463,17 +482,36 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QLabel" name="calculate_fromStep_resultLabel">
|
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||||
<property name="sizePolicy">
|
<item>
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
<widget class="QLabel" name="calculate_fromStep_resultLabel">
|
||||||
<horstretch>0</horstretch>
|
<property name="text">
|
||||||
<verstretch>0</verstretch>
|
<string notr="true">...</string>
|
||||||
</sizepolicy>
|
</property>
|
||||||
</property>
|
<property name="alignment">
|
||||||
<property name="text">
|
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
||||||
<string notr="true">...</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="calculate_fromStep_detailedResultLabel">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>8</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QLabel { color: gray; }</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -137,7 +137,7 @@ class Ui_TabTools_StepCalculator(object):
|
|||||||
self.legacyPlayPlus_x125fragRadioButton = QRadioButton(self.legacyPlayPlus_useFragmentsGroupBox)
|
self.legacyPlayPlus_x125fragRadioButton = QRadioButton(self.legacyPlayPlus_useFragmentsGroupBox)
|
||||||
self.legacyPlayPlus_x125fragRadioButton.setObjectName(u"legacyPlayPlus_x125fragRadioButton")
|
self.legacyPlayPlus_x125fragRadioButton.setObjectName(u"legacyPlayPlus_x125fragRadioButton")
|
||||||
self.legacyPlayPlus_x125fragRadioButton.setText(u"x1.25\n"
|
self.legacyPlayPlus_x125fragRadioButton.setText(u"x1.25\n"
|
||||||
"125")
|
"250")
|
||||||
|
|
||||||
self.horizontalLayout_3.addWidget(self.legacyPlayPlus_x125fragRadioButton)
|
self.horizontalLayout_3.addWidget(self.legacyPlayPlus_x125fragRadioButton)
|
||||||
|
|
||||||
@ -288,6 +288,11 @@ class Ui_TabTools_StepCalculator(object):
|
|||||||
self.formLayout_2 = QFormLayout(self.groupBox)
|
self.formLayout_2 = QFormLayout(self.groupBox)
|
||||||
self.formLayout_2.setObjectName(u"formLayout_2")
|
self.formLayout_2.setObjectName(u"formLayout_2")
|
||||||
self.formLayout_2.setLabelAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter)
|
self.formLayout_2.setLabelAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter)
|
||||||
|
self.label_2 = QLabel(self.groupBox)
|
||||||
|
self.label_2.setObjectName(u"label_2")
|
||||||
|
|
||||||
|
self.formLayout_2.setWidget(0, QFormLayout.LabelRole, self.label_2)
|
||||||
|
|
||||||
self.calculate_toStep_playResultSpinBox = QDoubleSpinBox(self.groupBox)
|
self.calculate_toStep_playResultSpinBox = QDoubleSpinBox(self.groupBox)
|
||||||
self.calculate_toStep_playResultSpinBox.setObjectName(u"calculate_toStep_playResultSpinBox")
|
self.calculate_toStep_playResultSpinBox.setObjectName(u"calculate_toStep_playResultSpinBox")
|
||||||
sizePolicy2.setHeightForWidth(self.calculate_toStep_playResultSpinBox.sizePolicy().hasHeightForWidth())
|
sizePolicy2.setHeightForWidth(self.calculate_toStep_playResultSpinBox.sizePolicy().hasHeightForWidth())
|
||||||
@ -298,10 +303,10 @@ class Ui_TabTools_StepCalculator(object):
|
|||||||
|
|
||||||
self.formLayout_2.setWidget(0, QFormLayout.FieldRole, self.calculate_toStep_playResultSpinBox)
|
self.formLayout_2.setWidget(0, QFormLayout.FieldRole, self.calculate_toStep_playResultSpinBox)
|
||||||
|
|
||||||
self.label_2 = QLabel(self.groupBox)
|
self.calculate_toStep_calculatePlayResultFromScoreButton = QPushButton(self.groupBox)
|
||||||
self.label_2.setObjectName(u"label_2")
|
self.calculate_toStep_calculatePlayResultFromScoreButton.setObjectName(u"calculate_toStep_calculatePlayResultFromScoreButton")
|
||||||
|
|
||||||
self.formLayout_2.setWidget(0, QFormLayout.LabelRole, self.label_2)
|
self.formLayout_2.setWidget(1, QFormLayout.FieldRole, self.calculate_toStep_calculatePlayResultFromScoreButton)
|
||||||
|
|
||||||
self.label_7 = QLabel(self.groupBox)
|
self.label_7 = QLabel(self.groupBox)
|
||||||
self.label_7.setObjectName(u"label_7")
|
self.label_7.setObjectName(u"label_7")
|
||||||
@ -310,18 +315,28 @@ class Ui_TabTools_StepCalculator(object):
|
|||||||
|
|
||||||
self.formLayout_2.setWidget(2, QFormLayout.LabelRole, self.label_7)
|
self.formLayout_2.setWidget(2, QFormLayout.LabelRole, self.label_7)
|
||||||
|
|
||||||
|
self.verticalLayout_9 = QVBoxLayout()
|
||||||
|
self.verticalLayout_9.setObjectName(u"verticalLayout_9")
|
||||||
self.calculate_toStep_resultLabel = QLabel(self.groupBox)
|
self.calculate_toStep_resultLabel = QLabel(self.groupBox)
|
||||||
self.calculate_toStep_resultLabel.setObjectName(u"calculate_toStep_resultLabel")
|
self.calculate_toStep_resultLabel.setObjectName(u"calculate_toStep_resultLabel")
|
||||||
sizePolicy4.setHeightForWidth(self.calculate_toStep_resultLabel.sizePolicy().hasHeightForWidth())
|
|
||||||
self.calculate_toStep_resultLabel.setSizePolicy(sizePolicy4)
|
|
||||||
self.calculate_toStep_resultLabel.setText(u"...")
|
self.calculate_toStep_resultLabel.setText(u"...")
|
||||||
|
self.calculate_toStep_resultLabel.setAlignment(Qt.AlignBottom|Qt.AlignLeading|Qt.AlignLeft)
|
||||||
|
|
||||||
self.formLayout_2.setWidget(2, QFormLayout.FieldRole, self.calculate_toStep_resultLabel)
|
self.verticalLayout_9.addWidget(self.calculate_toStep_resultLabel)
|
||||||
|
|
||||||
self.calculate_toStep_calculatePlayResultFromScoreButton = QPushButton(self.groupBox)
|
self.calculate_toStep_detailedResultLabel = QLabel(self.groupBox)
|
||||||
self.calculate_toStep_calculatePlayResultFromScoreButton.setObjectName(u"calculate_toStep_calculatePlayResultFromScoreButton")
|
self.calculate_toStep_detailedResultLabel.setObjectName(u"calculate_toStep_detailedResultLabel")
|
||||||
|
font = QFont()
|
||||||
|
font.setPointSize(8)
|
||||||
|
self.calculate_toStep_detailedResultLabel.setFont(font)
|
||||||
|
self.calculate_toStep_detailedResultLabel.setStyleSheet(u"QLabel { color: gray; }")
|
||||||
|
self.calculate_toStep_detailedResultLabel.setText(u"...")
|
||||||
|
self.calculate_toStep_detailedResultLabel.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop)
|
||||||
|
|
||||||
self.formLayout_2.setWidget(1, QFormLayout.FieldRole, self.calculate_toStep_calculatePlayResultFromScoreButton)
|
self.verticalLayout_9.addWidget(self.calculate_toStep_detailedResultLabel)
|
||||||
|
|
||||||
|
|
||||||
|
self.formLayout_2.setLayout(2, QFormLayout.FieldRole, self.verticalLayout_9)
|
||||||
|
|
||||||
|
|
||||||
self.horizontalLayout_4.addWidget(self.groupBox)
|
self.horizontalLayout_4.addWidget(self.groupBox)
|
||||||
@ -350,13 +365,26 @@ class Ui_TabTools_StepCalculator(object):
|
|||||||
|
|
||||||
self.formLayout_3.setWidget(1, QFormLayout.LabelRole, self.label_9)
|
self.formLayout_3.setWidget(1, QFormLayout.LabelRole, self.label_9)
|
||||||
|
|
||||||
|
self.verticalLayout_10 = QVBoxLayout()
|
||||||
|
self.verticalLayout_10.setObjectName(u"verticalLayout_10")
|
||||||
self.calculate_fromStep_resultLabel = QLabel(self.groupBox_2)
|
self.calculate_fromStep_resultLabel = QLabel(self.groupBox_2)
|
||||||
self.calculate_fromStep_resultLabel.setObjectName(u"calculate_fromStep_resultLabel")
|
self.calculate_fromStep_resultLabel.setObjectName(u"calculate_fromStep_resultLabel")
|
||||||
sizePolicy4.setHeightForWidth(self.calculate_fromStep_resultLabel.sizePolicy().hasHeightForWidth())
|
|
||||||
self.calculate_fromStep_resultLabel.setSizePolicy(sizePolicy4)
|
|
||||||
self.calculate_fromStep_resultLabel.setText(u"...")
|
self.calculate_fromStep_resultLabel.setText(u"...")
|
||||||
|
self.calculate_fromStep_resultLabel.setAlignment(Qt.AlignBottom|Qt.AlignLeading|Qt.AlignLeft)
|
||||||
|
|
||||||
self.formLayout_3.setWidget(1, QFormLayout.FieldRole, self.calculate_fromStep_resultLabel)
|
self.verticalLayout_10.addWidget(self.calculate_fromStep_resultLabel)
|
||||||
|
|
||||||
|
self.calculate_fromStep_detailedResultLabel = QLabel(self.groupBox_2)
|
||||||
|
self.calculate_fromStep_detailedResultLabel.setObjectName(u"calculate_fromStep_detailedResultLabel")
|
||||||
|
self.calculate_fromStep_detailedResultLabel.setFont(font)
|
||||||
|
self.calculate_fromStep_detailedResultLabel.setStyleSheet(u"QLabel { color: gray; }")
|
||||||
|
self.calculate_fromStep_detailedResultLabel.setText(u"...")
|
||||||
|
self.calculate_fromStep_detailedResultLabel.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop)
|
||||||
|
|
||||||
|
self.verticalLayout_10.addWidget(self.calculate_fromStep_detailedResultLabel)
|
||||||
|
|
||||||
|
|
||||||
|
self.formLayout_3.setLayout(1, QFormLayout.FieldRole, self.verticalLayout_10)
|
||||||
|
|
||||||
|
|
||||||
self.horizontalLayout_4.addWidget(self.groupBox_2)
|
self.horizontalLayout_4.addWidget(self.groupBox_2)
|
||||||
@ -394,8 +422,8 @@ class Ui_TabTools_StepCalculator(object):
|
|||||||
self.partnerSkillPresetButton_maya.setText(QCoreApplication.translate("TabTools_StepCalculator", u"partner.skill.presets.maya", None))
|
self.partnerSkillPresetButton_maya.setText(QCoreApplication.translate("TabTools_StepCalculator", u"partner.skill.presets.maya", None))
|
||||||
self.groupBox.setTitle(QCoreApplication.translate("TabTools_StepCalculator", u"calculate.toStep", None))
|
self.groupBox.setTitle(QCoreApplication.translate("TabTools_StepCalculator", u"calculate.toStep", None))
|
||||||
self.label_2.setText(QCoreApplication.translate("TabTools_StepCalculator", u"calculate.toStep.playResultLabel", None))
|
self.label_2.setText(QCoreApplication.translate("TabTools_StepCalculator", u"calculate.toStep.playResultLabel", None))
|
||||||
self.label_7.setText(QCoreApplication.translate("TabTools_StepCalculator", u"calculate.toStep.resultLabel", None))
|
|
||||||
self.calculate_toStep_calculatePlayResultFromScoreButton.setText(QCoreApplication.translate("TabTools_StepCalculator", u"calculate.toStep.calculatePlayResultFromScoreButton", None))
|
self.calculate_toStep_calculatePlayResultFromScoreButton.setText(QCoreApplication.translate("TabTools_StepCalculator", u"calculate.toStep.calculatePlayResultFromScoreButton", None))
|
||||||
|
self.label_7.setText(QCoreApplication.translate("TabTools_StepCalculator", u"calculate.toStep.resultLabel", None))
|
||||||
self.groupBox_2.setTitle(QCoreApplication.translate("TabTools_StepCalculator", u"calculate.fromStep", None))
|
self.groupBox_2.setTitle(QCoreApplication.translate("TabTools_StepCalculator", u"calculate.fromStep", None))
|
||||||
self.label_4.setText(QCoreApplication.translate("TabTools_StepCalculator", u"calculate.fromStep.targetStepLabel", None))
|
self.label_4.setText(QCoreApplication.translate("TabTools_StepCalculator", u"calculate.fromStep.targetStepLabel", None))
|
||||||
self.label_9.setText(QCoreApplication.translate("TabTools_StepCalculator", u"calculate.fromStep.resultLabel", None))
|
self.label_9.setText(QCoreApplication.translate("TabTools_StepCalculator", u"calculate.fromStep.resultLabel", None))
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from arcaea_offline.calculate import calculate_play_rating
|
|
||||||
from arcaea_offline.calculate.world_step import (
|
from arcaea_offline.calculate.world_step import (
|
||||||
AmaneBelowExPartnerBonus,
|
AmaneBelowExPartnerBonus,
|
||||||
AwakenedEtoPartnerBonus,
|
AwakenedEtoPartnerBonus,
|
||||||
@ -15,14 +14,22 @@ from arcaea_offline.calculate.world_step import (
|
|||||||
calculate_step,
|
calculate_step,
|
||||||
calculate_step_original,
|
calculate_step_original,
|
||||||
)
|
)
|
||||||
from arcaea_offline.models import Chart, Score
|
from PySide6.QtCore import (
|
||||||
from PySide6.QtCore import QEasingCurve, QObject, QSize, Qt, QTimeLine
|
QCoreApplication,
|
||||||
from PySide6.QtGui import QIcon, QPainter, QPaintEvent, QPixmap
|
QEasingCurve,
|
||||||
|
QObject,
|
||||||
|
QSize,
|
||||||
|
QTimeLine,
|
||||||
|
Signal,
|
||||||
|
)
|
||||||
|
from PySide6.QtGui import QIcon, QPixmap
|
||||||
from PySide6.QtWidgets import (
|
from PySide6.QtWidgets import (
|
||||||
QAbstractButton,
|
QAbstractButton,
|
||||||
QButtonGroup,
|
QButtonGroup,
|
||||||
|
QDialog,
|
||||||
QGraphicsColorizeEffect,
|
QGraphicsColorizeEffect,
|
||||||
QLabel,
|
QPushButton,
|
||||||
|
QVBoxLayout,
|
||||||
QWidget,
|
QWidget,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -30,26 +37,13 @@ from ui.designer.tabs.tabTools.tabTools_StepCalculator_ui import (
|
|||||||
Ui_TabTools_StepCalculator,
|
Ui_TabTools_StepCalculator,
|
||||||
)
|
)
|
||||||
from ui.extends.shared.language import LanguageChangeEventFilter
|
from ui.extends.shared.language import LanguageChangeEventFilter
|
||||||
from ui.implements.components.chartAndScoreInput import ChartAndScoreInput
|
from ui.implements.components.chartSelector import ChartSelector
|
||||||
|
from ui.implements.components.playRatingCalculator import PlayRatingCalculator
|
||||||
from ui.implements.components.songIdSelector import SongIdSelectorMode
|
from ui.implements.components.songIdSelector import SongIdSelectorMode
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class MapTypeListWidgetWidget(QLabel):
|
|
||||||
def paintEvent(self, e: QPaintEvent) -> None:
|
|
||||||
size = self.size()
|
|
||||||
painter = QPainter(self)
|
|
||||||
scaledPixmap = self.pixmap().scaled(
|
|
||||||
size,
|
|
||||||
Qt.AspectRatioMode.KeepAspectRatio,
|
|
||||||
Qt.TransformationMode.SmoothTransformation,
|
|
||||||
)
|
|
||||||
x = (size.width() - scaledPixmap.width()) / 2
|
|
||||||
y = (size.height() - scaledPixmap.height()) / 2
|
|
||||||
painter.drawPixmap(x, y, scaledPixmap)
|
|
||||||
|
|
||||||
|
|
||||||
class ButtonGrayscaleEffectApplier(QObject):
|
class ButtonGrayscaleEffectApplier(QObject):
|
||||||
def __init__(self, parent: QAbstractButton):
|
def __init__(self, parent: QAbstractButton):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
@ -79,11 +73,56 @@ class ButtonGrayscaleEffectApplier(QObject):
|
|||||||
target.setGraphicsEffect(effect)
|
target.setGraphicsEffect(effect)
|
||||||
|
|
||||||
|
|
||||||
class ChartAndScoreInputDialog(ChartAndScoreInput):
|
class PlayRatingCalculatorDialog(QDialog):
|
||||||
|
accepted = Signal()
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self.setWindowFlag(Qt.WindowType.Dialog, True)
|
|
||||||
self.setSongIdSelectorMode(SongIdSelectorMode.Chart)
|
self.verticalLayout = QVBoxLayout(self)
|
||||||
|
|
||||||
|
self.chartSelector = ChartSelector(self)
|
||||||
|
self.chartSelector.setSongIdSelectorMode(SongIdSelectorMode.Chart)
|
||||||
|
self.verticalLayout.addWidget(self.chartSelector)
|
||||||
|
|
||||||
|
self.playRatingCalculator = PlayRatingCalculator(self)
|
||||||
|
self.verticalLayout.addWidget(self.playRatingCalculator)
|
||||||
|
|
||||||
|
self.acceptButton = QPushButton(self)
|
||||||
|
self.acceptButton.setText(
|
||||||
|
# fmt: off
|
||||||
|
QCoreApplication.translate("StepCalculator", "playRatingCalculatorDialog.acceptButton")
|
||||||
|
# fmt: on
|
||||||
|
)
|
||||||
|
self.acceptButton.setEnabled(False)
|
||||||
|
self.verticalLayout.addWidget(self.acceptButton)
|
||||||
|
|
||||||
|
self.chartSelector.valueChanged.connect(self.updatePlayRatingCalculator)
|
||||||
|
self.playRatingCalculator.arcaeaScoreLineEdit.textChanged.connect(
|
||||||
|
self.updateAcceptButton
|
||||||
|
)
|
||||||
|
self.acceptButton.clicked.connect(self.accepted)
|
||||||
|
|
||||||
|
def updatePlayRatingCalculator(self):
|
||||||
|
chart = self.chartSelector.value()
|
||||||
|
if chart is None:
|
||||||
|
self.playRatingCalculator.setConstant(None)
|
||||||
|
else:
|
||||||
|
self.playRatingCalculator.setConstant(chart.constant)
|
||||||
|
self.updateAcceptButton()
|
||||||
|
|
||||||
|
def updateAcceptButton(self):
|
||||||
|
if self.playRatingCalculator.result is None:
|
||||||
|
self.acceptButton.setEnabled(False)
|
||||||
|
else:
|
||||||
|
self.acceptButton.setEnabled(True)
|
||||||
|
|
||||||
|
def reset(self):
|
||||||
|
self.chartSelector.resetButton.click()
|
||||||
|
self.playRatingCalculator.arcaeaScoreLineEdit.clear()
|
||||||
|
|
||||||
|
def value(self):
|
||||||
|
return self.playRatingCalculator.result
|
||||||
|
|
||||||
|
|
||||||
class TabTools_StepCalculator(Ui_TabTools_StepCalculator, QWidget):
|
class TabTools_StepCalculator(Ui_TabTools_StepCalculator, QWidget):
|
||||||
@ -203,23 +242,18 @@ class TabTools_StepCalculator(Ui_TabTools_StepCalculator, QWidget):
|
|||||||
)
|
)
|
||||||
self.partnerSkillPresetButton_maya.clicked.connect(self.applyPartnerPreset)
|
self.partnerSkillPresetButton_maya.clicked.connect(self.applyPartnerPreset)
|
||||||
|
|
||||||
def openChartAndScoreInputDialog(self):
|
self.playRatingCalculatorDialog = PlayRatingCalculatorDialog(self)
|
||||||
dialog = ChartAndScoreInputDialog(self)
|
self.playRatingCalculatorDialog.accepted.connect(self.set_toStep_PlayRating)
|
||||||
dialog.scoreCommited.connect(
|
|
||||||
lambda: self.setPlayResultFromChartAndScoreInput(dialog)
|
|
||||||
)
|
|
||||||
dialog.show()
|
|
||||||
|
|
||||||
def setPlayResultFromChartAndScoreInput(self, dialog: ChartAndScoreInputDialog):
|
def openChartAndScoreInputDialog(self):
|
||||||
if score := dialog.score():
|
self.playRatingCalculatorDialog.reset()
|
||||||
chart = dialog.chart()
|
self.playRatingCalculatorDialog.show()
|
||||||
self.calculate_toStep_playResultSpinBox.setValue(
|
|
||||||
float(calculate_play_rating(chart.constant, score.score))
|
def set_toStep_PlayRating(self):
|
||||||
)
|
result = self.playRatingCalculatorDialog.value()
|
||||||
dialog.close()
|
if result is not None:
|
||||||
dialog.deleteLater()
|
self.calculate_toStep_playResultSpinBox.setValue(result)
|
||||||
else:
|
self.playRatingCalculatorDialog.close()
|
||||||
return
|
|
||||||
|
|
||||||
def applyPartnerPreset(self):
|
def applyPartnerPreset(self):
|
||||||
if not self.sender():
|
if not self.sender():
|
||||||
@ -307,7 +341,8 @@ class TabTools_StepCalculator(Ui_TabTools_StepCalculator, QWidget):
|
|||||||
step = calculate_step(
|
step = calculate_step(
|
||||||
playResult, partner_bonus=partnerBonus, step_booster=stepBooster
|
playResult, partner_bonus=partnerBonus, step_booster=stepBooster
|
||||||
)
|
)
|
||||||
self.calculate_toStep_resultLabel.setText(f"{step}<br>({stepOriginal})")
|
self.calculate_toStep_resultLabel.setText(str(step))
|
||||||
|
self.calculate_toStep_detailedResultLabel.setText(str(stepOriginal))
|
||||||
except Exception:
|
except Exception:
|
||||||
if self.detailedLogOutputCheckBox.isChecked():
|
if self.detailedLogOutputCheckBox.isChecked():
|
||||||
logger.exception("Cannot calculate toStep")
|
logger.exception("Cannot calculate toStep")
|
||||||
@ -315,16 +350,14 @@ class TabTools_StepCalculator(Ui_TabTools_StepCalculator, QWidget):
|
|||||||
|
|
||||||
# fromStep
|
# fromStep
|
||||||
try:
|
try:
|
||||||
self.calculate_fromStep_resultLabel.setText(
|
fromStepResult = calculate_play_rating_from_step(
|
||||||
str(
|
self.calculate_fromStep_targetStepSpinBox.value(),
|
||||||
calculate_play_rating_from_step(
|
self.partnerStepValueSpinBox.value(),
|
||||||
self.calculate_fromStep_targetStepSpinBox.value(),
|
partner_bonus=partnerBonus,
|
||||||
self.partnerStepValueSpinBox.value(),
|
step_booster=stepBooster,
|
||||||
partner_bonus=partnerBonus,
|
|
||||||
step_booster=stepBooster,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
self.calculate_fromStep_resultLabel.setText(str(round(fromStepResult, 2)))
|
||||||
|
self.calculate_fromStep_detailedResultLabel.setText(str(fromStepResult))
|
||||||
except Exception:
|
except Exception:
|
||||||
if self.detailedLogOutputCheckBox.isChecked():
|
if self.detailedLogOutputCheckBox.isChecked():
|
||||||
logger.exception("Cannot calculate fromStep")
|
logger.exception("Cannot calculate fromStep")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user