Skip to content

Commit 1fbcc49

Browse files
authored
Merge pull request #248 from ppy/master
a
2 parents e5e4867 + c9ad0e4 commit 1fbcc49

5 files changed

Lines changed: 42 additions & 28 deletions

File tree

osu.Game.Tests/Visual/RankedPlay/TestScenePlayerCardHand.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,5 +211,13 @@ public void TestRemoveCardsWhileDragging()
211211
});
212212
AddStep("release mouse", () => InputManager.ReleaseButton(MouseButton.Left));
213213
}
214+
215+
[Test]
216+
public void TestKeyboardSelectionWithoutCards()
217+
{
218+
AddAssert("no cards", () => !handOfCards.Cards.Any());
219+
AddStep("right arrow", () => InputManager.Key(Key.Right));
220+
AddStep("left arrow", () => InputManager.Key(Key.Left));
221+
}
214222
}
215223
}

osu.Game/Overlays/Profile/Header/Components/MatchmakingStatsDisplay.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using osu.Game.Graphics;
1212
using osu.Game.Graphics.Sprites;
1313
using osu.Game.Online.API.Requests.Responses;
14+
using osu.Game.Resources.Localisation.Web;
1415

1516
namespace osu.Game.Overlays.Profile.Header.Components
1617
{
@@ -58,7 +59,7 @@ private void load()
5859
{
5960
new OsuSpriteText
6061
{
61-
Text = "Quick Play",
62+
Text = UsersStrings.ShowMatchmakingTitle,
6263
Margin = new MarginPadding { Horizontal = 5f, Vertical = 7f },
6364
Font = OsuFont.GetFont(size: 12)
6465
},

osu.Game/Overlays/Profile/Header/Components/MatchmakingStatsTooltip.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using osu.Game.Graphics;
1414
using osu.Game.Graphics.Sprites;
1515
using osu.Game.Online.API.Requests.Responses;
16+
using osu.Game.Resources.Localisation.Web;
1617
using osuTK;
1718
using osuTK.Graphics;
1819

@@ -68,10 +69,10 @@ public void SetContent(MatchmakingStatsTooltipData content)
6869
[
6970
new TableColumn(dimension: new Dimension(GridSizeMode.AutoSize)),
7071
new TableColumn(dimension: new Dimension(GridSizeMode.AutoSize)),
71-
new TableColumn("Wins", dimension: new Dimension(GridSizeMode.AutoSize)),
72-
new TableColumn("Plays", dimension: new Dimension(GridSizeMode.AutoSize)),
73-
new TableColumn("Points", dimension: new Dimension(GridSizeMode.AutoSize)),
74-
new TableColumn("Rating", dimension: new Dimension(GridSizeMode.AutoSize)),
72+
new TableColumn(RankingsStrings.MatchmakingWins, dimension: new Dimension(GridSizeMode.AutoSize)),
73+
new TableColumn(RankingsStrings.MatchmakingPlays, dimension: new Dimension(GridSizeMode.AutoSize)),
74+
new TableColumn(RankingsStrings.MatchmakingPoints, dimension: new Dimension(GridSizeMode.AutoSize)),
75+
new TableColumn(RankingsStrings.MatchmakingRating, dimension: new Dimension(GridSizeMode.AutoSize)),
7576
],
7677
RowSize = new Dimension(GridSizeMode.AutoSize),
7778
Content = statistics.Select(s => createRow(colourProvider, s)).ToArray().ToRectangular()

osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Hand/PlayerHandOfCards.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ private void moveCardFocus(int direction)
196196
{
197197
var cards = GetCardsInDisplayOrder();
198198

199+
if (cards.Count == 0)
200+
return;
201+
199202
int currentIndex = cards.FindIndex(c => c.HasFocus);
200203

201204
// default behaviour is to start from either end of the cards if no card is focused currently

osu.Game/Screens/Play/SubmittingPlayer.cs

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -145,28 +145,7 @@ void handleTokenFailure(Exception exception, bool displayNotification = false)
145145
if (string.IsNullOrEmpty(exception.Message))
146146
Logger.Error(exception, $"Failed to retrieve a score submission token.\n\n{whatWillHappen}");
147147
else
148-
{
149-
switch (exception.Message)
150-
{
151-
case @"missing token header":
152-
case @"invalid client hash":
153-
case @"invalid verification hash":
154-
Logger.Log($"Please ensure that you are using the latest version of the official game releases.\n\n{whatWillHappen}", level: LogLevel.Important);
155-
break;
156-
157-
case @"invalid or missing beatmap_hash":
158-
Logger.Log($"This beatmap does not match the online version. Please update or redownload it.\n\n{whatWillHappen}", level: LogLevel.Important);
159-
break;
160-
161-
case @"expired token":
162-
Logger.Log($"Your system clock is set incorrectly. Please check your system time, date and timezone.\n\n{whatWillHappen}", level: LogLevel.Important);
163-
break;
164-
165-
default:
166-
Logger.Log($"{whatWillHappen} {exception.Message}", level: LogLevel.Important);
167-
break;
168-
}
169-
}
148+
Logger.Log($"{getUserFacingAPIError(exception)}\n\n{whatWillHappen}", level: LogLevel.Important);
170149
}
171150

172151
if (shouldExit)
@@ -346,14 +325,36 @@ private Task submitScore(Score score)
346325

347326
request.Failure += e =>
348327
{
349-
Logger.Error(e, $"Failed to submit score (token:{token.Value}): {e.Message}");
328+
Logger.Error(e, $"{getUserFacingAPIError(e)}\n\nScore was not submitted (id: {token.Value})");
350329
scoreSubmissionSource.SetResult(false);
351330
};
352331

353332
api.Queue(request);
354333
return scoreSubmissionSource.Task;
355334
}
356335

336+
private static string getUserFacingAPIError(Exception exception)
337+
{
338+
switch (exception.Message)
339+
{
340+
case @"missing token header":
341+
case @"invalid client hash":
342+
case @"invalid verification hash":
343+
case @"invalid token":
344+
case @"outdated client":
345+
return "Please ensure that you are using the latest version of the official game releases.";
346+
347+
case @"invalid or missing beatmap_hash":
348+
return "This beatmap does not match the online version. Please update or redownload it.";
349+
350+
case @"expired token":
351+
return "Your system clock is set incorrectly. Please check your system time, date and timezone.";
352+
353+
default:
354+
return exception.Message;
355+
}
356+
}
357+
357358
protected override ResultsScreen CreateResults(ScoreInfo score) => new SoloResultsScreen(score)
358359
{
359360
AllowRetry = true,

0 commit comments

Comments
 (0)