1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +08:00

Move namespace and make cover background public.

This commit is contained in:
Huo Yaoyuan 2017-05-27 23:37:15 +08:00
parent 25387c996f
commit 159e8d84c2
6 changed files with 41 additions and 29 deletions

View File

@ -0,0 +1,26 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
namespace osu.Game.Users
{
public class UserCoverBackground : Sprite
{
private readonly User user;
public UserCoverBackground(User user)
{
this.user = user;
}
[BackgroundDependencyLoader]
private void load(TextureStore textures)
{
if (!string.IsNullOrEmpty(user.CoverUrl))
Texture = textures.Get(user.CoverUrl);
}
}
}

View File

@ -8,9 +8,14 @@ using System.Text;
using System.Threading.Tasks;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Overlays.UserPage
namespace osu.Game.Users.UserPage
{
public class UserPageHeader : Container
{
private readonly User user;
public UserPageHeader(User user)
{
this.user = user;
}
}
}

View File

@ -2,9 +2,8 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics.Containers;
using osu.Game.Users;
namespace osu.Game.Overlays.UserPage
namespace osu.Game.Users.UserPage
{
public abstract class UserPageSection : Container
{

View File

@ -9,10 +9,9 @@ using System.Threading.Tasks;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.UserPage;
using osu.Game.Users;
using osu.Game.Users.UserPage;
namespace osu.Game.Overlays
namespace osu.Game.Users
{
public class UserPageOverlay : FocusedOverlayContainer
{
@ -25,7 +24,7 @@ namespace osu.Game.Overlays
var sections = new UserPageSection[] { };
var sectionsContainer = new SectionsContainer
{
ExpandableHeader = new UserPageHeader(),
ExpandableHeader = new UserPageHeader(user),
FixedHeader = tab,
Sections = sections
};

View File

@ -9,7 +9,6 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
@ -43,7 +42,7 @@ namespace osu.Game.Users
Children = new Drawable[]
{
new AsyncLoadWrapper(new CoverBackgroundSprite(user)
new AsyncLoadWrapper(new UserCoverBackground(user)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
@ -193,22 +192,5 @@ namespace osu.Game.Users
statusMessage.Text = status.Message;
}
}
private class CoverBackgroundSprite : Sprite
{
private readonly User user;
public CoverBackgroundSprite(User user)
{
this.user = user;
}
[BackgroundDependencyLoader]
private void load(TextureStore textures)
{
if (!string.IsNullOrEmpty(user.CoverUrl))
Texture = textures.Get(user.CoverUrl);
}
}
}
}

View File

@ -85,9 +85,10 @@
<Compile Include="Overlays\Settings\SettingsHeader.cs" />
<Compile Include="Overlays\Settings\Sections\Audio\MainMenuSettings.cs" />
<Compile Include="Overlays\Toolbar\ToolbarChatButton.cs" />
<Compile Include="Overlays\UserPageOverlay.cs" />
<Compile Include="Overlays\UserPage\UserPageHeader.cs" />
<Compile Include="Overlays\UserPage\UserPageSection.cs" />
<Compile Include="Users\UserCoverBackground.cs" />
<Compile Include="Users\UserPageOverlay.cs" />
<Compile Include="Users\UserPage\UserPageHeader.cs" />
<Compile Include="Users\UserPage\UserPageSection.cs" />
<Compile Include="Rulesets\Beatmaps\BeatmapConverter.cs" />
<Compile Include="Rulesets\Beatmaps\BeatmapProcessor.cs" />
<Compile Include="Beatmaps\ControlPoints\ControlPoint.cs" />