mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Move create room button into the lounge
This commit is contained in:
@ -12,7 +12,6 @@ using osu.Framework.Logging;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Input;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.Rooms;
|
||||
@ -23,7 +22,6 @@ using osu.Game.Screens.OnlinePlay.Lounge;
|
||||
using osu.Game.Screens.OnlinePlay.Lounge.Components;
|
||||
using osu.Game.Screens.OnlinePlay.Match;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Screens.OnlinePlay
|
||||
{
|
||||
@ -38,7 +36,6 @@ namespace osu.Game.Screens.OnlinePlay
|
||||
|
||||
private readonly MultiplayerWaveContainer waves;
|
||||
|
||||
private readonly OsuButton createButton;
|
||||
private readonly LoungeSubScreen loungeSubScreen;
|
||||
private readonly ScreenStack screenStack;
|
||||
|
||||
@ -132,18 +129,6 @@ namespace osu.Game.Screens.OnlinePlay
|
||||
}
|
||||
},
|
||||
new Header(ScreenTitle, screenStack),
|
||||
createButton = CreateNewMultiplayerGameButton().With(button =>
|
||||
{
|
||||
button.Anchor = Anchor.TopRight;
|
||||
button.Origin = Anchor.TopRight;
|
||||
button.Size = new Vector2(150, Header.HEIGHT - 20);
|
||||
button.Margin = new MarginPadding
|
||||
{
|
||||
Top = 10,
|
||||
Right = 10 + HORIZONTAL_OVERFLOW_PADDING,
|
||||
};
|
||||
button.Action = () => OpenNewRoom();
|
||||
}),
|
||||
RoomManager = CreateRoomManager(),
|
||||
ongoingOperationTracker = new OngoingOperationTracker()
|
||||
}
|
||||
@ -278,18 +263,6 @@ namespace osu.Game.Screens.OnlinePlay
|
||||
logo.Delay(WaveContainer.DISAPPEAR_DURATION / 2).FadeOut();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates and opens the newly-created room.
|
||||
/// </summary>
|
||||
/// <param name="room">An optional template to use when creating the room.</param>
|
||||
public void OpenNewRoom(Room room = null) => loungeSubScreen.Open(room ?? CreateNewRoom());
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new room.
|
||||
/// </summary>
|
||||
/// <returns>The created <see cref="Room"/>.</returns>
|
||||
protected abstract Room CreateNewRoom();
|
||||
|
||||
private void screenPushed(IScreen lastScreen, IScreen newScreen)
|
||||
{
|
||||
subScreenChanged(lastScreen, newScreen);
|
||||
@ -325,7 +298,6 @@ namespace osu.Game.Screens.OnlinePlay
|
||||
((IBindable<UserActivity>)Activity).BindTo(newOsuScreen.Activity);
|
||||
|
||||
UpdatePollingRate(isIdle.Value);
|
||||
createButton.FadeTo(newScreen is LoungeSubScreen ? 1 : 0, 200);
|
||||
}
|
||||
|
||||
protected IScreen CurrentSubScreen => screenStack.CurrentScreen;
|
||||
@ -336,8 +308,6 @@ namespace osu.Game.Screens.OnlinePlay
|
||||
|
||||
protected abstract LoungeSubScreen CreateLounge();
|
||||
|
||||
protected abstract OsuButton CreateNewMultiplayerGameButton();
|
||||
|
||||
private class MultiplayerWaveContainer : WaveContainer
|
||||
{
|
||||
protected override bool StartHidden => true;
|
||||
|
Reference in New Issue
Block a user