Skip to content

Commit bdc154b

Browse files
authored
Merge branch 'master' into fix-mods-masking
2 parents 8c55f80 + 856c911 commit bdc154b

2 files changed

Lines changed: 52 additions & 16 deletions

File tree

PerformanceCalculatorGUI/RulesetHelper.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,19 @@ public static int AdjustManiaScore(int score, IReadOnlyList<Mod> mods)
103103
return (int)Math.Round(1000000 * scoreMultiplier);
104104
}
105105

106-
public static Dictionary<HitResult, int> GenerateHitResultsForRuleset(RulesetInfo ruleset, double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood)
106+
public static Dictionary<HitResult, int> GenerateHitResultsForRuleset(RulesetInfo ruleset, double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood, int? countLargeTickMisses)
107107
{
108108
return ruleset.OnlineID switch
109109
{
110-
0 => generateOsuHitResults(accuracy, beatmap, countMiss, countMeh, countGood),
110+
0 => generateOsuHitResults(accuracy, beatmap, countMiss, countMeh, countGood, countLargeTickMisses),
111111
1 => generateTaikoHitResults(accuracy, beatmap, countMiss, countGood),
112112
2 => generateCatchHitResults(accuracy, beatmap, countMiss, countMeh, countGood),
113113
3 => generateManiaHitResults(accuracy, beatmap, countMiss),
114114
_ => throw new ArgumentException("Invalid ruleset ID provided.")
115115
};
116116
}
117117

118-
private static Dictionary<HitResult, int> generateOsuHitResults(double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood)
118+
private static Dictionary<HitResult, int> generateOsuHitResults(double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood, int? countLargeTickMisses)
119119
{
120120
int countGreat;
121121

@@ -196,6 +196,7 @@ private static Dictionary<HitResult, int> generateOsuHitResults(double accuracy,
196196
{ HitResult.Great, countGreat },
197197
{ HitResult.Ok, countGood ?? 0 },
198198
{ HitResult.Meh, countMeh ?? 0 },
199+
{ HitResult.LargeTickMiss, countLargeTickMisses ?? 0 },
199200
{ HitResult.Miss, countMiss }
200201
};
201202
}

PerformanceCalculatorGUI/Screens/SimulateScreen.cs

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public partial class SimulateScreen : PerformanceCalculatorScreen
5252
private SwitchButton beatmapImportTypeSwitch;
5353

5454
private LimitedLabelledNumberBox missesTextBox;
55+
private LimitedLabelledNumberBox largeTickMissesTextBox;
5556
private LimitedLabelledNumberBox comboTextBox;
5657
private LimitedLabelledNumberBox scoreTextBox;
5758

@@ -135,8 +136,8 @@ private void load(OsuColour osuColour)
135136
AutoSizeAxes = Axes.Y,
136137
ColumnDimensions = new[]
137138
{
138-
new Dimension(),
139139
new Dimension(GridSizeMode.Absolute),
140+
new Dimension(),
140141
new Dimension(GridSizeMode.AutoSize)
141142
},
142143
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
@@ -254,21 +255,46 @@ private void load(OsuColour osuColour)
254255
}
255256
}
256257
},
257-
missesTextBox = new LimitedLabelledNumberBox
258+
comboTextBox = new LimitedLabelledNumberBox
258259
{
259260
RelativeSizeAxes = Axes.X,
260261
Anchor = Anchor.TopLeft,
261-
Label = "Misses",
262+
Label = "Combo",
262263
PlaceholderText = "0",
263264
MinValue = 0
264265
},
265-
comboTextBox = new LimitedLabelledNumberBox
266+
new GridContainer
266267
{
267268
RelativeSizeAxes = Axes.X,
268-
Anchor = Anchor.TopLeft,
269-
Label = "Combo",
270-
PlaceholderText = "0",
271-
MinValue = 0
269+
AutoSizeAxes = Axes.Y,
270+
ColumnDimensions = new[]
271+
{
272+
new Dimension(),
273+
new Dimension()
274+
},
275+
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
276+
Content = new[]
277+
{
278+
new Drawable[]
279+
{
280+
missesTextBox = new LimitedLabelledNumberBox
281+
{
282+
RelativeSizeAxes = Axes.X,
283+
Anchor = Anchor.TopLeft,
284+
Label = "Misses",
285+
PlaceholderText = "0",
286+
MinValue = 0
287+
},
288+
largeTickMissesTextBox = new LimitedLabelledNumberBox
289+
{
290+
RelativeSizeAxes = Axes.X,
291+
Anchor = Anchor.TopLeft,
292+
Label = "Large Tick Misses",
293+
PlaceholderText = "0",
294+
MinValue = 0
295+
}
296+
}
297+
}
272298
},
273299
scoreTextBox = new LimitedLabelledNumberBox
274300
{
@@ -423,28 +449,29 @@ private void load(OsuColour osuColour)
423449
{
424450
beatmapImportContainer.ColumnDimensions = new[]
425451
{
426-
new Dimension(GridSizeMode.Absolute),
427452
new Dimension(),
453+
new Dimension(GridSizeMode.Absolute),
428454
new Dimension(GridSizeMode.AutoSize)
429455
};
430-
431-
fixupTextBox(beatmapIdTextBox);
432456
}
433457
else
434458
{
435459
beatmapImportContainer.ColumnDimensions = new[]
436460
{
437-
new Dimension(),
438461
new Dimension(GridSizeMode.Absolute),
462+
new Dimension(),
439463
new Dimension(GridSizeMode.AutoSize)
440464
};
465+
466+
fixupTextBox(beatmapIdTextBox);
441467
}
442468
});
443469

444470
accuracyTextBox.Value.BindValueChanged(_ => debouncedCalculatePerformance());
445471
goodsTextBox.Value.BindValueChanged(_ => debouncedCalculatePerformance());
446472
mehsTextBox.Value.BindValueChanged(_ => debouncedCalculatePerformance());
447473
missesTextBox.Value.BindValueChanged(_ => debouncedCalculatePerformance());
474+
largeTickMissesTextBox.Value.BindValueChanged(_ => debouncedCalculatePerformance());
448475
comboTextBox.Value.BindValueChanged(_ => debouncedCalculatePerformance());
449476
scoreTextBox.Value.BindValueChanged(_ => debouncedCalculatePerformance());
450477

@@ -636,7 +663,8 @@ private void calculatePerformance()
636663
if (ruleset.Value.OnlineID != -1)
637664
{
638665
// official rulesets can generate more precise hits from accuracy
639-
statistics = RulesetHelper.GenerateHitResultsForRuleset(ruleset.Value, accuracyTextBox.Value.Value / 100.0, beatmap, missesTextBox.Value.Value, countMeh, countGood);
666+
statistics = RulesetHelper.GenerateHitResultsForRuleset(ruleset.Value, accuracyTextBox.Value.Value / 100.0, beatmap, missesTextBox.Value.Value, countMeh, countGood, largeTickMissesTextBox.Value.Value);
667+
640668
accuracy = RulesetHelper.GetAccuracyForRuleset(ruleset.Value, statistics);
641669
}
642670

@@ -671,6 +699,7 @@ private void populateScoreParams()
671699
accuracyContainer.Hide();
672700
comboTextBox.Hide();
673701
missesTextBox.Hide();
702+
largeTickMissesTextBox.Hide();
674703
scoreTextBox.Hide();
675704

676705
if (ruleset.Value.ShortName == "osu" || ruleset.Value.ShortName == "taiko" || ruleset.Value.ShortName == "fruits")
@@ -681,6 +710,11 @@ private void populateScoreParams()
681710
updateCombo(true);
682711
comboTextBox.Show();
683712
missesTextBox.Show();
713+
714+
if (ruleset.Value.ShortName == "osu")
715+
{
716+
largeTickMissesTextBox.Show();
717+
}
684718
}
685719
else if (ruleset.Value.ShortName == "mania")
686720
{
@@ -701,6 +735,7 @@ private void populateScoreParams()
701735
updateCombo(true);
702736
comboTextBox.Show();
703737
missesTextBox.Show();
738+
largeTickMissesTextBox.Show();
704739

705740
scoreTextBox.Text = string.Empty;
706741
scoreTextBox.Show();

0 commit comments

Comments
 (0)