mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Refactor background creation in OverlayHeader
This commit is contained in:
@ -1,11 +1,8 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using System;
|
||||
|
||||
@ -53,25 +50,10 @@ namespace osu.Game.Overlays.News
|
||||
}
|
||||
}
|
||||
|
||||
protected override Drawable CreateBackground() => new NewsHeaderBackground();
|
||||
protected override Drawable CreateBackground() => new OverlayHeaderBackground(@"Headers/news");
|
||||
|
||||
protected override ScreenTitle CreateTitle() => title = new NewsHeaderTitle();
|
||||
|
||||
private class NewsHeaderBackground : Sprite
|
||||
{
|
||||
public NewsHeaderBackground()
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
FillMode = FillMode.Fill;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures)
|
||||
{
|
||||
Texture = textures.Get(@"Headers/news");
|
||||
}
|
||||
}
|
||||
|
||||
private class NewsHeaderTitle : ScreenTitle
|
||||
{
|
||||
private const string post_string = "post";
|
||||
|
Reference in New Issue
Block a user