mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Hide status bar when Status is null
This commit is contained in:
parent
247d8e9b21
commit
2be1b00a76
@ -51,6 +51,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
AddStep(@"multiplaying", () => { flyte.Status.Value = new UserStatusMultiplayerGame(); });
|
AddStep(@"multiplaying", () => { flyte.Status.Value = new UserStatusMultiplayerGame(); });
|
||||||
AddStep(@"modding", () => { flyte.Status.Value = new UserStatusModding(); });
|
AddStep(@"modding", () => { flyte.Status.Value = new UserStatusModding(); });
|
||||||
AddStep(@"offline", () => { flyte.Status.Value = new UserStatusOffline(); });
|
AddStep(@"offline", () => { flyte.Status.Value = new UserStatusOffline(); });
|
||||||
|
AddStep(@"null status", () => { flyte.Status.Value = null; });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,10 +72,9 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case APIState.Online:
|
case APIState.Online:
|
||||||
UserPanel p;
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
p = new UserPanel(api.LocalUser.Value)
|
new UserPanel(api.LocalUser.Value)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
},
|
},
|
||||||
@ -86,7 +85,6 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
Action = api.Logout
|
Action = api.Logout
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
p.Status.Value = new UserStatusOnline();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ namespace osu.Game.Users
|
|||||||
|
|
||||||
private OsuColour colours;
|
private OsuColour colours;
|
||||||
|
|
||||||
|
private readonly Container statusBar;
|
||||||
private readonly Box statusBg;
|
private readonly Box statusBg;
|
||||||
private readonly OsuSpriteText statusMessage;
|
private readonly OsuSpriteText statusMessage;
|
||||||
|
|
||||||
@ -30,7 +31,7 @@ namespace osu.Game.Users
|
|||||||
|
|
||||||
public UserPanel(User user)
|
public UserPanel(User user)
|
||||||
{
|
{
|
||||||
Height = height;
|
Height = height - status_height;
|
||||||
Masking = true;
|
Masking = true;
|
||||||
CornerRadius = 5;
|
CornerRadius = 5;
|
||||||
EdgeEffect = new EdgeEffect
|
EdgeEffect = new EdgeEffect
|
||||||
@ -54,8 +55,9 @@ namespace osu.Game.Users
|
|||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.X,
|
||||||
Padding = new MarginPadding { Top = content_padding, Bottom = status_height + content_padding, Left = content_padding, Right = content_padding },
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Padding = new MarginPadding { Top = content_padding, Left = content_padding, Right = content_padding },
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new UpdateableAvatar
|
new UpdateableAvatar
|
||||||
@ -114,12 +116,12 @@ namespace osu.Game.Users
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
new Container
|
statusBar = new Container
|
||||||
{
|
{
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Height = status_height,
|
Alpha = 0f,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
statusBg = new Box
|
statusBg = new Box
|
||||||
@ -174,6 +176,11 @@ namespace osu.Game.Users
|
|||||||
|
|
||||||
private void displayStatus(UserStatus status)
|
private void displayStatus(UserStatus status)
|
||||||
{
|
{
|
||||||
|
statusBar.ResizeHeightTo(status == null ? 0f : status_height, 500, EasingTypes.OutQuint);
|
||||||
|
statusBar.FadeTo(status == null ? 0f : 1f, 500, EasingTypes.OutQuint);
|
||||||
|
ResizeHeightTo(status == null ? height - status_height : height, 500, EasingTypes.OutQuint);
|
||||||
|
if (status == null) return;
|
||||||
|
|
||||||
statusBg.FadeColour(status.GetAppropriateColour(colours), 500, EasingTypes.OutQuint);
|
statusBg.FadeColour(status.GetAppropriateColour(colours), 500, EasingTypes.OutQuint);
|
||||||
statusMessage.Text = status.Message;
|
statusMessage.Text = status.Message;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user