1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-11 07:17:18 +08:00

Merge branch 'master' into skinnable-star-fountain-sfx

This commit is contained in:
Dean Herbert 2025-03-09 22:49:53 +09:00
commit 50131ee5d0
No known key found for this signature in database
6 changed files with 50 additions and 16 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
@ -127,8 +128,11 @@ namespace osu.Game.Rulesets.Osu.Edit
if (relativeCheckbox.Current.Value)
{
(xBindable.MinValue, xBindable.MaxValue) = (0 - initialSurroundingQuad.TopLeft.X, OsuPlayfield.BASE_SIZE.X - initialSurroundingQuad.BottomRight.X);
(yBindable.MinValue, yBindable.MaxValue) = (0 - initialSurroundingQuad.TopLeft.Y, OsuPlayfield.BASE_SIZE.Y - initialSurroundingQuad.BottomRight.Y);
xBindable.MinValue = 0 - Math.Max(initialSurroundingQuad.TopLeft.X, 0);
xBindable.MaxValue = OsuPlayfield.BASE_SIZE.X - Math.Min(initialSurroundingQuad.BottomRight.X, OsuPlayfield.BASE_SIZE.X);
yBindable.MinValue = 0 - Math.Max(initialSurroundingQuad.TopLeft.Y, 0);
yBindable.MaxValue = OsuPlayfield.BASE_SIZE.Y - Math.Min(initialSurroundingQuad.BottomRight.Y, OsuPlayfield.BASE_SIZE.Y);
xBindable.Default = yBindable.Default = 0;
@ -146,8 +150,21 @@ namespace osu.Game.Rulesets.Osu.Edit
var quadRelativeToPosition = new RectangleF(initialSurroundingQuad.Location - initialPosition, initialSurroundingQuad.Size);
(xBindable.MinValue, xBindable.MaxValue) = (0 - quadRelativeToPosition.TopLeft.X, OsuPlayfield.BASE_SIZE.X - quadRelativeToPosition.BottomRight.X);
(yBindable.MinValue, yBindable.MaxValue) = (0 - quadRelativeToPosition.TopLeft.Y, OsuPlayfield.BASE_SIZE.Y - quadRelativeToPosition.BottomRight.Y);
if (initialSurroundingQuad.Width < OsuPlayfield.BASE_SIZE.X)
{
xBindable.MinValue = 0 - quadRelativeToPosition.TopLeft.X;
xBindable.MaxValue = OsuPlayfield.BASE_SIZE.X - quadRelativeToPosition.BottomRight.X;
}
else
xBindable.MinValue = xBindable.MaxValue = initialPosition.X;
if (initialSurroundingQuad.Height < OsuPlayfield.BASE_SIZE.Y)
{
yBindable.MinValue = 0 - quadRelativeToPosition.TopLeft.Y;
yBindable.MaxValue = OsuPlayfield.BASE_SIZE.Y - quadRelativeToPosition.BottomRight.Y;
}
else
yBindable.MinValue = yBindable.MaxValue = initialPosition.Y;
xBindable.Default = initialPosition.X;
yBindable.Default = initialPosition.Y;

View File

@ -181,6 +181,11 @@ namespace osu.Game.Tests.Visual.SongSelect
{
AddStep(@"Set scope", () => leaderboard.Scope = BeatmapLeaderboardScope.Global);
AddStep(@"New Scores", () => leaderboard.SetScores(generateSampleScores(new BeatmapInfo())));
AddStep(@"New Scores with teams", () => leaderboard.SetScores(generateSampleScores(new BeatmapInfo()).Select(s =>
{
s.User.Team = new APITeam();
return s;
})));
}
[Test]
@ -473,7 +478,7 @@ namespace osu.Game.Tests.Visual.SongSelect
Accuracy = 0.5140,
MaxCombo = 244,
TotalScore = 1707827,
Date = DateTime.Now.AddMonths(-3),
Date = DateTime.Now.AddMonths(-10),
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
BeatmapInfo = beatmapInfo,
BeatmapHash = beatmapInfo.Hash,

View File

@ -190,7 +190,7 @@ namespace osu.Game.Online.Leaderboards
RelativeSizeAxes = Axes.Y,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(5f, 0f),
Width = 114f,
Width = 130f,
Masking = true,
Children = new Drawable[]
{

View File

@ -9,5 +9,9 @@ namespace osu.Game.Online.Multiplayer
[Serializable]
public class InvalidPasswordException : HubException
{
public InvalidPasswordException()
: base("Invalid password")
{
}
}
}

View File

@ -365,8 +365,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
updateRoomMaxParticipants();
updateRoomAutoStartDuration();
updateRoomPlaylist();
drawablePlaylist.Items.BindCollectionChanged((_, __) => room.Playlist = drawablePlaylist.Items.ToArray());
}
private void onRoomPropertyChanged(object? sender, PropertyChangedEventArgs e)
@ -470,6 +468,14 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
}
else
{
room.Name = NameField.Text;
room.Password = PasswordTextBox.Text;
room.Type = TypePicker.Current.Value;
room.QueueMode = QueueModeDropdown.Current.Value;
room.AutoStartDuration = TimeSpan.FromSeconds((int)startModeDropdown.Current.Value);
room.AutoSkip = AutoSkipCheckbox.Current.Value;
room.Playlist = drawablePlaylist.Items.ToArray();
client.CreateRoom(room).ContinueWith(t => Schedule(() =>
{
if (t.IsCompletedSuccessfully)
@ -505,10 +511,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
const string not_found_prefix = "beatmaps not found:";
if (message.StartsWith(not_found_prefix, StringComparison.Ordinal))
{
ErrorText.Text = "The selected beatmap is not available online.";
room.Playlist.SingleOrDefault()?.MarkInvalid();
}
else
ErrorText.Text = message;

View File

@ -84,12 +84,17 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
onSuccess(room);
else
{
const string message = "Failed to join multiplayer room.";
Exception? exception = result.Exception?.AsSingular();
if (result.Exception != null)
Logger.Error(result.Exception, message);
onFailure.Invoke(result.Exception?.AsSingular().Message ?? message);
if (exception?.GetHubExceptionMessage() is string message)
onFailure(message);
else
{
const string generic_failure_message = "Failed to join multiplayer room.";
if (result.Exception != null)
Logger.Error(result.Exception, generic_failure_message);
onFailure(generic_failure_message);
}
}
});
}