mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:12:54 +08:00
Update in line with framework changes
This commit is contained in:
parent
51cb7dc774
commit
f083b18663
@ -6,7 +6,6 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
@ -15,20 +14,20 @@ using osuTK;
|
|||||||
namespace osu.Game.Online.Chat
|
namespace osu.Game.Online.Chat
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An invisible drawable that brings multiple <see cref="SpriteText"/> pieces together to form a consumable clickable link.
|
/// An invisible drawable that brings multiple <see cref="Drawable"/> pieces together to form a consumable clickable link.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DrawableLinkCompiler : OsuHoverContainer, IHasTooltip
|
public class DrawableLinkCompiler : OsuHoverContainer, IHasTooltip
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Each word part of a chat link (split for word-wrap support).
|
/// Each word part of a chat link (split for word-wrap support).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<SpriteText> Parts;
|
public List<Drawable> Parts;
|
||||||
|
|
||||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Parts.Any(d => d.ReceivePositionalInputAt(screenSpacePos));
|
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Parts.Any(d => d.ReceivePositionalInputAt(screenSpacePos));
|
||||||
|
|
||||||
protected override HoverClickSounds CreateHoverClickSounds(HoverSampleSet sampleSet) => new LinkHoverSounds(sampleSet, Parts);
|
protected override HoverClickSounds CreateHoverClickSounds(HoverSampleSet sampleSet) => new LinkHoverSounds(sampleSet, Parts);
|
||||||
|
|
||||||
public DrawableLinkCompiler(IEnumerable<SpriteText> parts)
|
public DrawableLinkCompiler(IEnumerable<Drawable> parts)
|
||||||
{
|
{
|
||||||
Parts = parts.ToList();
|
Parts = parts.ToList();
|
||||||
}
|
}
|
||||||
@ -45,9 +44,9 @@ namespace osu.Game.Online.Chat
|
|||||||
|
|
||||||
private class LinkHoverSounds : HoverClickSounds
|
private class LinkHoverSounds : HoverClickSounds
|
||||||
{
|
{
|
||||||
private readonly List<SpriteText> parts;
|
private readonly List<Drawable> parts;
|
||||||
|
|
||||||
public LinkHoverSounds(HoverSampleSet sampleSet, List<SpriteText> parts)
|
public LinkHoverSounds(HoverSampleSet sampleSet, List<Drawable> parts)
|
||||||
: base(sampleSet)
|
: base(sampleSet)
|
||||||
{
|
{
|
||||||
this.parts = parts;
|
this.parts = parts;
|
||||||
|
@ -553,9 +553,9 @@ namespace osu.Game
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Logger.Log($"Loading {d}...", LoggingTarget.Debug);
|
Logger.Log($"Loading {d}...", level: LogLevel.Debug);
|
||||||
await LoadComponentAsync(d, add);
|
await LoadComponentAsync(d, add);
|
||||||
Logger.Log($"Loaded {d}!", LoggingTarget.Debug);
|
Logger.Log($"Loaded {d}!", level: LogLevel.Debug);
|
||||||
}
|
}
|
||||||
catch (OperationCanceledException)
|
catch (OperationCanceledException)
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,6 @@ using osuTK.Graphics;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
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.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
@ -26,7 +25,7 @@ namespace osu.Game.Overlays.Music
|
|||||||
|
|
||||||
private SpriteIcon handle;
|
private SpriteIcon handle;
|
||||||
private TextFlowContainer text;
|
private TextFlowContainer text;
|
||||||
private IEnumerable<SpriteText> titleSprites;
|
private IEnumerable<Drawable> titleSprites;
|
||||||
private ILocalisedBindableString titleBind;
|
private ILocalisedBindableString titleBind;
|
||||||
private ILocalisedBindableString artistBind;
|
private ILocalisedBindableString artistBind;
|
||||||
|
|
||||||
@ -58,7 +57,7 @@ namespace osu.Game.Overlays.Music
|
|||||||
selected = value;
|
selected = value;
|
||||||
|
|
||||||
FinishTransforms(true);
|
FinishTransforms(true);
|
||||||
foreach (SpriteText s in titleSprites)
|
foreach (Drawable s in titleSprites)
|
||||||
s.FadeColour(Selected ? hoverColour : Color4.White, fade_duration);
|
s.FadeColour(Selected ? hoverColour : Color4.White, fade_duration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user