mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 07:23:14 +08:00
Merge branch 'master' into ensure-music-playing-mainmenu-lounge
This commit is contained in:
commit
be2c892c30
@ -5,7 +5,9 @@ using System;
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Testing.Input;
|
using osu.Framework.Testing.Input;
|
||||||
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Rulesets.Osu.UI.Cursor;
|
using osu.Game.Rulesets.Osu.UI.Cursor;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
@ -24,9 +26,34 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuConfigManager config { get; set; }
|
private OsuConfigManager config { get; set; }
|
||||||
|
|
||||||
|
private Drawable background;
|
||||||
|
|
||||||
public TestSceneGameplayCursor()
|
public TestSceneGameplayCursor()
|
||||||
{
|
{
|
||||||
gameplayBeatmap = new GameplayBeatmap(CreateBeatmap(new OsuRuleset().RulesetInfo));
|
gameplayBeatmap = new GameplayBeatmap(CreateBeatmap(new OsuRuleset().RulesetInfo));
|
||||||
|
|
||||||
|
AddStep("change background colour", () =>
|
||||||
|
{
|
||||||
|
background?.Expire();
|
||||||
|
|
||||||
|
Add(background = new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Depth = float.MaxValue,
|
||||||
|
Colour = new Colour4(RNG.NextSingle(), RNG.NextSingle(), RNG.NextSingle(), 1)
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
AddSliderStep("circle size", 0f, 10f, 0f, val =>
|
||||||
|
{
|
||||||
|
config.Set(OsuSetting.AutoCursorSize, true);
|
||||||
|
gameplayBeatmap.BeatmapInfo.BaseDifficulty.CircleSize = val;
|
||||||
|
Scheduler.AddOnce(recreate);
|
||||||
|
});
|
||||||
|
|
||||||
|
AddStep("test cursor container", recreate);
|
||||||
|
|
||||||
|
void recreate() => SetContents(() => new OsuInputManager(new OsuRuleset().RulesetInfo) { Child = new OsuCursorContainer() });
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase(1, 1)]
|
[TestCase(1, 1)]
|
||||||
@ -69,16 +96,27 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
|
|
||||||
private class ClickingCursorContainer : OsuCursorContainer
|
private class ClickingCursorContainer : OsuCursorContainer
|
||||||
{
|
{
|
||||||
|
private bool pressed;
|
||||||
|
|
||||||
|
public bool Pressed
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == pressed)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pressed = value;
|
||||||
|
if (value)
|
||||||
|
OnPressed(OsuAction.LeftButton);
|
||||||
|
else
|
||||||
|
OnReleased(OsuAction.LeftButton);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
Pressed = ((int)(Time.Current / 1000)) % 2 == 0;
|
||||||
double currentTime = Time.Current;
|
|
||||||
|
|
||||||
if (((int)(currentTime / 1000)) % 2 == 0)
|
|
||||||
OnPressed(OsuAction.LeftButton);
|
|
||||||
else
|
|
||||||
OnReleased(OsuAction.LeftButton);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,6 +125,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
public MovingCursorInputManager()
|
public MovingCursorInputManager()
|
||||||
{
|
{
|
||||||
UseParentInput = false;
|
UseParentInput = false;
|
||||||
|
ShowVisualCursorGuide = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
@ -59,10 +59,10 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
{
|
{
|
||||||
if (!cursorExpand) return;
|
if (!cursorExpand) return;
|
||||||
|
|
||||||
expandTarget.ScaleTo(released_scale).ScaleTo(pressed_scale, 100, Easing.OutQuad);
|
expandTarget.ScaleTo(released_scale).ScaleTo(pressed_scale, 400, Easing.OutElasticHalf);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Contract() => expandTarget.ScaleTo(released_scale, 100, Easing.OutQuad);
|
public void Contract() => expandTarget.ScaleTo(released_scale, 400, Easing.OutQuad);
|
||||||
|
|
||||||
private class DefaultCursor : OsuCursorSprite
|
private class DefaultCursor : OsuCursorSprite
|
||||||
{
|
{
|
||||||
@ -115,24 +115,22 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
new CircularContainer
|
},
|
||||||
{
|
},
|
||||||
Origin = Anchor.Centre,
|
new Circle
|
||||||
Anchor = Anchor.Centre,
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
Origin = Anchor.Centre,
|
||||||
Scale = new Vector2(0.1f),
|
Anchor = Anchor.Centre,
|
||||||
Masking = true,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Children = new Drawable[]
|
Scale = new Vector2(0.14f),
|
||||||
{
|
Colour = new Color4(34, 93, 204, 255),
|
||||||
new Box
|
EdgeEffect = new EdgeEffectParameters
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
Type = EdgeEffectType.Glow,
|
||||||
Colour = Color4.White,
|
Radius = 8,
|
||||||
},
|
Colour = Color4.White,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,9 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
|
|
||||||
private readonly Drawable cursorTrail;
|
private readonly Drawable cursorTrail;
|
||||||
|
|
||||||
public Bindable<float> CursorScale = new BindableFloat(1);
|
public IBindable<float> CursorScale => cursorScale;
|
||||||
|
|
||||||
|
private readonly Bindable<float> cursorScale = new BindableFloat(1);
|
||||||
|
|
||||||
private Bindable<float> userCursorScale;
|
private Bindable<float> userCursorScale;
|
||||||
private Bindable<bool> autoCursorScale;
|
private Bindable<bool> autoCursorScale;
|
||||||
@ -68,13 +70,13 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
autoCursorScale = config.GetBindable<bool>(OsuSetting.AutoCursorSize);
|
autoCursorScale = config.GetBindable<bool>(OsuSetting.AutoCursorSize);
|
||||||
autoCursorScale.ValueChanged += _ => calculateScale();
|
autoCursorScale.ValueChanged += _ => calculateScale();
|
||||||
|
|
||||||
CursorScale.ValueChanged += e =>
|
CursorScale.BindValueChanged(e =>
|
||||||
{
|
{
|
||||||
var newScale = new Vector2(e.NewValue);
|
var newScale = new Vector2(e.NewValue);
|
||||||
|
|
||||||
ActiveCursor.Scale = newScale;
|
ActiveCursor.Scale = newScale;
|
||||||
cursorTrail.Scale = newScale;
|
cursorTrail.Scale = newScale;
|
||||||
};
|
}, true);
|
||||||
|
|
||||||
calculateScale();
|
calculateScale();
|
||||||
}
|
}
|
||||||
@ -95,7 +97,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
scale *= GetScaleForCircleSize(beatmap.BeatmapInfo.BaseDifficulty.CircleSize);
|
scale *= GetScaleForCircleSize(beatmap.BeatmapInfo.BaseDifficulty.CircleSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
CursorScale.Value = scale;
|
cursorScale.Value = scale;
|
||||||
|
|
||||||
var newScale = new Vector2(scale);
|
var newScale = new Vector2(scale);
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
private OsuClickToResumeCursor clickToResumeCursor;
|
private OsuClickToResumeCursor clickToResumeCursor;
|
||||||
|
|
||||||
private OsuCursorContainer localCursorContainer;
|
private OsuCursorContainer localCursorContainer;
|
||||||
private Bindable<float> localCursorScale;
|
private IBindable<float> localCursorScale;
|
||||||
|
|
||||||
public override CursorContainer LocalCursor => State.Value == Visibility.Visible ? localCursorContainer : null;
|
public override CursorContainer LocalCursor => State.Value == Visibility.Visible ? localCursorContainer : null;
|
||||||
|
|
||||||
|
@ -34,7 +34,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
RoomID = { Value = i },
|
RoomID = { Value = i },
|
||||||
Name = { Value = $"Room {i}" },
|
Name = { Value = $"Room {i}" },
|
||||||
Host = { Value = new User { Username = "Host" } },
|
Host = { Value = new User { Username = "Host" } },
|
||||||
EndDate = { Value = DateTimeOffset.Now + TimeSpan.FromSeconds(10) }
|
EndDate = { Value = DateTimeOffset.Now + TimeSpan.FromSeconds(10) },
|
||||||
|
Category = { Value = i % 2 == 0 ? RoomCategory.Spotlight : RoomCategory.Normal }
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ruleset != null)
|
if (ruleset != null)
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
// 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 osu.Framework.Graphics;
|
||||||
|
using osu.Game.Screens.Multi.Lounge.Components;
|
||||||
|
|
||||||
|
namespace osu.Game.Tests.Visual.Multiplayer
|
||||||
|
{
|
||||||
|
public class TestSceneLoungeFilterControl : OsuTestScene
|
||||||
|
{
|
||||||
|
public TestSceneLoungeFilterControl()
|
||||||
|
{
|
||||||
|
Child = new FilterControl
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -24,12 +24,11 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
{
|
{
|
||||||
AddStep("create component", () =>
|
AddStep("create component", () =>
|
||||||
{
|
{
|
||||||
Child = new OverlinedParticipants(Direction.Horizontal)
|
Child = new ParticipantsDisplay(Direction.Horizontal)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Width = 500,
|
Width = 500,
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -39,7 +38,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
{
|
{
|
||||||
AddStep("create component", () =>
|
AddStep("create component", () =>
|
||||||
{
|
{
|
||||||
Child = new OverlinedParticipants(Direction.Vertical)
|
Child = new ParticipantsDisplay(Direction.Vertical)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Rulesets.Osu;
|
using osu.Game.Rulesets.Osu;
|
||||||
using osu.Game.Screens.Multi.Components;
|
using osu.Game.Screens.Multi;
|
||||||
using osu.Game.Tests.Beatmaps;
|
using osu.Game.Tests.Beatmaps;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Add(new OverlinedPlaylist(false)
|
Add(new DrawableRoomPlaylist(false, false)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
// 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 NUnit.Framework;
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Game.Graphics.UserInterface;
|
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.UserInterface
|
|
||||||
{
|
|
||||||
[TestFixture]
|
|
||||||
public class TestSceneNumberBox : OsuTestScene
|
|
||||||
{
|
|
||||||
private OsuNumberBox numberBox;
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load()
|
|
||||||
{
|
|
||||||
Child = new Container
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
Padding = new MarginPadding { Horizontal = 250 },
|
|
||||||
Child = numberBox = new OsuNumberBox
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
PlaceholderText = "Insert numbers here"
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
clearInput();
|
|
||||||
AddStep("enter numbers", () => numberBox.Text = "987654321");
|
|
||||||
expectedValue("987654321");
|
|
||||||
clearInput();
|
|
||||||
AddStep("enter text + single number", () => numberBox.Text = "1 hello 2 world 3");
|
|
||||||
expectedValue("123");
|
|
||||||
clearInput();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void clearInput() => AddStep("clear input", () => numberBox.Text = null);
|
|
||||||
|
|
||||||
private void expectedValue(string value) => AddAssert("expect number", () => numberBox.Text == value);
|
|
||||||
}
|
|
||||||
}
|
|
80
osu.Game.Tests/Visual/UserInterface/TestSceneOsuTextBox.cs
Normal file
80
osu.Game.Tests/Visual/UserInterface/TestSceneOsuTextBox.cs
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
// 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 NUnit.Framework;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
using osuTK;
|
||||||
|
using osuTK.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.Tests.Visual.UserInterface
|
||||||
|
{
|
||||||
|
public class TestSceneOsuTextBox : OsuTestScene
|
||||||
|
{
|
||||||
|
private readonly OsuNumberBox numberBox;
|
||||||
|
|
||||||
|
public TestSceneOsuTextBox()
|
||||||
|
{
|
||||||
|
Child = new Container
|
||||||
|
{
|
||||||
|
Masking = true,
|
||||||
|
CornerRadius = 10f,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Padding = new MarginPadding(15f),
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = Color4.DarkSlateGray,
|
||||||
|
Alpha = 0.75f,
|
||||||
|
},
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
|
Padding = new MarginPadding(50f),
|
||||||
|
Spacing = new Vector2(0f, 50f),
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
new OsuTextBox
|
||||||
|
{
|
||||||
|
Width = 500f,
|
||||||
|
PlaceholderText = "Normal textbox",
|
||||||
|
},
|
||||||
|
new OsuPasswordTextBox
|
||||||
|
{
|
||||||
|
Width = 500f,
|
||||||
|
PlaceholderText = "Password textbox",
|
||||||
|
},
|
||||||
|
numberBox = new OsuNumberBox
|
||||||
|
{
|
||||||
|
Width = 500f,
|
||||||
|
PlaceholderText = "Number textbox"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestNumberBox()
|
||||||
|
{
|
||||||
|
clearTextbox(numberBox);
|
||||||
|
AddStep("enter numbers", () => numberBox.Text = "987654321");
|
||||||
|
expectedValue(numberBox, "987654321");
|
||||||
|
|
||||||
|
clearTextbox(numberBox);
|
||||||
|
AddStep("enter text + single number", () => numberBox.Text = "1 hello 2 world 3");
|
||||||
|
expectedValue(numberBox, "123");
|
||||||
|
|
||||||
|
clearTextbox(numberBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void clearTextbox(OsuTextBox textBox) => AddStep("clear textbox", () => textBox.Text = null);
|
||||||
|
private void expectedValue(OsuTextBox textBox, string value) => AddAssert("expected textbox value", () => textBox.Text == value);
|
||||||
|
}
|
||||||
|
}
|
@ -24,6 +24,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Child = new PasswordMaskChar(CalculatedTextSize),
|
Child = new PasswordMaskChar(CalculatedTextSize),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
protected override bool AllowUniqueCharacterSamples => false;
|
||||||
|
|
||||||
protected override bool AllowClipboardExport => false;
|
protected override bool AllowClipboardExport => false;
|
||||||
|
|
||||||
private readonly CapsWarning warning;
|
private readonly CapsWarning warning;
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Audio;
|
||||||
|
using osu.Framework.Audio.Sample;
|
||||||
using osu.Framework.Audio.Track;
|
using osu.Framework.Audio.Track;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
@ -11,6 +14,7 @@ using osuTK.Graphics;
|
|||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -19,6 +23,18 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
public class OsuTextBox : BasicTextBox
|
public class OsuTextBox : BasicTextBox
|
||||||
{
|
{
|
||||||
|
private readonly SampleChannel[] textAddedSamples = new SampleChannel[4];
|
||||||
|
private SampleChannel capsTextAddedSample;
|
||||||
|
private SampleChannel textRemovedSample;
|
||||||
|
private SampleChannel textCommittedSample;
|
||||||
|
private SampleChannel caretMovedSample;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether to allow playing a different samples based on the type of character.
|
||||||
|
/// If set to false, the same sample will be used for all characters.
|
||||||
|
/// </summary>
|
||||||
|
protected virtual bool AllowUniqueCharacterSamples => true;
|
||||||
|
|
||||||
protected override float LeftRightPadding => 10;
|
protected override float LeftRightPadding => 10;
|
||||||
|
|
||||||
protected override float CaretWidth => 3;
|
protected override float CaretWidth => 3;
|
||||||
@ -41,15 +57,54 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colour)
|
private void load(OsuColour colour, AudioManager audio)
|
||||||
{
|
{
|
||||||
BackgroundUnfocused = Color4.Black.Opacity(0.5f);
|
BackgroundUnfocused = Color4.Black.Opacity(0.5f);
|
||||||
BackgroundFocused = OsuColour.Gray(0.3f).Opacity(0.8f);
|
BackgroundFocused = OsuColour.Gray(0.3f).Opacity(0.8f);
|
||||||
BackgroundCommit = BorderColour = colour.Yellow;
|
BackgroundCommit = BorderColour = colour.Yellow;
|
||||||
|
|
||||||
|
for (int i = 0; i < textAddedSamples.Length; i++)
|
||||||
|
textAddedSamples[i] = audio.Samples.Get($@"Keyboard/key-press-{1 + i}");
|
||||||
|
|
||||||
|
capsTextAddedSample = audio.Samples.Get(@"Keyboard/key-caps");
|
||||||
|
textRemovedSample = audio.Samples.Get(@"Keyboard/key-delete");
|
||||||
|
textCommittedSample = audio.Samples.Get(@"Keyboard/key-confirm");
|
||||||
|
caretMovedSample = audio.Samples.Get(@"Keyboard/key-movement");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Color4 SelectionColour => new Color4(249, 90, 255, 255);
|
protected override Color4 SelectionColour => new Color4(249, 90, 255, 255);
|
||||||
|
|
||||||
|
protected override void OnTextAdded(string added)
|
||||||
|
{
|
||||||
|
base.OnTextAdded(added);
|
||||||
|
|
||||||
|
if (added.Any(char.IsUpper) && AllowUniqueCharacterSamples)
|
||||||
|
capsTextAddedSample?.Play();
|
||||||
|
else
|
||||||
|
textAddedSamples[RNG.Next(0, 3)]?.Play();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnTextRemoved(string removed)
|
||||||
|
{
|
||||||
|
base.OnTextRemoved(removed);
|
||||||
|
|
||||||
|
textRemovedSample?.Play();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnTextCommitted(bool textChanged)
|
||||||
|
{
|
||||||
|
base.OnTextCommitted(textChanged);
|
||||||
|
|
||||||
|
textCommittedSample?.Play();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnCaretMoved(bool selecting)
|
||||||
|
{
|
||||||
|
base.OnCaretMoved(selecting);
|
||||||
|
|
||||||
|
caretMovedSample?.Play();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnFocus(FocusEvent e)
|
protected override void OnFocus(FocusEvent e)
|
||||||
{
|
{
|
||||||
BorderThickness = 3;
|
BorderThickness = 3;
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Humanizer;
|
||||||
|
using osu.Framework.IO.Network;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Screens.Multi.Lounge.Components;
|
using osu.Game.Screens.Multi.Lounge.Components;
|
||||||
|
|
||||||
@ -9,39 +11,28 @@ namespace osu.Game.Online.API.Requests
|
|||||||
{
|
{
|
||||||
public class GetRoomsRequest : APIRequest<List<Room>>
|
public class GetRoomsRequest : APIRequest<List<Room>>
|
||||||
{
|
{
|
||||||
private readonly PrimaryFilter primaryFilter;
|
private readonly RoomStatusFilter statusFilter;
|
||||||
|
private readonly RoomCategoryFilter categoryFilter;
|
||||||
|
|
||||||
public GetRoomsRequest(PrimaryFilter primaryFilter)
|
public GetRoomsRequest(RoomStatusFilter statusFilter, RoomCategoryFilter categoryFilter)
|
||||||
{
|
{
|
||||||
this.primaryFilter = primaryFilter;
|
this.statusFilter = statusFilter;
|
||||||
|
this.categoryFilter = categoryFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string Target
|
protected override WebRequest CreateWebRequest()
|
||||||
{
|
{
|
||||||
get
|
var req = base.CreateWebRequest();
|
||||||
{
|
|
||||||
string target = "rooms";
|
|
||||||
|
|
||||||
switch (primaryFilter)
|
if (statusFilter != RoomStatusFilter.Open)
|
||||||
{
|
req.AddParameter("mode", statusFilter.ToString().Underscore().ToLowerInvariant());
|
||||||
case PrimaryFilter.Open:
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PrimaryFilter.Owned:
|
if (categoryFilter != RoomCategoryFilter.Any)
|
||||||
target += "/owned";
|
req.AddParameter("category", categoryFilter.ToString().Underscore().ToLowerInvariant());
|
||||||
break;
|
|
||||||
|
|
||||||
case PrimaryFilter.Participated:
|
return req;
|
||||||
target += "/participated";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PrimaryFilter.RecentlyEnded:
|
|
||||||
target += "/ended";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override string Target => "rooms";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,10 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
[JsonProperty("channel_id")]
|
[JsonProperty("channel_id")]
|
||||||
public readonly Bindable<int> ChannelId = new Bindable<int>();
|
public readonly Bindable<int> ChannelId = new Bindable<int>();
|
||||||
|
|
||||||
|
[Cached]
|
||||||
|
[JsonProperty("category")]
|
||||||
|
public readonly Bindable<RoomCategory> Category = new Bindable<RoomCategory>();
|
||||||
|
|
||||||
[Cached]
|
[Cached]
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public readonly Bindable<TimeSpan> Duration = new Bindable<TimeSpan>(TimeSpan.FromMinutes(30));
|
public readonly Bindable<TimeSpan> Duration = new Bindable<TimeSpan>(TimeSpan.FromMinutes(30));
|
||||||
|
11
osu.Game/Online/Multiplayer/RoomCategory.cs
Normal file
11
osu.Game/Online/Multiplayer/RoomCategory.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
namespace osu.Game.Online.Multiplayer
|
||||||
|
{
|
||||||
|
public enum RoomCategory
|
||||||
|
{
|
||||||
|
Normal,
|
||||||
|
Spotlight
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -11,44 +10,23 @@ using osu.Game.Graphics.Containers;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays.SearchableList
|
namespace osu.Game.Overlays.SearchableList
|
||||||
{
|
{
|
||||||
public class DisplayStyleControl<T> : Container
|
public class DisplayStyleControl : CompositeDrawable
|
||||||
where T : struct, Enum
|
|
||||||
{
|
{
|
||||||
public readonly SlimEnumDropdown<T> Dropdown;
|
|
||||||
public readonly Bindable<PanelDisplayStyle> DisplayStyle = new Bindable<PanelDisplayStyle>();
|
public readonly Bindable<PanelDisplayStyle> DisplayStyle = new Bindable<PanelDisplayStyle>();
|
||||||
|
|
||||||
public DisplayStyleControl()
|
public DisplayStyleControl()
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
Children = new[]
|
InternalChild = new FillFlowContainer
|
||||||
{
|
{
|
||||||
new FillFlowContainer
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Spacing = new Vector2(5f, 0f),
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
Children = new[]
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both,
|
new DisplayStyleToggleButton(FontAwesome.Solid.ThLarge, PanelDisplayStyle.Grid, DisplayStyle),
|
||||||
Anchor = Anchor.TopRight,
|
new DisplayStyleToggleButton(FontAwesome.Solid.ListUl, PanelDisplayStyle.List, DisplayStyle),
|
||||||
Origin = Anchor.TopRight,
|
|
||||||
Spacing = new Vector2(10f, 0f),
|
|
||||||
Direction = FillDirection.Horizontal,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new FillFlowContainer
|
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Spacing = new Vector2(5f, 0f),
|
|
||||||
Direction = FillDirection.Horizontal,
|
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
new DisplayStyleToggleButton(FontAwesome.Solid.ThLarge, PanelDisplayStyle.Grid, DisplayStyle),
|
|
||||||
new DisplayStyleToggleButton(FontAwesome.Solid.ListUl, PanelDisplayStyle.List, DisplayStyle),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Dropdown = new SlimEnumDropdown<T>
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.None,
|
|
||||||
Width = 160f,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -19,12 +19,14 @@ namespace osu.Game.Overlays.SearchableList
|
|||||||
{
|
{
|
||||||
private const float padding = 10;
|
private const float padding = 10;
|
||||||
|
|
||||||
private readonly Container filterContainer;
|
private readonly Drawable filterContainer;
|
||||||
|
private readonly Drawable rightFilterContainer;
|
||||||
private readonly Box tabStrip;
|
private readonly Box tabStrip;
|
||||||
|
|
||||||
public readonly SearchTextBox Search;
|
public readonly SearchTextBox Search;
|
||||||
public readonly PageTabControl<TTab> Tabs;
|
public readonly PageTabControl<TTab> Tabs;
|
||||||
public readonly DisplayStyleControl<TCategory> DisplayStyleControl;
|
public readonly SlimEnumDropdown<TCategory> Dropdown;
|
||||||
|
public readonly DisplayStyleControl DisplayStyleControl;
|
||||||
|
|
||||||
protected abstract Color4 BackgroundColour { get; }
|
protected abstract Color4 BackgroundColour { get; }
|
||||||
protected abstract TTab DefaultTab { get; }
|
protected abstract TTab DefaultTab { get; }
|
||||||
@ -42,7 +44,7 @@ namespace osu.Game.Overlays.SearchableList
|
|||||||
|
|
||||||
var controls = CreateSupplementaryControls();
|
var controls = CreateSupplementaryControls();
|
||||||
Container controlsContainer;
|
Container controlsContainer;
|
||||||
Children = new Drawable[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
filterContainer = new Container
|
filterContainer = new Container
|
||||||
{
|
{
|
||||||
@ -104,11 +106,27 @@ namespace osu.Game.Overlays.SearchableList
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
DisplayStyleControl = new DisplayStyleControl<TCategory>
|
rightFilterContainer = new FillFlowContainer
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
},
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
Dropdown = new SlimEnumDropdown<TCategory>
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopRight,
|
||||||
|
Origin = Anchor.TopRight,
|
||||||
|
RelativeSizeAxes = Axes.None,
|
||||||
|
Width = 160f,
|
||||||
|
},
|
||||||
|
DisplayStyleControl = new DisplayStyleControl
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopRight,
|
||||||
|
Origin = Anchor.TopRight,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (controls != null) controlsContainer.Children = new[] { controls };
|
if (controls != null) controlsContainer.Children = new[] { controls };
|
||||||
@ -116,8 +134,8 @@ namespace osu.Game.Overlays.SearchableList
|
|||||||
Tabs.Current.Value = DefaultTab;
|
Tabs.Current.Value = DefaultTab;
|
||||||
Tabs.Current.TriggerChange();
|
Tabs.Current.TriggerChange();
|
||||||
|
|
||||||
DisplayStyleControl.Dropdown.Current.Value = DefaultCategory;
|
Dropdown.Current.Value = DefaultCategory;
|
||||||
DisplayStyleControl.Dropdown.Current.TriggerChange();
|
Dropdown.Current.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -131,7 +149,7 @@ namespace osu.Game.Overlays.SearchableList
|
|||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
Height = filterContainer.Height;
|
Height = filterContainer.Height;
|
||||||
DisplayStyleControl.Margin = new MarginPadding { Top = filterContainer.Height - 35, Right = SearchableListOverlay.WIDTH_PADDING };
|
rightFilterContainer.Margin = new MarginPadding { Top = filterContainer.Height - 30, Right = ContentHorizontalPadding };
|
||||||
}
|
}
|
||||||
|
|
||||||
private class FilterSearchTextBox : SearchTextBox
|
private class FilterSearchTextBox : SearchTextBox
|
||||||
|
@ -72,7 +72,7 @@ namespace osu.Game.Overlays
|
|||||||
Filter.Tabs.Current.ValueChanged += _ => onFilterUpdate();
|
Filter.Tabs.Current.ValueChanged += _ => onFilterUpdate();
|
||||||
|
|
||||||
Filter.DisplayStyleControl.DisplayStyle.ValueChanged += _ => recreatePanels();
|
Filter.DisplayStyleControl.DisplayStyle.ValueChanged += _ => recreatePanels();
|
||||||
Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += _ => recreatePanels();
|
Filter.Dropdown.Current.ValueChanged += _ => recreatePanels();
|
||||||
|
|
||||||
currentQuery.BindTo(Filter.Search.Current);
|
currentQuery.BindTo(Filter.Search.Current);
|
||||||
currentQuery.ValueChanged += query =>
|
currentQuery.ValueChanged += query =>
|
||||||
@ -155,7 +155,7 @@ namespace osu.Game.Overlays
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Filter.DisplayStyleControl.Dropdown.Current.Value == SortDirection.Descending)
|
if (Filter.Dropdown.Current.Value == SortDirection.Descending)
|
||||||
sortedUsers = sortedUsers.Reverse();
|
sortedUsers = sortedUsers.Reverse();
|
||||||
|
|
||||||
var newPanels = new FillFlowContainer<UserPanel>
|
var newPanels = new FillFlowContainer<UserPanel>
|
||||||
|
@ -1,131 +0,0 @@
|
|||||||
// 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 osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Framework.Graphics.Shapes;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Graphics.Sprites;
|
|
||||||
using osuTK;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Multi.Components
|
|
||||||
{
|
|
||||||
public abstract class OverlinedDisplay : MultiplayerComposite
|
|
||||||
{
|
|
||||||
protected readonly Container Content;
|
|
||||||
|
|
||||||
public override Axes RelativeSizeAxes
|
|
||||||
{
|
|
||||||
get => base.RelativeSizeAxes;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
base.RelativeSizeAxes = value;
|
|
||||||
updateDimensions();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Axes AutoSizeAxes
|
|
||||||
{
|
|
||||||
get => base.AutoSizeAxes;
|
|
||||||
protected set
|
|
||||||
{
|
|
||||||
base.AutoSizeAxes = value;
|
|
||||||
updateDimensions();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool showLine = true;
|
|
||||||
|
|
||||||
public bool ShowLine
|
|
||||||
{
|
|
||||||
get => showLine;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
showLine = value;
|
|
||||||
line.Alpha = value ? 1 : 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected string Details
|
|
||||||
{
|
|
||||||
set => details.Text = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
private readonly Circle line;
|
|
||||||
private readonly OsuSpriteText details;
|
|
||||||
private readonly GridContainer grid;
|
|
||||||
|
|
||||||
protected OverlinedDisplay(string title)
|
|
||||||
{
|
|
||||||
InternalChild = grid = new GridContainer
|
|
||||||
{
|
|
||||||
Content = new[]
|
|
||||||
{
|
|
||||||
new Drawable[]
|
|
||||||
{
|
|
||||||
line = new Circle
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
Height = 2,
|
|
||||||
Margin = new MarginPadding { Bottom = 2 }
|
|
||||||
},
|
|
||||||
},
|
|
||||||
new Drawable[]
|
|
||||||
{
|
|
||||||
new FillFlowContainer
|
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Direction = FillDirection.Horizontal,
|
|
||||||
Margin = new MarginPadding { Top = 5 },
|
|
||||||
Spacing = new Vector2(10, 0),
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new OsuSpriteText
|
|
||||||
{
|
|
||||||
Text = title,
|
|
||||||
Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold)
|
|
||||||
},
|
|
||||||
details = new OsuSpriteText
|
|
||||||
{
|
|
||||||
Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold)
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
new Drawable[]
|
|
||||||
{
|
|
||||||
Content = new Container { Padding = new MarginPadding { Top = 5 } }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
updateDimensions();
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuColour colours)
|
|
||||||
{
|
|
||||||
line.Colour = colours.Yellow;
|
|
||||||
details.Colour = colours.Yellow;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateDimensions()
|
|
||||||
{
|
|
||||||
grid.RowDimensions = new[]
|
|
||||||
{
|
|
||||||
new Dimension(GridSizeMode.AutoSize),
|
|
||||||
new Dimension(GridSizeMode.AutoSize),
|
|
||||||
new Dimension(AutoSizeAxes.HasFlag(Axes.Y) ? GridSizeMode.AutoSize : GridSizeMode.Distributed),
|
|
||||||
};
|
|
||||||
|
|
||||||
// Assigning to none is done so that setting auto and relative size modes doesn't cause exceptions to be thrown
|
|
||||||
grid.AutoSizeAxes = Content.AutoSizeAxes = Axes.None;
|
|
||||||
grid.RelativeSizeAxes = Content.RelativeSizeAxes = Axes.None;
|
|
||||||
|
|
||||||
// Auto-size when required, otherwise eagerly relative-size
|
|
||||||
grid.AutoSizeAxes = Content.AutoSizeAxes = AutoSizeAxes;
|
|
||||||
grid.RelativeSizeAxes = Content.RelativeSizeAxes = ~AutoSizeAxes;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
89
osu.Game/Screens/Multi/Components/OverlinedHeader.cs
Normal file
89
osu.Game/Screens/Multi/Components/OverlinedHeader.cs
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
// 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 osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Screens.Multi.Components
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A header used in the multiplayer interface which shows text / details beneath a line.
|
||||||
|
/// </summary>
|
||||||
|
public class OverlinedHeader : MultiplayerComposite
|
||||||
|
{
|
||||||
|
private bool showLine = true;
|
||||||
|
|
||||||
|
public bool ShowLine
|
||||||
|
{
|
||||||
|
get => showLine;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
showLine = value;
|
||||||
|
line.Alpha = value ? 1 : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Bindable<string> Details = new Bindable<string>();
|
||||||
|
|
||||||
|
private readonly Circle line;
|
||||||
|
private readonly OsuSpriteText details;
|
||||||
|
|
||||||
|
public OverlinedHeader(string title)
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
AutoSizeAxes = Axes.Y;
|
||||||
|
|
||||||
|
Margin = new MarginPadding { Bottom = 5 };
|
||||||
|
|
||||||
|
InternalChild = new FillFlowContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
line = new Circle
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Height = 2,
|
||||||
|
Margin = new MarginPadding { Bottom = 2 }
|
||||||
|
},
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
Margin = new MarginPadding { Top = 5 },
|
||||||
|
Spacing = new Vector2(10, 0),
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Text = title,
|
||||||
|
Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold)
|
||||||
|
},
|
||||||
|
details = new OsuSpriteText
|
||||||
|
{
|
||||||
|
Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Details.BindValueChanged(val => details.Text = val.NewValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuColour colours)
|
||||||
|
{
|
||||||
|
line.Colour = colours.Yellow;
|
||||||
|
details.Colour = colours.Yellow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,33 +0,0 @@
|
|||||||
// 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 osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Bindables;
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Game.Online.Multiplayer;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Multi.Components
|
|
||||||
{
|
|
||||||
public class OverlinedPlaylist : OverlinedDisplay
|
|
||||||
{
|
|
||||||
public readonly Bindable<PlaylistItem> SelectedItem = new Bindable<PlaylistItem>();
|
|
||||||
|
|
||||||
private readonly DrawableRoomPlaylist playlist;
|
|
||||||
|
|
||||||
public OverlinedPlaylist(bool allowSelection)
|
|
||||||
: base("Playlist")
|
|
||||||
{
|
|
||||||
Content.Add(playlist = new DrawableRoomPlaylist(false, allowSelection)
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
SelectedItem = { BindTarget = SelectedItem }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load()
|
|
||||||
{
|
|
||||||
playlist.Items.BindTo(Playlist);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,26 +2,22 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Multi.Components
|
namespace osu.Game.Screens.Multi.Components
|
||||||
{
|
{
|
||||||
public class OverlinedParticipants : OverlinedDisplay
|
public class ParticipantsDisplay : MultiplayerComposite
|
||||||
{
|
{
|
||||||
public new Axes AutoSizeAxes
|
public Bindable<string> Details = new Bindable<string>();
|
||||||
{
|
|
||||||
get => base.AutoSizeAxes;
|
|
||||||
set => base.AutoSizeAxes = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OverlinedParticipants(Direction direction)
|
public ParticipantsDisplay(Direction direction)
|
||||||
: base("Recent participants")
|
|
||||||
{
|
{
|
||||||
OsuScrollContainer scroll;
|
OsuScrollContainer scroll;
|
||||||
ParticipantsList list;
|
ParticipantsList list;
|
||||||
|
|
||||||
Content.Add(scroll = new OsuScrollContainer(direction)
|
AddInternal(scroll = new OsuScrollContainer(direction)
|
||||||
{
|
{
|
||||||
Child = list = new ParticipantsList()
|
Child = list = new ParticipantsList()
|
||||||
});
|
});
|
||||||
@ -29,13 +25,21 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
switch (direction)
|
switch (direction)
|
||||||
{
|
{
|
||||||
case Direction.Horizontal:
|
case Direction.Horizontal:
|
||||||
|
AutoSizeAxes = Axes.Y;
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
|
||||||
scroll.RelativeSizeAxes = Axes.X;
|
scroll.RelativeSizeAxes = Axes.X;
|
||||||
scroll.Height = ParticipantsList.TILE_SIZE + OsuScrollContainer.SCROLL_BAR_HEIGHT + OsuScrollContainer.SCROLL_BAR_PADDING * 2;
|
scroll.Height = ParticipantsList.TILE_SIZE + OsuScrollContainer.SCROLL_BAR_HEIGHT + OsuScrollContainer.SCROLL_BAR_PADDING * 2;
|
||||||
list.AutoSizeAxes = Axes.Both;
|
|
||||||
|
list.RelativeSizeAxes = Axes.Y;
|
||||||
|
list.AutoSizeAxes = Axes.X;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Direction.Vertical:
|
case Direction.Vertical:
|
||||||
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
scroll.RelativeSizeAxes = Axes.Both;
|
scroll.RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
list.RelativeSizeAxes = Axes.X;
|
list.RelativeSizeAxes = Axes.X;
|
||||||
list.AutoSizeAxes = Axes.Y;
|
list.AutoSizeAxes = Axes.Y;
|
||||||
break;
|
break;
|
||||||
@ -46,11 +50,10 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
ParticipantCount.BindValueChanged(_ => setParticipantCount());
|
ParticipantCount.BindValueChanged(_ => setParticipantCount());
|
||||||
MaxParticipants.BindValueChanged(_ => setParticipantCount());
|
MaxParticipants.BindValueChanged(_ => setParticipantCount(), true);
|
||||||
|
|
||||||
setParticipantCount();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setParticipantCount() => Details = MaxParticipants.Value != null ? $"{ParticipantCount.Value}/{MaxParticipants.Value}" : ParticipantCount.Value.ToString();
|
private void setParticipantCount() =>
|
||||||
|
Details.Value = MaxParticipants.Value != null ? $"{ParticipantCount.Value}/{MaxParticipants.Value}" : ParticipantCount.Value.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -17,6 +17,9 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
[Resolved(typeof(Room), nameof(Room.Status))]
|
[Resolved(typeof(Room), nameof(Room.Status))]
|
||||||
private Bindable<RoomStatus> status { get; set; }
|
private Bindable<RoomStatus> status { get; set; }
|
||||||
|
|
||||||
|
[Resolved(typeof(Room), nameof(Room.Category))]
|
||||||
|
private Bindable<RoomCategory> category { get; set; }
|
||||||
|
|
||||||
public StatusColouredContainer(double transitionDuration = 100)
|
public StatusColouredContainer(double transitionDuration = 100)
|
||||||
{
|
{
|
||||||
this.transitionDuration = transitionDuration;
|
this.transitionDuration = transitionDuration;
|
||||||
@ -25,7 +28,11 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
status.BindValueChanged(s => this.FadeColour(s.NewValue.GetAppropriateColour(colours), transitionDuration), true);
|
status.BindValueChanged(s =>
|
||||||
|
{
|
||||||
|
this.FadeColour(category.Value == RoomCategory.Spotlight ? colours.Pink : s.NewValue.GetAppropriateColour(colours)
|
||||||
|
, transitionDuration);
|
||||||
|
}, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,8 +60,6 @@ namespace osu.Game.Screens.Multi
|
|||||||
RequestDeletion = requestDeletion
|
RequestDeletion = requestDeletion
|
||||||
};
|
};
|
||||||
|
|
||||||
private void requestSelection(PlaylistItem item) => SelectedItem.Value = item;
|
|
||||||
|
|
||||||
private void requestDeletion(PlaylistItem item)
|
private void requestDeletion(PlaylistItem item)
|
||||||
{
|
{
|
||||||
if (SelectedItem.Value == item)
|
if (SelectedItem.Value == item)
|
||||||
|
@ -107,6 +107,8 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
|
float stripWidth = side_strip_width * (Room.Category.Value == RoomCategory.Spotlight ? 2 : 1);
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new StatusColouredContainer(transition_duration)
|
new StatusColouredContainer(transition_duration)
|
||||||
@ -139,7 +141,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
new StatusColouredContainer(transition_duration)
|
new StatusColouredContainer(transition_duration)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Width = side_strip_width,
|
Width = stripWidth,
|
||||||
Child = new Box { RelativeSizeAxes = Axes.Both }
|
Child = new Box { RelativeSizeAxes = Axes.Both }
|
||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
@ -147,7 +149,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Width = cover_width,
|
Width = cover_width,
|
||||||
Masking = true,
|
Masking = true,
|
||||||
Margin = new MarginPadding { Left = side_strip_width },
|
Margin = new MarginPadding { Left = stripWidth },
|
||||||
Child = new MultiplayerBackgroundSprite(BeatmapSetCoverType.List) { RelativeSizeAxes = Axes.Both }
|
Child = new MultiplayerBackgroundSprite(BeatmapSetCoverType.List) { RelativeSizeAxes = Axes.Both }
|
||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
@ -156,7 +158,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
Padding = new MarginPadding
|
Padding = new MarginPadding
|
||||||
{
|
{
|
||||||
Vertical = content_padding,
|
Vertical = content_padding,
|
||||||
Left = side_strip_width + cover_width + content_padding,
|
Left = stripWidth + cover_width + content_padding,
|
||||||
Right = content_padding,
|
Right = content_padding,
|
||||||
},
|
},
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
|
@ -12,11 +12,11 @@ using osuTK.Graphics;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.Multi.Lounge.Components
|
namespace osu.Game.Screens.Multi.Lounge.Components
|
||||||
{
|
{
|
||||||
public class FilterControl : SearchableListFilterControl<PrimaryFilter, SecondaryFilter>
|
public class FilterControl : SearchableListFilterControl<RoomStatusFilter, RoomCategoryFilter>
|
||||||
{
|
{
|
||||||
protected override Color4 BackgroundColour => Color4.Black.Opacity(0.5f);
|
protected override Color4 BackgroundColour => Color4.Black.Opacity(0.5f);
|
||||||
protected override PrimaryFilter DefaultTab => PrimaryFilter.Open;
|
protected override RoomStatusFilter DefaultTab => RoomStatusFilter.Open;
|
||||||
protected override SecondaryFilter DefaultCategory => SecondaryFilter.Public;
|
protected override RoomCategoryFilter DefaultCategory => RoomCategoryFilter.Any;
|
||||||
|
|
||||||
protected override float ContentHorizontalPadding => base.ContentHorizontalPadding + OsuScreen.HORIZONTAL_OVERFLOW_PADDING;
|
protected override float ContentHorizontalPadding => base.ContentHorizontalPadding + OsuScreen.HORIZONTAL_OVERFLOW_PADDING;
|
||||||
|
|
||||||
@ -43,6 +43,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
|
|
||||||
ruleset.BindValueChanged(_ => updateFilter());
|
ruleset.BindValueChanged(_ => updateFilter());
|
||||||
Search.Current.BindValueChanged(_ => scheduleUpdateFilter());
|
Search.Current.BindValueChanged(_ => scheduleUpdateFilter());
|
||||||
|
Dropdown.Current.BindValueChanged(_ => updateFilter());
|
||||||
Tabs.Current.BindValueChanged(_ => updateFilter(), true);
|
Tabs.Current.BindValueChanged(_ => updateFilter(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,26 +62,27 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
filter.Value = new FilterCriteria
|
filter.Value = new FilterCriteria
|
||||||
{
|
{
|
||||||
SearchString = Search.Current.Value ?? string.Empty,
|
SearchString = Search.Current.Value ?? string.Empty,
|
||||||
PrimaryFilter = Tabs.Current.Value,
|
StatusFilter = Tabs.Current.Value,
|
||||||
SecondaryFilter = DisplayStyleControl.Dropdown.Current.Value,
|
RoomCategoryFilter = Dropdown.Current.Value,
|
||||||
Ruleset = ruleset.Value
|
Ruleset = ruleset.Value
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum PrimaryFilter
|
public enum RoomStatusFilter
|
||||||
{
|
{
|
||||||
Open,
|
Open,
|
||||||
|
|
||||||
[Description("Recently Ended")]
|
[Description("Recently Ended")]
|
||||||
RecentlyEnded,
|
Ended,
|
||||||
Participated,
|
Participated,
|
||||||
Owned,
|
Owned,
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum SecondaryFilter
|
public enum RoomCategoryFilter
|
||||||
{
|
{
|
||||||
Public,
|
Any,
|
||||||
//Private,
|
Normal,
|
||||||
|
Spotlight
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,8 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
public class FilterCriteria
|
public class FilterCriteria
|
||||||
{
|
{
|
||||||
public string SearchString;
|
public string SearchString;
|
||||||
public PrimaryFilter PrimaryFilter;
|
public RoomStatusFilter StatusFilter;
|
||||||
public SecondaryFilter SecondaryFilter;
|
public RoomCategoryFilter RoomCategoryFilter;
|
||||||
public RulesetInfo Ruleset;
|
public RulesetInfo Ruleset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,8 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
|
OverlinedHeader participantsHeader;
|
||||||
|
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
new Box
|
||||||
@ -55,22 +57,31 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Margin = new MarginPadding { Vertical = 60 },
|
Margin = new MarginPadding { Vertical = 60 },
|
||||||
},
|
},
|
||||||
new OverlinedParticipants(Direction.Horizontal)
|
participantsHeader = new OverlinedHeader("Recent Participants"),
|
||||||
|
new ParticipantsDisplay(Direction.Vertical)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y
|
Height = ParticipantsList.TILE_SIZE * 3,
|
||||||
},
|
Details = { BindTarget = participantsHeader.Details }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
new Drawable[] { new OverlinedHeader("Playlist"), },
|
||||||
new Drawable[]
|
new Drawable[]
|
||||||
{
|
{
|
||||||
new OverlinedPlaylist(false) { RelativeSizeAxes = Axes.Both },
|
new DrawableRoomPlaylist(false, false)
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Items = { BindTarget = Playlist }
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
RowDimensions = new[]
|
RowDimensions = new[]
|
||||||
{
|
{
|
||||||
new Dimension(GridSizeMode.AutoSize),
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
|
new Dimension(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,14 +77,6 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
if (!string.IsNullOrEmpty(criteria.SearchString))
|
if (!string.IsNullOrEmpty(criteria.SearchString))
|
||||||
matchingFilter &= r.FilterTerms.Any(term => term.IndexOf(criteria.SearchString, StringComparison.InvariantCultureIgnoreCase) >= 0);
|
matchingFilter &= r.FilterTerms.Any(term => term.IndexOf(criteria.SearchString, StringComparison.InvariantCultureIgnoreCase) >= 0);
|
||||||
|
|
||||||
switch (criteria.SecondaryFilter)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
case SecondaryFilter.Public:
|
|
||||||
matchingFilter &= r.Room.Availability.Value == RoomAvailability.Public;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
r.MatchingFilter = matchingFilter;
|
r.MatchingFilter = matchingFilter;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
// 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 osu.Framework.Graphics;
|
|
||||||
using osu.Game.Screens.Multi.Components;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Multi.Match.Components
|
|
||||||
{
|
|
||||||
public class OverlinedChatDisplay : OverlinedDisplay
|
|
||||||
{
|
|
||||||
public OverlinedChatDisplay()
|
|
||||||
: base("Chat")
|
|
||||||
{
|
|
||||||
Content.Add(new MatchChatDisplay
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
// 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 osu.Framework.Graphics;
|
|
||||||
using osu.Game.Screens.Multi.Components;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Multi.Match.Components
|
|
||||||
{
|
|
||||||
public class OverlinedLeaderboard : OverlinedDisplay
|
|
||||||
{
|
|
||||||
private readonly MatchLeaderboard leaderboard;
|
|
||||||
|
|
||||||
public OverlinedLeaderboard()
|
|
||||||
: base("Leaderboard")
|
|
||||||
{
|
|
||||||
Content.Add(leaderboard = new MatchLeaderboard
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RefreshScores() => leaderboard.RefreshScores();
|
|
||||||
}
|
|
||||||
}
|
|
@ -53,9 +53,10 @@ namespace osu.Game.Screens.Multi.Match
|
|||||||
protected readonly Bindable<PlaylistItem> SelectedItem = new Bindable<PlaylistItem>();
|
protected readonly Bindable<PlaylistItem> SelectedItem = new Bindable<PlaylistItem>();
|
||||||
|
|
||||||
private MatchSettingsOverlay settingsOverlay;
|
private MatchSettingsOverlay settingsOverlay;
|
||||||
private OverlinedLeaderboard leaderboard;
|
private MatchLeaderboard leaderboard;
|
||||||
|
|
||||||
private IBindable<WeakReference<BeatmapSetInfo>> managerUpdated;
|
private IBindable<WeakReference<BeatmapSetInfo>> managerUpdated;
|
||||||
|
private OverlinedHeader participantsHeader;
|
||||||
|
|
||||||
public MatchSubScreen(Room room)
|
public MatchSubScreen(Room room)
|
||||||
{
|
{
|
||||||
@ -85,11 +86,22 @@ namespace osu.Game.Screens.Multi.Match
|
|||||||
Child = new GridContainer
|
Child = new GridContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
RowDimensions = new[]
|
||||||
|
{
|
||||||
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
|
new Dimension(),
|
||||||
|
},
|
||||||
Content = new[]
|
Content = new[]
|
||||||
{
|
{
|
||||||
|
new Drawable[] { new Components.Header() },
|
||||||
new Drawable[]
|
new Drawable[]
|
||||||
{
|
{
|
||||||
new Components.Header()
|
participantsHeader = new OverlinedHeader("Participants")
|
||||||
|
{
|
||||||
|
ShowLine = false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
new Drawable[]
|
new Drawable[]
|
||||||
{
|
{
|
||||||
@ -97,12 +109,10 @@ namespace osu.Game.Screens.Multi.Match
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Margin = new MarginPadding { Top = 10 },
|
Margin = new MarginPadding { Top = 5 },
|
||||||
Child = new OverlinedParticipants(Direction.Horizontal)
|
Child = new ParticipantsDisplay(Direction.Horizontal)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
Details = { BindTarget = participantsHeader.Details }
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
ShowLine = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -124,11 +134,13 @@ namespace osu.Game.Screens.Multi.Match
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Content = new[]
|
Content = new[]
|
||||||
{
|
{
|
||||||
|
new Drawable[] { new OverlinedHeader("Playlist"), },
|
||||||
new Drawable[]
|
new Drawable[]
|
||||||
{
|
{
|
||||||
new OverlinedPlaylist(true) // Temporarily always allow selection
|
new DrawableRoomPlaylist(false, true) // Temporarily always allow selection
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Items = { BindTarget = playlist },
|
||||||
SelectedItem = { BindTarget = SelectedItem }
|
SelectedItem = { BindTarget = SelectedItem }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -145,6 +157,7 @@ namespace osu.Game.Screens.Multi.Match
|
|||||||
},
|
},
|
||||||
RowDimensions = new[]
|
RowDimensions = new[]
|
||||||
{
|
{
|
||||||
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
new Dimension(),
|
new Dimension(),
|
||||||
new Dimension(GridSizeMode.Absolute, 5),
|
new Dimension(GridSizeMode.Absolute, 5),
|
||||||
new Dimension(GridSizeMode.AutoSize)
|
new Dimension(GridSizeMode.AutoSize)
|
||||||
@ -157,18 +170,16 @@ namespace osu.Game.Screens.Multi.Match
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Content = new[]
|
Content = new[]
|
||||||
{
|
{
|
||||||
new Drawable[]
|
new Drawable[] { new OverlinedHeader("Leaderboard"), },
|
||||||
{
|
new Drawable[] { leaderboard = new MatchLeaderboard { RelativeSizeAxes = Axes.Both }, },
|
||||||
leaderboard = new OverlinedLeaderboard { RelativeSizeAxes = Axes.Both },
|
new Drawable[] { new OverlinedHeader("Chat"), },
|
||||||
},
|
new Drawable[] { new MatchChatDisplay { RelativeSizeAxes = Axes.Both } }
|
||||||
new Drawable[]
|
|
||||||
{
|
|
||||||
new OverlinedChatDisplay { RelativeSizeAxes = Axes.Both }
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
RowDimensions = new[]
|
RowDimensions = new[]
|
||||||
{
|
{
|
||||||
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
new Dimension(),
|
new Dimension(),
|
||||||
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
new Dimension(GridSizeMode.Relative, size: 0.4f, minSize: 240),
|
new Dimension(GridSizeMode.Relative, size: 0.4f, minSize: 240),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -185,12 +196,6 @@ namespace osu.Game.Screens.Multi.Match
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
RowDimensions = new[]
|
|
||||||
{
|
|
||||||
new Dimension(GridSizeMode.AutoSize),
|
|
||||||
new Dimension(GridSizeMode.AutoSize),
|
|
||||||
new Dimension(),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -318,7 +318,7 @@ namespace osu.Game.Screens.Multi
|
|||||||
var tcs = new TaskCompletionSource<bool>();
|
var tcs = new TaskCompletionSource<bool>();
|
||||||
|
|
||||||
pollReq?.Cancel();
|
pollReq?.Cancel();
|
||||||
pollReq = new GetRoomsRequest(currentFilter.Value.PrimaryFilter);
|
pollReq = new GetRoomsRequest(currentFilter.Value.StatusFilter, currentFilter.Value.RoomCategoryFilter);
|
||||||
|
|
||||||
pollReq.Success += result =>
|
pollReq.Success += result =>
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user