mirror of
https://github.com/283375/arcaea-offline-pyside-ui.git
synced 2025-07-01 12:26:26 +00:00
impr: fallback when no chart data in database
This commit is contained in:
@ -93,13 +93,18 @@ class ChartDelegate(TextSegmentDelegate):
|
||||
[{self.TextRole: "Chart Invalid", self.ColorRole: QColor("#ff0000")}]
|
||||
]
|
||||
|
||||
chartConstantString = (
|
||||
f"{chart.constant / 10:.1f}"
|
||||
if chart.constant is not None and chart.constant > 0
|
||||
else "?"
|
||||
)
|
||||
return [
|
||||
[
|
||||
{self.TextRole: f"{chart.title}"},
|
||||
],
|
||||
[
|
||||
{
|
||||
self.TextRole: f"{rating_class_to_text(chart.rating_class)} {chart.constant / 10:.1f}",
|
||||
self.TextRole: f"{rating_class_to_text(chart.rating_class)} {chartConstantString}",
|
||||
self.ColorRole: self.RatingClassColors[chart.rating_class],
|
||||
},
|
||||
],
|
||||
|
@ -96,7 +96,13 @@ class ScoreDelegate(TextSegmentDelegate):
|
||||
score = self.getScore(index)
|
||||
chart = self.getChart(index)
|
||||
|
||||
if isinstance(score, Score) and isinstance(chart, Chart):
|
||||
if (
|
||||
isinstance(score, Score)
|
||||
and isinstance(chart, Chart)
|
||||
and chart.notes is not None
|
||||
and score.pure is not None
|
||||
and score.far is not None
|
||||
):
|
||||
scoreRange = calculate_score_range(chart.notes, score.pure, score.far)
|
||||
return scoreRange[0] <= score.score <= scoreRange[1]
|
||||
|
||||
|
Reference in New Issue
Block a user