mirror of
https://github.com/ppy/osu.git
synced 2025-02-16 01:03:21 +08:00
Move namespace and make cover background public.
This commit is contained in:
parent
25387c996f
commit
159e8d84c2
26
osu.Game/Users/UserCoverBackground.cs
Normal file
26
osu.Game/Users/UserCoverBackground.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -8,9 +8,14 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.UserPage
|
namespace osu.Game.Users.UserPage
|
||||||
{
|
{
|
||||||
public class UserPageHeader : Container
|
public class UserPageHeader : Container
|
||||||
{
|
{
|
||||||
|
private readonly User user;
|
||||||
|
public UserPageHeader(User user)
|
||||||
|
{
|
||||||
|
this.user = user;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,9 +2,8 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Users;
|
|
||||||
|
|
||||||
namespace osu.Game.Overlays.UserPage
|
namespace osu.Game.Users.UserPage
|
||||||
{
|
{
|
||||||
public abstract class UserPageSection : Container
|
public abstract class UserPageSection : Container
|
||||||
{
|
{
|
@ -9,10 +9,9 @@ using System.Threading.Tasks;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Overlays.UserPage;
|
using osu.Game.Users.UserPage;
|
||||||
using osu.Game.Users;
|
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Users
|
||||||
{
|
{
|
||||||
public class UserPageOverlay : FocusedOverlayContainer
|
public class UserPageOverlay : FocusedOverlayContainer
|
||||||
{
|
{
|
||||||
@ -25,7 +24,7 @@ namespace osu.Game.Overlays
|
|||||||
var sections = new UserPageSection[] { };
|
var sections = new UserPageSection[] { };
|
||||||
var sectionsContainer = new SectionsContainer
|
var sectionsContainer = new SectionsContainer
|
||||||
{
|
{
|
||||||
ExpandableHeader = new UserPageHeader(),
|
ExpandableHeader = new UserPageHeader(user),
|
||||||
FixedHeader = tab,
|
FixedHeader = tab,
|
||||||
Sections = sections
|
Sections = sections
|
||||||
};
|
};
|
@ -9,7 +9,6 @@ using osu.Framework.Extensions.Color4Extensions;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
|
|
||||||
@ -43,7 +42,7 @@ namespace osu.Game.Users
|
|||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new AsyncLoadWrapper(new CoverBackgroundSprite(user)
|
new AsyncLoadWrapper(new UserCoverBackground(user)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
@ -193,22 +192,5 @@ namespace osu.Game.Users
|
|||||||
statusMessage.Text = status.Message;
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,9 +85,10 @@
|
|||||||
<Compile Include="Overlays\Settings\SettingsHeader.cs" />
|
<Compile Include="Overlays\Settings\SettingsHeader.cs" />
|
||||||
<Compile Include="Overlays\Settings\Sections\Audio\MainMenuSettings.cs" />
|
<Compile Include="Overlays\Settings\Sections\Audio\MainMenuSettings.cs" />
|
||||||
<Compile Include="Overlays\Toolbar\ToolbarChatButton.cs" />
|
<Compile Include="Overlays\Toolbar\ToolbarChatButton.cs" />
|
||||||
<Compile Include="Overlays\UserPageOverlay.cs" />
|
<Compile Include="Users\UserCoverBackground.cs" />
|
||||||
<Compile Include="Overlays\UserPage\UserPageHeader.cs" />
|
<Compile Include="Users\UserPageOverlay.cs" />
|
||||||
<Compile Include="Overlays\UserPage\UserPageSection.cs" />
|
<Compile Include="Users\UserPage\UserPageHeader.cs" />
|
||||||
|
<Compile Include="Users\UserPage\UserPageSection.cs" />
|
||||||
<Compile Include="Rulesets\Beatmaps\BeatmapConverter.cs" />
|
<Compile Include="Rulesets\Beatmaps\BeatmapConverter.cs" />
|
||||||
<Compile Include="Rulesets\Beatmaps\BeatmapProcessor.cs" />
|
<Compile Include="Rulesets\Beatmaps\BeatmapProcessor.cs" />
|
||||||
<Compile Include="Beatmaps\ControlPoints\ControlPoint.cs" />
|
<Compile Include="Beatmaps\ControlPoints\ControlPoint.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user