From 4ea03d0e0710bb49763518de9fc09785ed0d0d8f Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 4 Nov 2025 11:21:33 +0900 Subject: [PATCH] Add history footer button to quick play rooms --- .../ScreenMatchmaking.HistoryFooterButton.cs | 40 +++++++++++++++++++ .../Matchmaking/Match/ScreenMatchmaking.cs | 11 ++++- 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 osu.Game/Screens/OnlinePlay/Matchmaking/Match/ScreenMatchmaking.HistoryFooterButton.cs diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/ScreenMatchmaking.HistoryFooterButton.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/ScreenMatchmaking.HistoryFooterButton.cs new file mode 100644 index 0000000000..94e19ab7b9 --- /dev/null +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/ScreenMatchmaking.HistoryFooterButton.cs @@ -0,0 +1,40 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; +using osu.Game.Online.Multiplayer; +using osu.Game.Screens.Footer; + +namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match +{ + public partial class ScreenMatchmaking + { + private partial class HistoryFooterButton : ScreenFooterButton + { + [Resolved] + private OsuGame? game { get; set; } + + private readonly MultiplayerRoom room; + + public HistoryFooterButton(MultiplayerRoom room) + { + this.room = room; + + Action = openRoomHistory; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + Text = "History"; + Icon = FontAwesome.Solid.Globe; + AccentColour = colours.Lime1; + } + + private void openRoomHistory() + => game?.OpenUrlExternally($@"/multiplayer/rooms/{room.RoomID}"); + } + } +} diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/ScreenMatchmaking.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/ScreenMatchmaking.cs index 527b1ba243..160fdd7405 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/ScreenMatchmaking.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/ScreenMatchmaking.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System.Collections.Generic; using System.Linq; using System.Threading; using osu.Framework.Allocation; @@ -29,6 +30,7 @@ using osu.Game.Online.Rooms; using osu.Game.Overlays; using osu.Game.Overlays.Dialog; using osu.Game.Rulesets; +using osu.Game.Screens.Footer; using osu.Game.Screens.OnlinePlay.Matchmaking.Match.Gameplay; using osu.Game.Screens.OnlinePlay.Multiplayer; using osu.Game.Users; @@ -164,7 +166,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - Size = new Vector2(700, 130), + Size = new Vector2(600, 130), Margin = new MarginPadding { Bottom = row_padding } } ] @@ -326,6 +328,11 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match return false; } + public override IReadOnlyList CreateFooterButtons() => + [ + new HistoryFooterButton(room) + ]; + public override void OnEntering(ScreenTransitionEvent e) { base.OnEntering(e); @@ -463,7 +470,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match // This component is added to the screen footer which is only about 50px high. // Therefore, it's given a large absolute size to give the context menu enough space to display correctly. - Size = new Vector2(700); + Size = new Vector2(600); InternalChild = new OsuContextMenuContainer {