mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 20:47:22 +08:00
Merge branch 'master' into refactor-osd
This commit is contained in:
commit
ea4a97ebd9
@ -60,5 +60,7 @@ namespace osu.Game.Beatmaps
|
|||||||
public class Beatmap : Beatmap<HitObject>
|
public class Beatmap : Beatmap<HitObject>
|
||||||
{
|
{
|
||||||
public new Beatmap Clone() => (Beatmap)base.Clone();
|
public new Beatmap Clone() => (Beatmap)base.Clone();
|
||||||
|
|
||||||
|
public override string ToString() => BeatmapInfo?.ToString() ?? base.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
{
|
{
|
||||||
if (!Enum.TryParse(line.Substring(1, line.Length - 2), out section))
|
if (!Enum.TryParse(line.Substring(1, line.Length - 2), out section))
|
||||||
{
|
{
|
||||||
Logger.Log($"Unknown section \"{line}\" in {output}");
|
Logger.Log($"Unknown section \"{line}\" in \"{output}\"");
|
||||||
section = Section.None;
|
section = Section.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Logger.Log($"Failed to process line \"{line}\" into {output}: {e.Message}", LoggingTarget.Runtime, LogLevel.Important);
|
Logger.Log($"Failed to process line \"{line}\" into \"{output}\": {e.Message}", LoggingTarget.Runtime, LogLevel.Important);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
public const float ICON_WIDTH = ICON_SIZE + icon_spacing;
|
public const float ICON_WIDTH = ICON_SIZE + icon_spacing;
|
||||||
|
|
||||||
protected const float ICON_SIZE = 25;
|
public const float ICON_SIZE = 25;
|
||||||
|
|
||||||
private SpriteIcon iconSprite;
|
private SpriteIcon iconSprite;
|
||||||
private readonly OsuSpriteText titleText, pageText;
|
private readonly OsuSpriteText titleText, pageText;
|
||||||
|
64
osu.Game/Graphics/UserInterface/ScreenTitleTextureIcon.cs
Normal file
64
osu.Game/Graphics/UserInterface/ScreenTitleTextureIcon.cs
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
// 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.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Graphics.Textures;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Graphics.UserInterface
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A custom icon class for use with <see cref="ScreenTitle.CreateIcon()"/> based off a texture resource.
|
||||||
|
/// </summary>
|
||||||
|
public class ScreenTitleTextureIcon : CompositeDrawable
|
||||||
|
{
|
||||||
|
private const float circle_allowance = 0.8f;
|
||||||
|
|
||||||
|
private readonly string textureName;
|
||||||
|
|
||||||
|
public ScreenTitleTextureIcon(string textureName)
|
||||||
|
{
|
||||||
|
this.textureName = textureName;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(TextureStore textures, OsuColour colours)
|
||||||
|
{
|
||||||
|
Size = new Vector2(ScreenTitle.ICON_SIZE / circle_allowance);
|
||||||
|
|
||||||
|
InternalChildren = new Drawable[]
|
||||||
|
{
|
||||||
|
new CircularContainer
|
||||||
|
{
|
||||||
|
Masking = true,
|
||||||
|
BorderColour = colours.Violet,
|
||||||
|
BorderThickness = 3,
|
||||||
|
MaskingSmoothness = 1,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Sprite
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Texture = textures.Get(textureName),
|
||||||
|
Size = new Vector2(circle_allowance),
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
},
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = colours.Violet,
|
||||||
|
Alpha = 0,
|
||||||
|
AlwaysPresent = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -7,13 +7,11 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osuTK;
|
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Changelog
|
namespace osu.Game.Overlays.Changelog
|
||||||
{
|
{
|
||||||
@ -123,48 +121,7 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
AccentColour = colours.Violet;
|
AccentColour = colours.Violet;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Drawable CreateIcon() => new ChangelogIcon();
|
protected override Drawable CreateIcon() => new ScreenTitleTextureIcon(@"Icons/changelog");
|
||||||
|
|
||||||
internal class ChangelogIcon : CompositeDrawable
|
|
||||||
{
|
|
||||||
private const float circle_allowance = 0.8f;
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(TextureStore textures, OsuColour colours)
|
|
||||||
{
|
|
||||||
Size = new Vector2(ICON_SIZE / circle_allowance);
|
|
||||||
|
|
||||||
InternalChildren = new Drawable[]
|
|
||||||
{
|
|
||||||
new CircularContainer
|
|
||||||
{
|
|
||||||
Masking = true,
|
|
||||||
BorderColour = colours.Violet,
|
|
||||||
BorderThickness = 3,
|
|
||||||
MaskingSmoothness = 1,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new Sprite
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Texture = textures.Get(@"Icons/changelog"),
|
|
||||||
Size = new Vector2(circle_allowance),
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
},
|
|
||||||
new Box
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Colour = colours.Violet,
|
|
||||||
Alpha = 0,
|
|
||||||
AlwaysPresent = true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user