mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 01:17:35 +09:00
Create the drawable hierarchy for DrawableRoom in load.
This commit is contained in:
parent
0afe33d32f
commit
d87ac5a1cb
@ -29,11 +29,10 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
private const float cover_width = 145;
|
private const float cover_width = 145;
|
||||||
|
|
||||||
private readonly Box sideStrip;
|
private readonly Box sideStrip;
|
||||||
private readonly Container coverContainer;
|
private Container coverContainer;
|
||||||
private readonly OsuSpriteText name, status, beatmapTitle, beatmapDash, beatmapArtist;
|
private OsuSpriteText name, status, beatmapTitle, beatmapDash, beatmapArtist;
|
||||||
private readonly FillFlowContainer<OsuSpriteText> beatmapInfoFlow;
|
private ParticipantInfo participantInfo;
|
||||||
private readonly ParticipantInfo participantInfo;
|
private ModeTypeInfo modeTypeInfo;
|
||||||
private readonly ModeTypeInfo modeTypeInfo;
|
|
||||||
|
|
||||||
private readonly Bindable<string> nameBind = new Bindable<string>();
|
private readonly Bindable<string> nameBind = new Bindable<string>();
|
||||||
private readonly Bindable<User> hostBind = new Bindable<User>();
|
private readonly Bindable<User> hostBind = new Bindable<User>();
|
||||||
@ -62,6 +61,19 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
Radius = 5,
|
Radius = 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sideStrip = new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
Width = side_strip_width,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuColour colours, LocalisationEngine localisation)
|
||||||
|
{
|
||||||
|
this.localisation = localisation;
|
||||||
|
this.colours = colours;
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
new Box
|
||||||
@ -69,11 +81,7 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = OsuColour.FromHex(@"212121"),
|
Colour = OsuColour.FromHex(@"212121"),
|
||||||
},
|
},
|
||||||
sideStrip = new Box
|
sideStrip,
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Y,
|
|
||||||
Width = side_strip_width,
|
|
||||||
},
|
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
Width = cover_width,
|
Width = cover_width,
|
||||||
@ -133,10 +141,11 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
TextSize = 14,
|
TextSize = 14,
|
||||||
Font = @"Exo2.0-Bold",
|
Font = @"Exo2.0-Bold",
|
||||||
},
|
},
|
||||||
beatmapInfoFlow = new FillFlowContainer<OsuSpriteText>
|
new FillFlowContainer<OsuSpriteText>
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Colour = colours.Gray9,
|
||||||
Direction = FillDirection.Horizontal,
|
Direction = FillDirection.Horizontal,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
@ -170,7 +179,9 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
|
|
||||||
nameBind.ValueChanged += displayName;
|
nameBind.ValueChanged += displayName;
|
||||||
hostBind.ValueChanged += displayUser;
|
hostBind.ValueChanged += displayUser;
|
||||||
|
statusBind.ValueChanged += displayStatus;
|
||||||
typeBind.ValueChanged += displayGameType;
|
typeBind.ValueChanged += displayGameType;
|
||||||
|
beatmapBind.ValueChanged += displayBeatmap;
|
||||||
participantsBind.ValueChanged += displayParticipants;
|
participantsBind.ValueChanged += displayParticipants;
|
||||||
|
|
||||||
nameBind.BindTo(Room.Name);
|
nameBind.BindTo(Room.Name);
|
||||||
@ -181,22 +192,6 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
participantsBind.BindTo(Room.Participants);
|
participantsBind.BindTo(Room.Participants);
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuColour colours, LocalisationEngine localisation)
|
|
||||||
{
|
|
||||||
this.localisation = localisation;
|
|
||||||
this.colours = colours;
|
|
||||||
|
|
||||||
beatmapInfoFlow.Colour = colours.Gray9;
|
|
||||||
|
|
||||||
//binded here instead of ctor because dependencies are needed
|
|
||||||
statusBind.ValueChanged += displayStatus;
|
|
||||||
beatmapBind.ValueChanged += displayBeatmap;
|
|
||||||
|
|
||||||
statusBind.TriggerChange();
|
|
||||||
beatmapBind.TriggerChange();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void displayName(string value)
|
private void displayName(string value)
|
||||||
{
|
{
|
||||||
name.Text = value;
|
name.Text = value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user