1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-05 19:12:56 +08:00

Add transition_duration, remove testing DifficultyIcon

This commit is contained in:
DrabWeb 2017-05-30 19:13:05 -03:00
parent 3aa1f35127
commit 774d37a058

View File

@ -25,6 +25,7 @@ namespace osu.Game.Screens.Multiplayer
public class RoomInspector : Container public class RoomInspector : Container
{ {
private readonly MarginPadding content_padding = new MarginPadding { Horizontal = 20, Vertical = 10 }; private readonly MarginPadding content_padding = new MarginPadding { Horizontal = 20, Vertical = 10 };
private const float transition_duration = 100;
private readonly FillFlowContainer topFlow; private readonly FillFlowContainer topFlow;
private readonly Box statusStrip; private readonly Box statusStrip;
@ -113,7 +114,7 @@ namespace osu.Game.Screens.Multiplayer
Origin = Anchor.TopRight, Origin = Anchor.TopRight,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
LayoutDuration = 100, LayoutDuration = transition_duration,
Children = new[] Children = new[]
{ {
participants = new OsuSpriteText participants = new OsuSpriteText
@ -178,7 +179,7 @@ namespace osu.Game.Screens.Multiplayer
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
LayoutDuration = 100, LayoutDuration = transition_duration,
Spacing = new Vector2(5f, 0f), Spacing = new Vector2(5f, 0f),
Children = new Drawable[] Children = new Drawable[]
{ {
@ -349,7 +350,7 @@ namespace osu.Game.Screens.Multiplayer
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
LayoutDuration = 100, LayoutDuration = transition_duration,
Spacing = new Vector2(5f), Spacing = new Vector2(5f),
}, },
}, },
@ -363,7 +364,7 @@ namespace osu.Game.Screens.Multiplayer
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours, LocalisationEngine localisation, TextureStore textures, RulesetDatabase rulesets) private void load(OsuColour colours, LocalisationEngine localisation, TextureStore textures)
{ {
this.localisation = localisation; this.localisation = localisation;
this.colours = colours; this.colours = colours;
@ -373,12 +374,6 @@ namespace osu.Game.Screens.Multiplayer
cover.Texture = textures.Get(@"https://a.pomf.cat/mvduor.png"); cover.Texture = textures.Get(@"https://a.pomf.cat/mvduor.png");
rulesetContainer.Add(new DifficultyIcon(new BeatmapInfo
{
Ruleset = rulesets.GetRuleset(0),
StarDifficulty = 3.7,
}) { Size = new Vector2(30f) });
//binded here instead of ctor because dependencies are needed //binded here instead of ctor because dependencies are needed
statusBind.ValueChanged += displayStatus; statusBind.ValueChanged += displayStatus;
beatmapBind.ValueChanged += displayBeatmap; beatmapBind.ValueChanged += displayBeatmap;
@ -411,14 +406,14 @@ namespace osu.Game.Screens.Multiplayer
status.Text = value.Message; status.Text = value.Message;
foreach (Drawable d in new Drawable[] { statusStrip, status }) foreach (Drawable d in new Drawable[] { statusStrip, status })
d.FadeColour(value.GetAppropriateColour(colours), 100); d.FadeColour(value.GetAppropriateColour(colours), transition_duration);
} }
private void displayBeatmap(BeatmapInfo value) private void displayBeatmap(BeatmapInfo value)
{ {
if (value != null) if (value != null)
{ {
rulesetContainer.FadeIn(100); rulesetContainer.FadeIn(transition_duration);
rulesetContainer.Children = new[] rulesetContainer.Children = new[]
{ {
new DifficultyIcon(value) new DifficultyIcon(value)
@ -434,7 +429,7 @@ namespace osu.Game.Screens.Multiplayer
} }
else else
{ {
rulesetContainer.FadeOut(100); rulesetContainer.FadeOut(transition_duration);
beatmapTitle.Current = null; beatmapTitle.Current = null;
beatmapArtist.Current = null; beatmapArtist.Current = null;
@ -448,13 +443,13 @@ namespace osu.Game.Screens.Multiplayer
{ {
if (value == null) if (value == null)
{ {
participantsSlash.FadeOut(100); participantsSlash.FadeOut(transition_duration);
maxParticipants.FadeOut(100); maxParticipants.FadeOut(transition_duration);
} }
else else
{ {
participantsSlash.FadeIn(100); participantsSlash.FadeIn(transition_duration);
maxParticipants.FadeIn(100); maxParticipants.FadeIn(transition_duration);
maxParticipants.Text = value.ToString(); maxParticipants.Text = value.ToString();
} }
} }