-
Notifications
You must be signed in to change notification settings - Fork 0
aa #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aa #151
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |||||||
| // See the LICENCE file in the repository root for full licence text. | ||||||||
|
|
||||||||
| using System; | ||||||||
| using System.Linq; | ||||||||
| using osu.Framework.Allocation; | ||||||||
| using osu.Framework.Bindables; | ||||||||
| using osu.Framework.Extensions; | ||||||||
|
|
@@ -17,7 +18,10 @@ | |||||||
| using osu.Game.Graphics; | ||||||||
| using osu.Game.Graphics.Backgrounds; | ||||||||
| using osu.Game.Graphics.Sprites; | ||||||||
| using osu.Game.Online; | ||||||||
| using osu.Game.Online.API.Requests.Responses; | ||||||||
| using osu.Game.Online.Multiplayer; | ||||||||
| using osu.Game.Online.Rooms; | ||||||||
| using osu.Game.Users.Drawables; | ||||||||
| using osuTK; | ||||||||
| using osuTK.Graphics; | ||||||||
|
|
@@ -42,6 +46,13 @@ public partial class RankedPlayUserDisplay : CompositeDrawable | |||||||
|
|
||||||||
| private BufferedContainer grayScaleContainer = null!; | ||||||||
|
|
||||||||
| private OsuSpriteText beatmapState = null!; | ||||||||
|
|
||||||||
| private BeatmapAvailability availability = BeatmapAvailability.Unknown(); | ||||||||
|
|
||||||||
| [Resolved] | ||||||||
| private MultiplayerClient client { get; set; } = null!; | ||||||||
|
|
||||||||
| [Resolved] | ||||||||
| private RankedPlayCornerPiece? cornerPiece { get; set; } | ||||||||
|
|
||||||||
|
|
@@ -61,6 +72,10 @@ private void load() | |||||||
| ? -OsuGame.SHEAR | ||||||||
| : OsuGame.SHEAR; | ||||||||
|
|
||||||||
| var beatmapStateAnchor = (contentAnchor & Anchor.x0) != 0 | ||||||||
| ? Anchor.CentreLeft | ||||||||
| : Anchor.CentreRight; | ||||||||
|
|
||||||||
| InternalChildren = | ||||||||
| [ | ||||||||
| new CircularContainer | ||||||||
|
|
@@ -103,15 +118,33 @@ private void load() | |||||||
| Anchor = contentAnchor, | ||||||||
| Origin = contentAnchor, | ||||||||
| }, | ||||||||
| new OsuSpriteText | ||||||||
| new FillFlowContainer | ||||||||
| { | ||||||||
| Name = "Username", | ||||||||
| Text = user.Username, | ||||||||
| Name = "Username/beatmap state container", | ||||||||
| AutoSizeAxes = Axes.Both, | ||||||||
| Anchor = contentAnchor, | ||||||||
| Origin = contentAnchor, | ||||||||
| Direction = FillDirection.Horizontal, | ||||||||
| Padding = new MarginPadding { Horizontal = 4, Vertical = 6 }, | ||||||||
| Font = OsuFont.GetFont(size: 24, weight: FontWeight.SemiBold), | ||||||||
| UseFullGlyphHeight = false, | ||||||||
| Spacing = new Vector2(5, 0), | ||||||||
| Children = | ||||||||
| [ | ||||||||
| new OsuSpriteText | ||||||||
| { | ||||||||
| Name = "Username", | ||||||||
| Text = user.Username, | ||||||||
| Anchor = contentAnchor, | ||||||||
| Origin = contentAnchor, | ||||||||
| Font = OsuFont.GetFont(size: 24, weight: FontWeight.SemiBold), | ||||||||
| UseFullGlyphHeight = false, | ||||||||
| }, | ||||||||
| beatmapState = new OsuSpriteText | ||||||||
| { | ||||||||
| Anchor = beatmapStateAnchor, | ||||||||
| Origin = beatmapStateAnchor, | ||||||||
| Font = OsuFont.Torus.With(size: 12, weight: FontWeight.SemiBold), | ||||||||
| }, | ||||||||
| ], | ||||||||
| }, | ||||||||
| ] | ||||||||
| } | ||||||||
|
|
@@ -129,6 +162,46 @@ protected override void LoadComplete() | |||||||
| grayScaleContainer.GrayscaleTo(e.NewValue <= 0 ? 1 : 0, 300); | ||||||||
| cornerPiece?.OnHealthChanged(e.NewValue); | ||||||||
| }); | ||||||||
|
|
||||||||
| client.RoomUpdated += onRoomUpdated; | ||||||||
|
||||||||
| client.RoomUpdated += onRoomUpdated; | |
| client.RoomUpdated += onRoomUpdated; | |
| onRoomUpdated(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test method name has a typo (
TesUserDisplay). Rename toTestUserDisplayfor consistency with other tests and to improve discoverability in test runners and logs.