1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 06:47:24 +08:00

Merge branch 'master' into open-profile-hotkey

This commit is contained in:
Andrew Hong 2022-08-10 01:31:37 -04:00 committed by GitHub
commit 6f1fdd4c34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 3 deletions

View File

@ -137,6 +137,17 @@ namespace osu.Game.Online.API
state.Value = APIState.Connecting;
if (localUser.IsDefault)
{
// Show a placeholder user if saved credentials are available.
// This is useful for storing local scores and showing a placeholder username after starting the game,
// until a valid connection has been established.
localUser.Value = new APIUser
{
Username = ProvidedUsername,
};
}
// save the username at this point, if the user requested for it to be.
config.SetValue(OsuSetting.Username, config.Get<bool>(OsuSetting.SaveUsername) ? ProvidedUsername : string.Empty);
@ -402,7 +413,7 @@ namespace osu.Game.Online.API
}
}
public bool IsLoggedIn => localUser.Value.Id > 1; // TODO: should this also be true if attempting to connect?
public bool IsLoggedIn => State.Value > APIState.Offline;
public void Queue(APIRequest request)
{

View File

@ -104,11 +104,11 @@ namespace osu.Game.Overlays
filterControl.CardSize.BindValueChanged(_ => onCardSizeChanged());
apiUser = api.LocalUser.GetBoundCopy();
apiUser.BindValueChanged(_ =>
apiUser.BindValueChanged(_ => Schedule(() =>
{
if (api.IsLoggedIn)
addContentToResultsArea(Drawable.Empty());
});
}));
}
public void ShowWithSearch(string query)

View File

@ -249,6 +249,9 @@ namespace osu.Game.Screens.Play
// this is intentionally done in two stages to ensure things are in a loaded state before exposing the ruleset to skin sources.
GameplayClockContainer.Add(rulesetSkinProvider);
if (cancellationToken.IsCancellationRequested)
return;
rulesetSkinProvider.AddRange(new Drawable[]
{
failAnimationLayer = new FailAnimation(DrawableRuleset)
@ -279,6 +282,9 @@ namespace osu.Game.Screens.Play
},
});
if (cancellationToken.IsCancellationRequested)
return;
if (Configuration.AllowRestart)
{
rulesetSkinProvider.Add(new HotkeyRetryOverlay