2019-01-24 16:43:03 +08:00
|
|
|
// 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.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
2019-02-21 18:04:31 +08:00
|
|
|
using osu.Framework.Bindables;
|
2018-04-13 17:19:50 +08:00
|
|
|
using osu.Framework.Extensions.Color4Extensions;
|
|
|
|
using osu.Framework.Graphics;
|
2021-07-06 19:04:32 +08:00
|
|
|
using osu.Framework.Graphics.Colour;
|
2018-04-13 17:19:50 +08:00
|
|
|
using osu.Framework.Graphics.Containers;
|
2021-07-14 16:46:32 +08:00
|
|
|
using osu.Framework.Graphics.Effects;
|
2018-04-13 17:19:50 +08:00
|
|
|
using osu.Framework.Graphics.Shapes;
|
2021-07-10 13:14:58 +08:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
2018-04-13 17:19:50 +08:00
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
using osu.Game.Graphics.Containers;
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2021-09-29 19:24:49 +08:00
|
|
|
using osu.Game.Online.Chat;
|
2020-12-25 23:50:00 +08:00
|
|
|
using osu.Game.Online.Rooms;
|
2021-08-12 16:02:55 +08:00
|
|
|
using osu.Game.Overlays;
|
2020-12-25 23:50:00 +08:00
|
|
|
using osu.Game.Screens.OnlinePlay.Components;
|
2018-11-20 15:51:59 +08:00
|
|
|
using osuTK;
|
|
|
|
using osuTK.Graphics;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
2020-12-25 23:50:00 +08:00
|
|
|
namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2021-08-18 19:53:17 +08:00
|
|
|
public class DrawableRoom : CompositeDrawable
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2021-08-18 19:53:17 +08:00
|
|
|
protected const float CORNER_RADIUS = 10;
|
2021-07-06 19:04:32 +08:00
|
|
|
private const float height = 100;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
2021-08-18 19:53:17 +08:00
|
|
|
public readonly Room Room;
|
2020-10-19 16:15:35 +08:00
|
|
|
|
2018-12-06 11:21:30 +08:00
|
|
|
[Resolved]
|
|
|
|
private BeatmapManager beatmaps { get; set; }
|
|
|
|
|
2021-08-18 19:53:17 +08:00
|
|
|
protected Container ButtonsContainer { get; private set; }
|
2021-08-18 14:12:16 +08:00
|
|
|
|
2021-08-19 15:09:17 +08:00
|
|
|
private readonly Bindable<MatchType> roomType = new Bindable<MatchType>();
|
2021-07-14 15:48:53 +08:00
|
|
|
private readonly Bindable<RoomCategory> roomCategory = new Bindable<RoomCategory>();
|
2021-08-18 14:12:16 +08:00
|
|
|
private readonly Bindable<bool> hasPassword = new Bindable<bool>();
|
2021-07-14 15:48:53 +08:00
|
|
|
|
2021-09-29 18:15:58 +08:00
|
|
|
private DrawableRoomParticipantsList drawableRoomParticipantsList;
|
2021-07-14 15:48:53 +08:00
|
|
|
private RoomSpecialCategoryPill specialCategoryPill;
|
2021-07-19 21:31:01 +08:00
|
|
|
private PasswordProtectedIcon passwordIcon;
|
2021-08-19 15:09:17 +08:00
|
|
|
private EndDateInfo endDateInfo;
|
2021-07-19 21:31:01 +08:00
|
|
|
|
2021-09-08 16:13:12 +08:00
|
|
|
private DelayedLoadWrapper wrapper;
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
public DrawableRoom(Room room)
|
|
|
|
{
|
|
|
|
Room = room;
|
|
|
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
2021-07-12 13:07:21 +08:00
|
|
|
Height = height;
|
2021-07-14 16:46:32 +08:00
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
Masking = true;
|
2021-08-18 19:53:17 +08:00
|
|
|
CornerRadius = CORNER_RADIUS;
|
2021-07-14 16:46:32 +08:00
|
|
|
EdgeEffect = new EdgeEffectParameters
|
|
|
|
{
|
|
|
|
Type = EdgeEffectType.Shadow,
|
|
|
|
Colour = Color4.Black.Opacity(40),
|
|
|
|
Radius = 5,
|
|
|
|
};
|
2018-05-11 09:12:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2021-08-18 19:53:17 +08:00
|
|
|
private void load(OverlayColourProvider colours)
|
2018-05-11 09:12:25 +08:00
|
|
|
{
|
2021-09-08 23:39:54 +08:00
|
|
|
ButtonsContainer = new Container
|
|
|
|
{
|
|
|
|
Anchor = Anchor.CentreRight,
|
|
|
|
Origin = Anchor.CentreRight,
|
|
|
|
RelativeSizeAxes = Axes.Y,
|
|
|
|
AutoSizeAxes = Axes.X
|
|
|
|
};
|
|
|
|
|
2021-08-19 14:52:51 +08:00
|
|
|
InternalChildren = new[]
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2021-07-14 15:56:39 +08:00
|
|
|
// This resolves internal 1px gaps due to applying the (parenting) corner radius and masking across multiple filling background sprites.
|
2021-08-16 10:04:21 +08:00
|
|
|
new Box
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2018-05-11 09:48:07 +08:00
|
|
|
RelativeSizeAxes = Axes.Both,
|
2021-08-16 10:04:21 +08:00
|
|
|
Colour = colours.Background5,
|
|
|
|
},
|
2021-08-19 14:52:51 +08:00
|
|
|
CreateBackground().With(d =>
|
2021-08-16 10:04:21 +08:00
|
|
|
{
|
2021-08-19 14:52:51 +08:00
|
|
|
d.RelativeSizeAxes = Axes.Both;
|
|
|
|
}),
|
2021-09-08 16:13:12 +08:00
|
|
|
wrapper = new DelayedLoadWrapper(() =>
|
|
|
|
new Container
|
2021-07-14 15:56:39 +08:00
|
|
|
{
|
2021-09-08 16:13:12 +08:00
|
|
|
Name = @"Room content",
|
2021-07-14 15:56:39 +08:00
|
|
|
RelativeSizeAxes = Axes.Both,
|
2021-09-08 16:13:12 +08:00
|
|
|
// This negative padding resolves 1px gaps between this background and the background above.
|
|
|
|
Padding = new MarginPadding { Left = 20, Vertical = -0.5f },
|
|
|
|
Child = new Container
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2021-09-08 16:13:12 +08:00
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Masking = true,
|
|
|
|
CornerRadius = CORNER_RADIUS,
|
|
|
|
Children = new Drawable[]
|
2021-07-12 15:30:34 +08:00
|
|
|
{
|
2021-09-08 16:13:12 +08:00
|
|
|
new GridContainer
|
2021-07-12 13:07:21 +08:00
|
|
|
{
|
2021-09-08 16:13:12 +08:00
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
ColumnDimensions = new[]
|
2021-07-14 15:56:39 +08:00
|
|
|
{
|
2021-09-08 16:13:12 +08:00
|
|
|
new Dimension(GridSizeMode.Relative, 0.2f)
|
|
|
|
},
|
|
|
|
Content = new[]
|
|
|
|
{
|
|
|
|
new Drawable[]
|
2021-07-14 15:56:39 +08:00
|
|
|
{
|
2021-09-08 16:13:12 +08:00
|
|
|
new Box
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Colour = colours.Background5,
|
|
|
|
},
|
|
|
|
new Box
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Colour = ColourInfo.GradientHorizontal(colours.Background5, colours.Background5.Opacity(0.3f))
|
|
|
|
},
|
|
|
|
}
|
2021-08-16 10:04:21 +08:00
|
|
|
}
|
2021-07-14 15:56:39 +08:00
|
|
|
},
|
2021-09-08 16:13:12 +08:00
|
|
|
new Container
|
2021-07-14 15:56:39 +08:00
|
|
|
{
|
2021-09-08 16:13:12 +08:00
|
|
|
Name = @"Left details",
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Padding = new MarginPadding
|
2021-07-12 14:11:53 +08:00
|
|
|
{
|
2021-09-08 16:13:12 +08:00
|
|
|
Left = 20,
|
|
|
|
Vertical = 5
|
|
|
|
},
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
|
|
|
new FillFlowContainer
|
2021-07-12 14:11:53 +08:00
|
|
|
{
|
2021-09-29 19:44:38 +08:00
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
AutoSizeAxes = Axes.Y,
|
2021-09-08 16:13:12 +08:00
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
Children = new Drawable[]
|
2021-07-12 14:11:53 +08:00
|
|
|
{
|
2021-09-08 16:13:12 +08:00
|
|
|
new FillFlowContainer
|
2021-08-06 17:52:01 +08:00
|
|
|
{
|
2021-09-08 16:13:12 +08:00
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
Direction = FillDirection.Horizontal,
|
|
|
|
Spacing = new Vector2(5),
|
|
|
|
Children = new Drawable[]
|
2021-08-06 17:52:01 +08:00
|
|
|
{
|
2021-09-08 16:13:12 +08:00
|
|
|
new RoomStatusPill
|
|
|
|
{
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
Origin = Anchor.CentreLeft
|
|
|
|
},
|
|
|
|
specialCategoryPill = new RoomSpecialCategoryPill
|
|
|
|
{
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
Origin = Anchor.CentreLeft
|
|
|
|
},
|
|
|
|
endDateInfo = new EndDateInfo
|
|
|
|
{
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
Origin = Anchor.CentreLeft,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
new FillFlowContainer
|
|
|
|
{
|
2021-09-29 19:44:38 +08:00
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
AutoSizeAxes = Axes.Y,
|
2021-09-08 16:13:12 +08:00
|
|
|
Padding = new MarginPadding { Top = 3 },
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
Children = new Drawable[]
|
2021-08-06 17:52:01 +08:00
|
|
|
{
|
2021-09-08 16:13:12 +08:00
|
|
|
new RoomNameText(),
|
2021-09-29 19:24:49 +08:00
|
|
|
new RoomStatusText()
|
2021-09-08 16:13:12 +08:00
|
|
|
}
|
2021-08-06 17:52:01 +08:00
|
|
|
}
|
2021-07-12 14:11:53 +08:00
|
|
|
},
|
2021-08-06 17:52:01 +08:00
|
|
|
},
|
2021-09-08 16:13:12 +08:00
|
|
|
new FillFlowContainer
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2021-09-08 16:13:12 +08:00
|
|
|
Anchor = Anchor.BottomLeft,
|
|
|
|
Origin = Anchor.BottomLeft,
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
Direction = FillDirection.Horizontal,
|
|
|
|
Spacing = new Vector2(5),
|
|
|
|
Children = new Drawable[]
|
2021-07-12 14:11:07 +08:00
|
|
|
{
|
2021-09-08 16:13:12 +08:00
|
|
|
new PlaylistCountPill
|
|
|
|
{
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
Origin = Anchor.CentreLeft,
|
|
|
|
},
|
|
|
|
new StarRatingRangeDisplay
|
|
|
|
{
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
Origin = Anchor.CentreLeft,
|
|
|
|
Scale = new Vector2(0.8f)
|
|
|
|
}
|
2021-07-12 14:11:07 +08:00
|
|
|
}
|
2021-07-06 19:04:32 +08:00
|
|
|
}
|
|
|
|
}
|
2021-07-14 15:56:39 +08:00
|
|
|
},
|
2021-09-08 16:13:12 +08:00
|
|
|
new FillFlowContainer
|
2021-07-14 15:56:39 +08:00
|
|
|
{
|
2021-09-08 16:13:12 +08:00
|
|
|
Name = "Right content",
|
|
|
|
Anchor = Anchor.CentreRight,
|
|
|
|
Origin = Anchor.CentreRight,
|
|
|
|
AutoSizeAxes = Axes.X,
|
|
|
|
RelativeSizeAxes = Axes.Y,
|
|
|
|
Spacing = new Vector2(5),
|
|
|
|
Padding = new MarginPadding
|
2021-08-18 19:53:17 +08:00
|
|
|
{
|
2021-09-08 16:13:12 +08:00
|
|
|
Right = 10,
|
|
|
|
Vertical = 20,
|
2021-08-18 19:53:17 +08:00
|
|
|
},
|
2021-09-08 16:13:12 +08:00
|
|
|
Children = new Drawable[]
|
2021-07-14 15:56:39 +08:00
|
|
|
{
|
2021-09-08 23:39:54 +08:00
|
|
|
ButtonsContainer,
|
2021-09-29 18:15:58 +08:00
|
|
|
drawableRoomParticipantsList = new DrawableRoomParticipantsList
|
2021-09-08 16:13:12 +08:00
|
|
|
{
|
|
|
|
Anchor = Anchor.CentreRight,
|
|
|
|
Origin = Anchor.CentreRight,
|
|
|
|
NumberOfCircles = NumberOfAvatars
|
|
|
|
}
|
2021-07-14 15:56:39 +08:00
|
|
|
}
|
2021-09-08 16:13:12 +08:00
|
|
|
},
|
|
|
|
passwordIcon = new PasswordProtectedIcon { Alpha = 0 }
|
2018-04-13 17:19:50 +08:00
|
|
|
},
|
|
|
|
},
|
2021-09-08 16:13:12 +08:00
|
|
|
}, 0)
|
2021-09-08 19:51:16 +08:00
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
}
|
2021-06-01 13:33:21 +08:00
|
|
|
};
|
2019-02-05 18:00:01 +08:00
|
|
|
}
|
|
|
|
|
2018-05-27 13:12:20 +08:00
|
|
|
protected override void LoadComplete()
|
|
|
|
{
|
|
|
|
base.LoadComplete();
|
2019-11-15 16:49:02 +08:00
|
|
|
|
2021-09-08 16:13:12 +08:00
|
|
|
wrapper.DelayedLoadComplete += _ =>
|
2021-07-14 15:48:53 +08:00
|
|
|
{
|
2021-09-08 19:51:16 +08:00
|
|
|
wrapper.FadeInFromZero(200);
|
|
|
|
|
2021-09-08 16:13:12 +08:00
|
|
|
roomCategory.BindTo(Room.Category);
|
|
|
|
roomCategory.BindValueChanged(c =>
|
|
|
|
{
|
|
|
|
if (c.NewValue == RoomCategory.Spotlight)
|
|
|
|
specialCategoryPill.Show();
|
|
|
|
else
|
|
|
|
specialCategoryPill.Hide();
|
|
|
|
}, true);
|
2021-08-19 15:09:17 +08:00
|
|
|
|
2021-09-08 16:13:12 +08:00
|
|
|
roomType.BindTo(Room.Type);
|
|
|
|
roomType.BindValueChanged(t =>
|
|
|
|
{
|
|
|
|
endDateInfo.Alpha = t.NewValue == MatchType.Playlists ? 1 : 0;
|
|
|
|
}, true);
|
|
|
|
|
|
|
|
hasPassword.BindTo(Room.HasPassword);
|
|
|
|
hasPassword.BindValueChanged(v => passwordIcon.Alpha = v.NewValue ? 1 : 0, true);
|
|
|
|
};
|
2018-05-27 13:12:20 +08:00
|
|
|
}
|
2019-02-06 12:52:48 +08:00
|
|
|
|
2021-08-18 19:53:17 +08:00
|
|
|
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
2021-07-11 09:13:57 +08:00
|
|
|
{
|
2021-08-18 19:53:17 +08:00
|
|
|
return new CachedModelDependencyContainer<Room>(base.CreateChildDependencies(parent))
|
2021-07-11 09:13:57 +08:00
|
|
|
{
|
2021-08-18 19:53:17 +08:00
|
|
|
Model = { Value = Room }
|
|
|
|
};
|
2018-05-27 13:12:20 +08:00
|
|
|
}
|
2019-02-06 12:52:48 +08:00
|
|
|
|
2021-08-18 19:53:17 +08:00
|
|
|
private int numberOfAvatars = 7;
|
2020-07-13 13:24:11 +08:00
|
|
|
|
2021-08-18 19:53:17 +08:00
|
|
|
public int NumberOfAvatars
|
2021-07-12 13:53:12 +08:00
|
|
|
{
|
2021-08-18 19:53:17 +08:00
|
|
|
get => numberOfAvatars;
|
|
|
|
set
|
2021-07-12 13:53:12 +08:00
|
|
|
{
|
2021-08-18 19:53:17 +08:00
|
|
|
numberOfAvatars = value;
|
2021-07-12 13:53:12 +08:00
|
|
|
|
2021-09-29 18:15:58 +08:00
|
|
|
if (drawableRoomParticipantsList != null)
|
|
|
|
drawableRoomParticipantsList.NumberOfCircles = value;
|
2021-07-12 13:53:12 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-19 14:52:51 +08:00
|
|
|
protected virtual Drawable CreateBackground() => new OnlinePlayBackgroundSprite();
|
|
|
|
|
2021-07-12 15:28:22 +08:00
|
|
|
private class RoomNameText : OsuSpriteText
|
2019-02-06 12:52:48 +08:00
|
|
|
{
|
2020-12-25 12:38:11 +08:00
|
|
|
[Resolved(typeof(Room), nameof(Online.Rooms.Room.Name))]
|
2019-02-06 12:52:48 +08:00
|
|
|
private Bindable<string> name { get; set; }
|
|
|
|
|
2021-07-12 15:28:22 +08:00
|
|
|
public RoomNameText()
|
|
|
|
{
|
2021-08-06 17:52:01 +08:00
|
|
|
Font = OsuFont.GetFont(size: 28);
|
2021-07-12 15:28:22 +08:00
|
|
|
}
|
|
|
|
|
2019-02-06 12:52:48 +08:00
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
|
|
|
Current = name;
|
|
|
|
}
|
|
|
|
}
|
2020-08-10 07:16:01 +08:00
|
|
|
|
2021-09-29 19:24:49 +08:00
|
|
|
private class RoomStatusText : OnlinePlayComposite
|
2021-07-12 15:28:22 +08:00
|
|
|
{
|
2021-09-29 19:24:49 +08:00
|
|
|
[Resolved]
|
|
|
|
private OsuColour colours { get; set; }
|
2021-07-12 15:28:22 +08:00
|
|
|
|
2021-09-29 19:44:38 +08:00
|
|
|
private SpriteText statusText;
|
|
|
|
private LinkFlowContainer beatmapText;
|
2021-09-29 19:24:49 +08:00
|
|
|
|
|
|
|
public RoomStatusText()
|
2021-07-12 15:28:22 +08:00
|
|
|
{
|
2021-09-29 19:44:38 +08:00
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
Width = 0.5f;
|
2021-07-12 15:28:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
2021-09-29 19:44:38 +08:00
|
|
|
InternalChild = new GridContainer
|
2021-09-29 19:24:49 +08:00
|
|
|
{
|
2021-09-29 19:44:38 +08:00
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
ColumnDimensions = new[]
|
|
|
|
{
|
|
|
|
new Dimension(GridSizeMode.AutoSize),
|
|
|
|
},
|
|
|
|
Content = new[]
|
|
|
|
{
|
|
|
|
new Drawable[]
|
|
|
|
{
|
|
|
|
statusText = new OsuSpriteText
|
|
|
|
{
|
|
|
|
Font = OsuFont.Default.With(size: 16),
|
|
|
|
Colour = colours.Lime1
|
|
|
|
},
|
|
|
|
beatmapText = new LinkFlowContainer(s =>
|
|
|
|
{
|
|
|
|
s.Font = OsuFont.Default.With(size: 16);
|
|
|
|
s.Colour = colours.Lime1;
|
|
|
|
})
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
AutoSizeAxes = Axes.Y
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-07-12 15:28:22 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
{
|
|
|
|
base.LoadComplete();
|
2021-09-29 19:24:49 +08:00
|
|
|
SelectedItem.BindValueChanged(onSelectedItemChanged, true);
|
|
|
|
}
|
2021-07-12 15:28:22 +08:00
|
|
|
|
2021-09-29 19:24:49 +08:00
|
|
|
private void onSelectedItemChanged(ValueChangedEvent<PlaylistItem> item)
|
|
|
|
{
|
2021-09-29 19:44:38 +08:00
|
|
|
beatmapText.Clear();
|
|
|
|
|
2021-09-29 19:24:49 +08:00
|
|
|
if (Type.Value == MatchType.Playlists)
|
2021-07-12 15:28:22 +08:00
|
|
|
{
|
2021-09-29 19:44:38 +08:00
|
|
|
statusText.Text = "Waiting for players";
|
2021-09-29 19:24:49 +08:00
|
|
|
return;
|
|
|
|
}
|
2021-07-12 15:28:22 +08:00
|
|
|
|
2021-09-29 19:24:49 +08:00
|
|
|
if (item.NewValue?.Beatmap.Value != null)
|
|
|
|
{
|
2021-09-29 19:44:38 +08:00
|
|
|
statusText.Text = "Currently playing ";
|
|
|
|
beatmapText.AddLink(item.NewValue.Beatmap.Value.ToRomanisableString(),
|
|
|
|
LinkAction.OpenBeatmap,
|
|
|
|
item.NewValue.Beatmap.Value.OnlineBeatmapID.ToString(),
|
|
|
|
creationParameters: s =>
|
|
|
|
{
|
|
|
|
s.Truncate = true;
|
|
|
|
s.RelativeSizeAxes = Axes.X;
|
|
|
|
});
|
2021-09-29 19:24:49 +08:00
|
|
|
}
|
2021-07-12 15:28:22 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-19 21:31:01 +08:00
|
|
|
public class PasswordProtectedIcon : CompositeDrawable
|
2020-08-10 07:16:01 +08:00
|
|
|
{
|
2021-07-10 13:14:58 +08:00
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load(OsuColour colours)
|
2020-10-19 16:15:35 +08:00
|
|
|
{
|
2021-07-10 13:14:58 +08:00
|
|
|
Anchor = Anchor.TopRight;
|
|
|
|
Origin = Anchor.TopRight;
|
|
|
|
|
|
|
|
Size = new Vector2(32);
|
|
|
|
|
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
{
|
|
|
|
new Box
|
|
|
|
{
|
|
|
|
Anchor = Anchor.TopRight,
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
Colour = colours.Gray5,
|
|
|
|
Rotation = 45,
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Width = 2,
|
|
|
|
},
|
|
|
|
new SpriteIcon
|
|
|
|
{
|
|
|
|
Icon = FontAwesome.Solid.Lock,
|
|
|
|
Anchor = Anchor.TopRight,
|
|
|
|
Origin = Anchor.TopRight,
|
|
|
|
Margin = new MarginPadding(6),
|
|
|
|
Size = new Vector2(14),
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
}
|
|
|
|
}
|