diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index dc0ab46646..a2e407005e 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -15,10 +15,6 @@ osu.Desktop.Program - - F:\MUG OSU\Ez2Lazer_Publish\$(Configuration) - bin\$(Configuration)\ - diff --git a/osu.Game/Localisation/UserInterfaceStrings.cs b/osu.Game/Localisation/UserInterfaceStrings.cs index 9883ffe173..08b6368571 100644 --- a/osu.Game/Localisation/UserInterfaceStrings.cs +++ b/osu.Game/Localisation/UserInterfaceStrings.cs @@ -174,6 +174,16 @@ namespace osu.Game.Localisation /// public static LocalisableString SelectedMods => new TranslatableString(getKey(@"selected_mods"), @"Selected Mods"); + /// + /// "hold for menu" + /// + public static LocalisableString HoldForMenu => new TranslatableString(getKey(@"hold_for_menu"), @"hold for menu"); + + /// + /// "press for menu" + /// + public static LocalisableString PressForMenu => new TranslatableString(getKey(@"press_for_menu"), @"press for menu"); + private static string getKey(string key) => $@"{prefix}:{key}"; } } diff --git a/osu.Game/Online/Metadata/IMetadataServer.cs b/osu.Game/Online/Metadata/IMetadataServer.cs index 79ed8b5634..dc1d486b4a 100644 --- a/osu.Game/Online/Metadata/IMetadataServer.cs +++ b/osu.Game/Online/Metadata/IMetadataServer.cs @@ -53,5 +53,10 @@ namespace osu.Game.Online.Metadata /// Signals to the server that the current user would like to stop receiving updates about the state of the multiplayer room with the given . /// Task EndWatchingMultiplayerRoom(long id); + + /// + /// Refresh this user's friend listing. + /// + Task RefreshFriends(); } } diff --git a/osu.Game/Online/Metadata/MetadataClient.cs b/osu.Game/Online/Metadata/MetadataClient.cs index 0679191a52..e70fe6d3bb 100644 --- a/osu.Game/Online/Metadata/MetadataClient.cs +++ b/osu.Game/Online/Metadata/MetadataClient.cs @@ -9,6 +9,7 @@ using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Online.API; +using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.Multiplayer; using osu.Game.Users; @@ -21,6 +22,16 @@ namespace osu.Game.Online.Metadata [Resolved] private IAPIProvider api { get; set; } = null!; + private readonly IBindableList localFriends = new BindableList(); + + protected override void LoadComplete() + { + base.LoadComplete(); + + localFriends.BindTo(api.LocalUserState.Friends); + localFriends.BindCollectionChanged((_, _) => RefreshFriends().FireAndForget()); + } + #region Beatmap metadata updates public abstract Task GetChangesSince(int queueId); @@ -152,6 +163,8 @@ namespace osu.Game.Online.Metadata public abstract Task EndWatchingMultiplayerRoom(long id); + public abstract Task RefreshFriends(); + public event Action? MultiplayerRoomScoreSet; Task IMetadataClient.MultiplayerRoomScoreSet(MultiplayerRoomScoreSetEvent roomScoreSetEvent) diff --git a/osu.Game/Online/Metadata/OnlineMetadataClient.cs b/osu.Game/Online/Metadata/OnlineMetadataClient.cs index 052b742beb..0853ccf9df 100644 --- a/osu.Game/Online/Metadata/OnlineMetadataClient.cs +++ b/osu.Game/Online/Metadata/OnlineMetadataClient.cs @@ -288,6 +288,15 @@ namespace osu.Game.Online.Metadata Logger.Log($@"{nameof(OnlineMetadataClient)} stopped watching multiplayer room with ID {id}", LoggingTarget.Network); } + public override async Task RefreshFriends() + { + if (connector?.IsConnected.Value != true) + throw new OperationCanceledException(); + + Debug.Assert(connection != null); + await connection.InvokeAsync(nameof(IMetadataServer.RefreshFriends)).ConfigureAwait(false); + } + public override async Task DisconnectRequested() { await base.DisconnectRequested().ConfigureAwait(false); diff --git a/osu.Game/Rulesets/UI/GameplaySampleTriggerSource.cs b/osu.Game/Rulesets/UI/GameplaySampleTriggerSource.cs index 6e21a61f55..1738b508ab 100644 --- a/osu.Game/Rulesets/UI/GameplaySampleTriggerSource.cs +++ b/osu.Game/Rulesets/UI/GameplaySampleTriggerSource.cs @@ -6,7 +6,6 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics.Containers; using osu.Game.Audio; -using osu.Game.LAsEzExtensions.Audio; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index 1b3317b12d..ecd52f95b4 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -17,7 +17,6 @@ using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.Input.Events; -using osu.Framework.Input.StateChanges; using osu.Framework.Utils; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Graphics.Backgrounds; @@ -393,27 +392,12 @@ namespace osu.Game.Screens.Menu protected override void OnMouseUp(MouseUpEvent e) { - // HORRIBLE HACK - // This is here so that on mobile, the logo can correctly progress from main menu to song select v2 when held. - // Once the temporary solution of holding the logo to access song select v2 is removed, this should be too. - // Without this, the long-press-to-right-click flow intercepts the hold and converts it to a right click which would not trigger the logo - // and therefore not progress to song select. - if (e.Button == MouseButton.Right && e.CurrentState.Mouse.LastSource is ISourcedFromTouch) - triggerClick(); - // END OF HORRIBLE HACK - if (e.Button != MouseButton.Left) return; logoBounceContainer.ScaleTo(1f, 500, Easing.OutElastic); } protected override bool OnClick(ClickEvent e) - { - triggerClick(); - return true; - } - - private void triggerClick() { flashLayer.ClearTransforms(); flashLayer.Alpha = 0.4f; @@ -425,6 +409,8 @@ namespace osu.Game.Screens.Menu sampleClickChannel = sampleClick.GetChannel(); sampleClickChannel.Play(); } + + return true; } protected override bool OnHover(HoverEvent e) diff --git a/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsSongSelectV2.cs b/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsSongSelectV2.cs index 58d472fb99..0431885d1f 100644 --- a/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsSongSelectV2.cs +++ b/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsSongSelectV2.cs @@ -18,7 +18,6 @@ using osu.Game.Overlays.Mods; using osu.Game.Rulesets; using osu.Game.Rulesets.Mods; using osu.Game.Screens.Footer; -using osu.Game.Screens.Menu; using osu.Game.Screens.SelectV2; using osu.Game.Utils; @@ -48,6 +47,8 @@ namespace osu.Game.Screens.OnlinePlay.Playlists { this.room = room; + ShowOsuLogo = false; + Padding = new MarginPadding { Horizontal = HORIZONTAL_OVERFLOW_PADDING }; LeftPadding = new MarginPadding { Top = CORNER_RADIUS_HIDE_OFFSET + Header.HEIGHT }; @@ -202,21 +203,6 @@ namespace osu.Game.Screens.OnlinePlay.Playlists return false; } - protected override void LogoArriving(OsuLogo logo, bool resuming) - { - // Intentionally not calling base so the logo isn't shown. - } - - protected override void LogoExiting(OsuLogo logo) - { - // Intentionally not calling base so the logo isn't shown. - } - - protected override void LogoSuspending(OsuLogo logo) - { - // Intentionally not calling base so the logo isn't shown. - } - public override IReadOnlyList CreateFooterButtons() { var buttons = base.CreateFooterButtons().ToList(); diff --git a/osu.Game/Screens/SelectV2/FooterButtonMods.cs b/osu.Game/Screens/SelectV2/FooterButtonMods.cs index 13192df85d..2da98790a7 100644 --- a/osu.Game/Screens/SelectV2/FooterButtonMods.cs +++ b/osu.Game/Screens/SelectV2/FooterButtonMods.cs @@ -85,7 +85,7 @@ namespace osu.Game.Screens.SelectV2 AddRange(new[] { unrankedBadge = new UnrankedBadge(), - modDisplayBar = new Container + modDisplayBar = new ModDisplayBarContainer { Y = -5f, Depth = float.MaxValue, @@ -343,6 +343,13 @@ namespace osu.Game.Screens.SelectV2 } } + internal partial class ModDisplayBarContainer : Container + { + protected override bool OnMouseDown(MouseDownEvent e) => true; + + protected override bool OnHover(HoverEvent e) => true; + } + internal partial class UnrankedBadge : CompositeDrawable, IHasTooltip { public LocalisableString TooltipText { get; } @@ -386,6 +393,10 @@ namespace osu.Game.Screens.SelectV2 } }; } + + protected override bool OnMouseDown(MouseDownEvent e) => true; + + protected override bool OnHover(HoverEvent e) => true; } } } diff --git a/osu.Game/Screens/SelectV2/PanelBeatmapStandalone.cs b/osu.Game/Screens/SelectV2/PanelBeatmapStandalone.cs index 3f7eeecf57..d679039054 100644 --- a/osu.Game/Screens/SelectV2/PanelBeatmapStandalone.cs +++ b/osu.Game/Screens/SelectV2/PanelBeatmapStandalone.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Threading; -using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Logging; using osu.Framework.Bindables; diff --git a/osu.Game/Screens/SelectV2/SongSelect.cs b/osu.Game/Screens/SelectV2/SongSelect.cs index 10e2c98d67..346df39543 100644 --- a/osu.Game/Screens/SelectV2/SongSelect.cs +++ b/osu.Game/Screens/SelectV2/SongSelect.cs @@ -95,6 +95,11 @@ namespace osu.Game.Screens.SelectV2 /// protected bool ControlGlobalMusic { get; init; } = true; + /// + /// Whether the osu! logo should be shown at the bottom-right of the screen. + /// + protected bool ShowOsuLogo { get; init; } = true; + protected MarginPadding LeftPadding { get; init; } private ModSelectOverlay modSelectOverlay = null!; @@ -404,7 +409,8 @@ namespace osu.Game.Screens.SelectV2 if (!this.IsCurrentScreen()) return; - logo?.FadeTo(v.NewValue == Visibility.Visible ? 0f : 1f, 200, Easing.OutQuint); + if (ShowOsuLogo) + logo?.FadeTo(v.NewValue == Visibility.Visible ? 0f : 1f, 200, Easing.OutQuint); }); // 当 mod 变化时,只有在存在 Loop 类型的 mod 时才开启 DuplicateVirtualTrack 行为,避免状态混乱。 @@ -850,6 +856,9 @@ namespace osu.Game.Screens.SelectV2 { base.LogoArriving(logo, resuming); + if (!ShowOsuLogo) + return; + if (logo.Alpha > 0.8f && resuming) Footer?.StartTrackingLogo(logo, 400, Easing.OutQuint); else @@ -873,6 +882,10 @@ namespace osu.Game.Screens.SelectV2 protected override void LogoSuspending(OsuLogo logo) { base.LogoSuspending(logo); + + if (!ShowOsuLogo) + return; + Footer?.StopTrackingLogo(); } @@ -880,6 +893,9 @@ namespace osu.Game.Screens.SelectV2 { base.LogoExiting(logo); + if (!ShowOsuLogo) + return; + Footer?.StopTrackingLogo(); logo.ScaleTo(0.2f, 120, Easing.Out); diff --git a/osu.Game/Tests/Visual/Metadata/TestMetadataClient.cs b/osu.Game/Tests/Visual/Metadata/TestMetadataClient.cs index dca1b0e468..5ded0601df 100644 --- a/osu.Game/Tests/Visual/Metadata/TestMetadataClient.cs +++ b/osu.Game/Tests/Visual/Metadata/TestMetadataClient.cs @@ -128,6 +128,8 @@ namespace osu.Game.Tests.Visual.Metadata public override Task EndWatchingMultiplayerRoom(long id) => Task.CompletedTask; + public override Task RefreshFriends() => Task.CompletedTask; + public void Disconnect() { isConnected.Value = false;