mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 22:19:30 +08:00
Merge branch 'master' into mania-holdnote-input
This commit is contained in:
commit
40e63a0870
57
osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs
Normal file
57
osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
// 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.Testing;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Users;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Desktop.VisualTests.Tests
|
||||||
|
{
|
||||||
|
internal class TestCaseUserPanel : TestCase
|
||||||
|
{
|
||||||
|
public override string Description => @"Panels for displaying a user's status";
|
||||||
|
|
||||||
|
public override void Reset()
|
||||||
|
{
|
||||||
|
base.Reset();
|
||||||
|
|
||||||
|
UserPanel flyte;
|
||||||
|
UserPanel peppy;
|
||||||
|
Add(new FillFlowContainer
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Spacing = new Vector2(10f),
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
flyte = new UserPanel(new User
|
||||||
|
{
|
||||||
|
Username = @"flyte",
|
||||||
|
Id = 3103765,
|
||||||
|
Country = new Country { FlagName = @"JP" },
|
||||||
|
CoverUrl = @"https://assets.ppy.sh/user-profile-covers/3103765/5b012e13611d5761caa7e24fecb3d3a16e1cf48fc2a3032cfd43dd444af83d82.jpeg"
|
||||||
|
}) { Width = 300 },
|
||||||
|
peppy = new UserPanel(new User
|
||||||
|
{
|
||||||
|
Username = @"peppy",
|
||||||
|
Id = 2,
|
||||||
|
Country = new Country { FlagName = @"AU" },
|
||||||
|
CoverUrl = @"https://assets.ppy.sh/user-profile-covers/2/08cad88747c235a64fca5f1b770e100f120827ded1ffe3b66bfcd19c940afa65.jpeg"
|
||||||
|
}) { Width = 300 },
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
flyte.Status.Value = new UserStatusOnline();
|
||||||
|
peppy.Status.Value = new UserStatusSoloGame();
|
||||||
|
|
||||||
|
AddStep(@"spectating", () => { flyte.Status.Value = new UserStatusSpectating(); });
|
||||||
|
AddStep(@"multiplaying", () => { flyte.Status.Value = new UserStatusMultiplayerGame(); });
|
||||||
|
AddStep(@"modding", () => { flyte.Status.Value = new UserStatusModding(); });
|
||||||
|
AddStep(@"offline", () => { flyte.Status.Value = new UserStatusOffline(); });
|
||||||
|
AddStep(@"null status", () => { flyte.Status.Value = null; });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -220,6 +220,7 @@
|
|||||||
<Compile Include="Tests\TestCaseLeaderboard.cs" />
|
<Compile Include="Tests\TestCaseLeaderboard.cs" />
|
||||||
<Compile Include="Beatmaps\TestWorkingBeatmap.cs" />
|
<Compile Include="Beatmaps\TestWorkingBeatmap.cs" />
|
||||||
<Compile Include="Tests\TestCaseBeatmapDetailArea.cs" />
|
<Compile Include="Tests\TestCaseBeatmapDetailArea.cs" />
|
||||||
|
<Compile Include="Tests\TestCaseUserPanel.cs" />
|
||||||
<Compile Include="Tests\TestCaseDirect.cs" />
|
<Compile Include="Tests\TestCaseDirect.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup />
|
<ItemGroup />
|
||||||
|
@ -7,6 +7,8 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.Backgrounds;
|
using osu.Game.Graphics.Backgrounds;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
|
using osu.Framework.Audio.Track;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
||||||
{
|
{
|
||||||
@ -22,6 +24,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
|||||||
public const float SYMBOL_SIZE = TaikoHitObject.DEFAULT_CIRCLE_DIAMETER * 0.45f;
|
public const float SYMBOL_SIZE = TaikoHitObject.DEFAULT_CIRCLE_DIAMETER * 0.45f;
|
||||||
public const float SYMBOL_BORDER = 8;
|
public const float SYMBOL_BORDER = 8;
|
||||||
public const float SYMBOL_INNER_SIZE = SYMBOL_SIZE - 2 * SYMBOL_BORDER;
|
public const float SYMBOL_INNER_SIZE = SYMBOL_SIZE - 2 * SYMBOL_BORDER;
|
||||||
|
private const double pre_beat_transition_time = 80;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The colour of the inner circle and outer glows.
|
/// The colour of the inner circle and outer glows.
|
||||||
@ -63,6 +66,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
|||||||
|
|
||||||
public CirclePiece(bool isStrong = false)
|
public CirclePiece(bool isStrong = false)
|
||||||
{
|
{
|
||||||
|
EarlyActivationMilliseconds = pre_beat_transition_time;
|
||||||
|
|
||||||
AddInternal(new Drawable[]
|
AddInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
background = new CircularContainer
|
background = new CircularContainer
|
||||||
@ -139,14 +144,31 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
|||||||
Content.Width = 1 / Content.Scale.X;
|
Content.Width = 1 / Content.Scale.X;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private const float edge_alpha_kiai = 0.5f;
|
||||||
|
|
||||||
private void resetEdgeEffects()
|
private void resetEdgeEffects()
|
||||||
{
|
{
|
||||||
background.EdgeEffect = new EdgeEffect
|
background.EdgeEffect = new EdgeEffect
|
||||||
{
|
{
|
||||||
Type = EdgeEffectType.Glow,
|
Type = EdgeEffectType.Glow,
|
||||||
Colour = AccentColour,
|
Colour = AccentColour.Opacity(KiaiMode ? edge_alpha_kiai : 1f),
|
||||||
Radius = KiaiMode ? 50 : 8
|
Radius = KiaiMode ? 32 : 8
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
|
||||||
|
{
|
||||||
|
if (!effectPoint.KiaiMode)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (beatIndex % (int)timingPoint.TimeSignature != 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
double duration = timingPoint.BeatLength * 2;
|
||||||
|
|
||||||
|
background.FadeEdgeEffectTo(1, pre_beat_transition_time, EasingTypes.OutQuint);
|
||||||
|
using (background.BeginDelayedSequence(pre_beat_transition_time))
|
||||||
|
background.FadeEdgeEffectTo(edge_alpha_kiai, duration, EasingTypes.OutQuint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,14 +1,14 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// 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.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
||||||
{
|
{
|
||||||
public class TaikoPiece : Container, IHasAccentColour
|
public class TaikoPiece : BeatSyncedContainer, IHasAccentColour
|
||||||
{
|
{
|
||||||
private Color4 accentColour;
|
private Color4 accentColour;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -17,10 +17,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
|||||||
public virtual Color4 AccentColour
|
public virtual Color4 AccentColour
|
||||||
{
|
{
|
||||||
get { return accentColour; }
|
get { return accentColour; }
|
||||||
set
|
set { accentColour = value; }
|
||||||
{
|
|
||||||
accentColour = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool kiaiMode;
|
private bool kiaiMode;
|
||||||
|
@ -13,12 +13,12 @@ namespace osu.Game.Rulesets.Taiko.Objects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Diameter of a circle relative to the size of the <see cref="TaikoPlayfield"/>.
|
/// Diameter of a circle relative to the size of the <see cref="TaikoPlayfield"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const float PLAYFIELD_RELATIVE_DIAMETER = 0.5f;
|
public const float PLAYFIELD_RELATIVE_DIAMETER = 0.45f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Scale multiplier for a strong circle.
|
/// Scale multiplier for a strong circle.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const float STRONG_CIRCLE_DIAMETER_SCALE = 1.5f;
|
public const float STRONG_CIRCLE_DIAMETER_SCALE = 1.4f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default circle diameter.
|
/// Default circle diameter.
|
||||||
|
@ -18,22 +18,23 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
internal class HitExplosion : CircularContainer
|
internal class HitExplosion : CircularContainer
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// The judgement this hit explosion visualises.
|
|
||||||
/// </summary>
|
|
||||||
public readonly TaikoJudgement Judgement;
|
public readonly TaikoJudgement Judgement;
|
||||||
|
|
||||||
private readonly Box innerFill;
|
private readonly Box innerFill;
|
||||||
|
|
||||||
public HitExplosion(TaikoJudgement judgement)
|
private readonly bool isRim;
|
||||||
{
|
|
||||||
Judgement = judgement;
|
|
||||||
|
|
||||||
Size = new Vector2(TaikoHitObject.DEFAULT_CIRCLE_DIAMETER);
|
public HitExplosion(TaikoJudgement judgement, bool isRim)
|
||||||
|
{
|
||||||
|
this.isRim = isRim;
|
||||||
|
|
||||||
|
Judgement = judgement;
|
||||||
|
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
|
Size = new Vector2(TaikoPlayfield.HIT_TARGET_OFFSET + TaikoHitObject.DEFAULT_CIRCLE_DIAMETER);
|
||||||
|
|
||||||
RelativePositionAxes = Axes.Both;
|
RelativePositionAxes = Axes.Both;
|
||||||
|
|
||||||
BorderColour = Color4.White;
|
BorderColour = Color4.White;
|
||||||
@ -54,22 +55,14 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
switch (Judgement.TaikoResult)
|
innerFill.Colour = isRim ? colours.BlueDarker : colours.PinkDarker;
|
||||||
{
|
|
||||||
case TaikoHitResult.Good:
|
|
||||||
innerFill.Colour = colours.Green;
|
|
||||||
break;
|
|
||||||
case TaikoHitResult.Great:
|
|
||||||
innerFill.Colour = colours.Blue;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
ScaleTo(5f, 1000, EasingTypes.OutQuint);
|
ScaleTo(3f, 1000, EasingTypes.OutQuint);
|
||||||
FadeOut(500);
|
FadeOut(500);
|
||||||
|
|
||||||
Expire();
|
Expire();
|
||||||
@ -80,7 +73,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void VisualiseSecondHit()
|
public void VisualiseSecondHit()
|
||||||
{
|
{
|
||||||
ResizeTo(Size * TaikoHitObject.STRONG_CIRCLE_DIAMETER_SCALE, 50);
|
ResizeTo(new Vector2(TaikoPlayfield.HIT_TARGET_OFFSET + TaikoHitObject.DEFAULT_STRONG_CIRCLE_DIAMETER), 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
68
osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs
Normal file
68
osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using OpenTK;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Rulesets.Taiko.Judgements;
|
||||||
|
using osu.Game.Rulesets.Taiko.Objects;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Taiko.UI
|
||||||
|
{
|
||||||
|
public class KiaiHitExplosion : CircularContainer
|
||||||
|
{
|
||||||
|
public readonly TaikoJudgement Judgement;
|
||||||
|
|
||||||
|
private readonly bool isRim;
|
||||||
|
|
||||||
|
public KiaiHitExplosion(TaikoJudgement judgement, bool isRim)
|
||||||
|
{
|
||||||
|
this.isRim = isRim;
|
||||||
|
|
||||||
|
Judgement = judgement;
|
||||||
|
|
||||||
|
Anchor = Anchor.Centre;
|
||||||
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
|
RelativeSizeAxes = Axes.Y;
|
||||||
|
Size = new Vector2(TaikoHitObject.DEFAULT_CIRCLE_DIAMETER, 1);
|
||||||
|
|
||||||
|
Masking = true;
|
||||||
|
Alpha = 0.25f;
|
||||||
|
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Alpha = 0,
|
||||||
|
AlwaysPresent = true
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuColour colours)
|
||||||
|
{
|
||||||
|
EdgeEffect = new EdgeEffect
|
||||||
|
{
|
||||||
|
Type = EdgeEffectType.Glow,
|
||||||
|
Colour = isRim ? colours.BlueDarker : colours.PinkDarker,
|
||||||
|
Radius = 60,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
ScaleTo(new Vector2(1, 3f), 500, EasingTypes.OutQuint);
|
||||||
|
FadeOut(250);
|
||||||
|
|
||||||
|
Expire();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -24,12 +24,12 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The default play field height.
|
/// The default play field height.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const float DEFAULT_PLAYFIELD_HEIGHT = 168f;
|
public const float DEFAULT_PLAYFIELD_HEIGHT = 178f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The offset from <see cref="left_area_size"/> which the center of the hit target lies at.
|
/// The offset from <see cref="left_area_size"/> which the center of the hit target lies at.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const float hit_target_offset = TaikoHitObject.DEFAULT_STRONG_CIRCLE_DIAMETER / 2f + 40;
|
public const float HIT_TARGET_OFFSET = TaikoHitObject.DEFAULT_STRONG_CIRCLE_DIAMETER / 2f + 40;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The size of the left area of the playfield. This area contains the input drum.
|
/// The size of the left area of the playfield. This area contains the input drum.
|
||||||
@ -39,15 +39,18 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
protected override Container<Drawable> Content => hitObjectContainer;
|
protected override Container<Drawable> Content => hitObjectContainer;
|
||||||
|
|
||||||
private readonly Container<HitExplosion> hitExplosionContainer;
|
private readonly Container<HitExplosion> hitExplosionContainer;
|
||||||
|
private readonly Container<KiaiHitExplosion> kiaiExplosionContainer;
|
||||||
private readonly Container<DrawableBarLine> barLineContainer;
|
private readonly Container<DrawableBarLine> barLineContainer;
|
||||||
private readonly Container<DrawableTaikoJudgement> judgementContainer;
|
private readonly Container<DrawableTaikoJudgement> judgementContainer;
|
||||||
|
|
||||||
private readonly Container hitObjectContainer;
|
private readonly Container hitObjectContainer;
|
||||||
private readonly Container topLevelHitContainer;
|
private readonly Container topLevelHitContainer;
|
||||||
private readonly Container leftBackgroundContainer;
|
|
||||||
private readonly Container rightBackgroundContainer;
|
private readonly Container overlayBackgroundContainer;
|
||||||
private readonly Box leftBackground;
|
private readonly Container backgroundContainer;
|
||||||
private readonly Box rightBackground;
|
|
||||||
|
private readonly Box overlayBackground;
|
||||||
|
private readonly Box background;
|
||||||
|
|
||||||
public TaikoPlayfield()
|
public TaikoPlayfield()
|
||||||
{
|
{
|
||||||
@ -59,7 +62,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
Height = DEFAULT_PLAYFIELD_HEIGHT,
|
Height = DEFAULT_PLAYFIELD_HEIGHT,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
rightBackgroundContainer = new Container
|
backgroundContainer = new Container
|
||||||
{
|
{
|
||||||
Name = "Transparent playfield background",
|
Name = "Transparent playfield background",
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@ -73,7 +76,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
},
|
},
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
rightBackground = new Box
|
background = new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Alpha = 0.6f
|
Alpha = 0.6f
|
||||||
@ -82,24 +85,23 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
Name = "Transparent playfield elements",
|
Name = "Right area",
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Padding = new MarginPadding { Left = left_area_size },
|
Margin = new MarginPadding { Left = left_area_size },
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
Name = "Hit target container",
|
Name = "Masked elements",
|
||||||
X = hit_target_offset,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Padding = new MarginPadding { Left = HIT_TARGET_OFFSET },
|
||||||
|
Masking = true,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
hitExplosionContainer = new Container<HitExplosion>
|
hitExplosionContainer = new Container<HitExplosion>
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
BlendingMode = BlendingMode.Additive
|
BlendingMode = BlendingMode.Additive,
|
||||||
},
|
},
|
||||||
barLineContainer = new Container<DrawableBarLine>
|
barLineContainer = new Container<DrawableBarLine>
|
||||||
{
|
{
|
||||||
@ -114,23 +116,32 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
},
|
},
|
||||||
judgementContainer = new Container<DrawableTaikoJudgement>
|
}
|
||||||
{
|
},
|
||||||
RelativeSizeAxes = Axes.Y,
|
kiaiExplosionContainer = new Container<KiaiHitExplosion>
|
||||||
BlendingMode = BlendingMode.Additive
|
{
|
||||||
},
|
Name = "Kiai hit explosions",
|
||||||
},
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
Margin = new MarginPadding { Left = HIT_TARGET_OFFSET },
|
||||||
|
BlendingMode = BlendingMode.Additive
|
||||||
|
},
|
||||||
|
judgementContainer = new Container<DrawableTaikoJudgement>
|
||||||
|
{
|
||||||
|
Name = "Judgements",
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
Margin = new MarginPadding { Left = HIT_TARGET_OFFSET },
|
||||||
|
BlendingMode = BlendingMode.Additive
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
leftBackgroundContainer = new Container
|
overlayBackgroundContainer = new Container
|
||||||
{
|
{
|
||||||
Name = "Left overlay",
|
Name = "Left overlay",
|
||||||
Size = new Vector2(left_area_size, DEFAULT_PLAYFIELD_HEIGHT),
|
Size = new Vector2(left_area_size, DEFAULT_PLAYFIELD_HEIGHT),
|
||||||
BorderThickness = 1,
|
BorderThickness = 1,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
leftBackground = new Box
|
overlayBackground = new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
},
|
},
|
||||||
@ -164,11 +175,11 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
leftBackgroundContainer.BorderColour = colours.Gray0;
|
overlayBackgroundContainer.BorderColour = colours.Gray0;
|
||||||
leftBackground.Colour = colours.Gray1;
|
overlayBackground.Colour = colours.Gray1;
|
||||||
|
|
||||||
rightBackgroundContainer.BorderColour = colours.Gray1;
|
backgroundContainer.BorderColour = colours.Gray1;
|
||||||
rightBackground.Colour = colours.Gray0;
|
background.Colour = colours.Gray0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Add(DrawableHitObject<TaikoHitObject, TaikoJudgement> h)
|
public override void Add(DrawableHitObject<TaikoHitObject, TaikoJudgement> h)
|
||||||
@ -204,6 +215,8 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
if (!wasHit)
|
if (!wasHit)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
bool isRim = judgedObject.HitObject is RimHit;
|
||||||
|
|
||||||
if (!secondHit)
|
if (!secondHit)
|
||||||
{
|
{
|
||||||
if (judgedObject.X >= -0.05f && !(judgedObject is DrawableSwell))
|
if (judgedObject.X >= -0.05f && !(judgedObject is DrawableSwell))
|
||||||
@ -212,7 +225,11 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
topLevelHitContainer.Add(judgedObject.CreateProxy());
|
topLevelHitContainer.Add(judgedObject.CreateProxy());
|
||||||
}
|
}
|
||||||
|
|
||||||
hitExplosionContainer.Add(new HitExplosion(judgedObject.Judgement));
|
hitExplosionContainer.Add(new HitExplosion(judgedObject.Judgement, isRim));
|
||||||
|
|
||||||
|
if (judgedObject.HitObject.Kiai)
|
||||||
|
kiaiExplosionContainer.Add(new KiaiHitExplosion(judgedObject.Judgement, isRim));
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
hitExplosionContainer.Children.FirstOrDefault(e => e.Judgement == judgedObject.Judgement)?.VisualiseSecondHit();
|
hitExplosionContainer.Children.FirstOrDefault(e => e.Judgement == judgedObject.Judgement)?.VisualiseSecondHit();
|
||||||
|
@ -87,6 +87,7 @@
|
|||||||
<Compile Include="Scoring\TaikoScoreProcessor.cs" />
|
<Compile Include="Scoring\TaikoScoreProcessor.cs" />
|
||||||
<Compile Include="UI\HitTarget.cs" />
|
<Compile Include="UI\HitTarget.cs" />
|
||||||
<Compile Include="UI\InputDrum.cs" />
|
<Compile Include="UI\InputDrum.cs" />
|
||||||
|
<Compile Include="UI\KiaiHitExplosion.cs" />
|
||||||
<Compile Include="UI\DrawableTaikoJudgement.cs" />
|
<Compile Include="UI\DrawableTaikoJudgement.cs" />
|
||||||
<Compile Include="UI\HitExplosion.cs" />
|
<Compile Include="UI\HitExplosion.cs" />
|
||||||
<Compile Include="UI\TaikoHitRenderer.cs" />
|
<Compile Include="UI\TaikoHitRenderer.cs" />
|
||||||
|
@ -12,6 +12,7 @@ using osu.Game.Graphics.UserInterface;
|
|||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Settings.Sections.General
|
namespace osu.Game.Overlays.Settings.Sections.General
|
||||||
{
|
{
|
||||||
@ -73,9 +74,9 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
case APIState.Online:
|
case APIState.Online:
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new OsuSpriteText
|
new UserPanel(api.LocalUser.Value)
|
||||||
{
|
{
|
||||||
Text = $"Connected as {api.Username}!",
|
RelativeSizeAxes = Axes.X,
|
||||||
},
|
},
|
||||||
new OsuButton
|
new OsuButton
|
||||||
{
|
{
|
||||||
|
209
osu.Game/Users/UserPanel.cs
Normal file
209
osu.Game/Users/UserPanel.cs
Normal file
@ -0,0 +1,209 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Configuration;
|
||||||
|
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;
|
||||||
|
|
||||||
|
namespace osu.Game.Users
|
||||||
|
{
|
||||||
|
public class UserPanel : Container
|
||||||
|
{
|
||||||
|
private const float height = 100;
|
||||||
|
private const float content_padding = 10;
|
||||||
|
private const float status_height = 30;
|
||||||
|
|
||||||
|
private OsuColour colours;
|
||||||
|
|
||||||
|
private readonly Container statusBar;
|
||||||
|
private readonly Box statusBg;
|
||||||
|
private readonly OsuSpriteText statusMessage;
|
||||||
|
|
||||||
|
public readonly Bindable<UserStatus> Status = new Bindable<UserStatus>();
|
||||||
|
|
||||||
|
public UserPanel(User user)
|
||||||
|
{
|
||||||
|
Height = height - status_height;
|
||||||
|
Masking = true;
|
||||||
|
CornerRadius = 5;
|
||||||
|
EdgeEffect = new EdgeEffect
|
||||||
|
{
|
||||||
|
Type = EdgeEffectType.Shadow,
|
||||||
|
Colour = Color4.Black.Opacity(0.25f),
|
||||||
|
Radius = 4,
|
||||||
|
};
|
||||||
|
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new AsyncLoadWrapper(new CoverBackgroundSprite(user)
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
FillMode = FillMode.Fill,
|
||||||
|
OnLoadComplete = d => d.FadeInFromZero(200),
|
||||||
|
}) { RelativeSizeAxes = Axes.Both },
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = Color4.Black.Opacity(0.7f),
|
||||||
|
},
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Padding = new MarginPadding { Top = content_padding, Left = content_padding, Right = content_padding },
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new UpdateableAvatar
|
||||||
|
{
|
||||||
|
Size = new Vector2(height - status_height - content_padding * 2),
|
||||||
|
User = user,
|
||||||
|
Masking = true,
|
||||||
|
CornerRadius = 5,
|
||||||
|
EdgeEffect = new EdgeEffect
|
||||||
|
{
|
||||||
|
Type = EdgeEffectType.Shadow,
|
||||||
|
Colour = Color4.Black.Opacity(0.25f),
|
||||||
|
Radius = 4,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Padding = new MarginPadding { Left = height - status_height - content_padding },
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Text = user.Username,
|
||||||
|
TextSize = 18,
|
||||||
|
Font = @"Exo2.0-SemiBoldItalic",
|
||||||
|
},
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Origin = Anchor.BottomLeft,
|
||||||
|
AutoSizeAxes = Axes.X,
|
||||||
|
Height = 20f,
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
Spacing = new Vector2(5f, 0f),
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new DrawableFlag(user.Country?.FlagName ?? @"__")
|
||||||
|
{
|
||||||
|
Width = 30f,
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
},
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
Width = 40f,
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
},
|
||||||
|
new CircularContainer
|
||||||
|
{
|
||||||
|
Width = 20f,
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
statusBar = new Container
|
||||||
|
{
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Origin = Anchor.BottomLeft,
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Alpha = 0f,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
statusBg = new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Alpha = 0.5f,
|
||||||
|
},
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Spacing = new Vector2(5f, 0f),
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
new TextAwesome
|
||||||
|
{
|
||||||
|
Anchor = Anchor.CentreLeft,
|
||||||
|
Origin = Anchor.CentreLeft,
|
||||||
|
Icon = FontAwesome.fa_circle_o,
|
||||||
|
Shadow = true,
|
||||||
|
TextSize = 14,
|
||||||
|
},
|
||||||
|
statusMessage = new OsuSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.CentreLeft,
|
||||||
|
Origin = Anchor.CentreLeft,
|
||||||
|
Font = @"Exo2.0-Semibold",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
Status.ValueChanged += displayStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuColour colours)
|
||||||
|
{
|
||||||
|
this.colours = colours;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void displayStatus(UserStatus status)
|
||||||
|
{
|
||||||
|
const float transition_duration = 500;
|
||||||
|
|
||||||
|
if (status == null)
|
||||||
|
{
|
||||||
|
statusBar.ResizeHeightTo(0f, transition_duration, EasingTypes.OutQuint);
|
||||||
|
statusBar.FadeOut(transition_duration, EasingTypes.OutQuint);
|
||||||
|
ResizeHeightTo(height - status_height, transition_duration, EasingTypes.OutQuint);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
statusBar.ResizeHeightTo(status_height, transition_duration, EasingTypes.OutQuint);
|
||||||
|
statusBar.FadeIn(transition_duration, EasingTypes.OutQuint);
|
||||||
|
ResizeHeightTo(height, transition_duration, EasingTypes.OutQuint);
|
||||||
|
|
||||||
|
statusBg.FadeColour(status.GetAppropriateColour(colours), 500, EasingTypes.OutQuint);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
61
osu.Game/Users/UserStatus.cs
Normal file
61
osu.Game/Users/UserStatus.cs
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.Users
|
||||||
|
{
|
||||||
|
public abstract class UserStatus
|
||||||
|
{
|
||||||
|
public abstract string Message { get; }
|
||||||
|
public abstract Color4 GetAppropriateColour(OsuColour colours);
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract class UserStatusAvailable : UserStatus
|
||||||
|
{
|
||||||
|
public override Color4 GetAppropriateColour(OsuColour colours) => colours.BlueDarker;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract class UserStatusBusy : UserStatus
|
||||||
|
{
|
||||||
|
public override Color4 GetAppropriateColour(OsuColour colours) => colours.YellowDark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UserStatusOffline : UserStatus
|
||||||
|
{
|
||||||
|
public override string Message => @"Offline";
|
||||||
|
public override Color4 GetAppropriateColour(OsuColour colours) => colours.Gray7;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UserStatusOnline : UserStatusAvailable
|
||||||
|
{
|
||||||
|
public override string Message => @"Online";
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UserStatusSpectating : UserStatusAvailable
|
||||||
|
{
|
||||||
|
public override string Message => @"Spectating a game";
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UserStatusInLobby : UserStatusAvailable
|
||||||
|
{
|
||||||
|
public override string Message => @"in Multiplayer Lobby";
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UserStatusSoloGame : UserStatusBusy
|
||||||
|
{
|
||||||
|
public override string Message => @"Solo Game";
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UserStatusMultiplayerGame: UserStatusBusy
|
||||||
|
{
|
||||||
|
public override string Message => @"Multiplaying";
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UserStatusModding : UserStatus
|
||||||
|
{
|
||||||
|
public override string Message => @"Modding a map";
|
||||||
|
public override Color4 GetAppropriateColour(OsuColour colours) => colours.PurpleDark;
|
||||||
|
}
|
||||||
|
}
|
@ -432,6 +432,8 @@
|
|||||||
<Compile Include="Overlays\Music\PlaylistOverlay.cs" />
|
<Compile Include="Overlays\Music\PlaylistOverlay.cs" />
|
||||||
<Compile Include="Rulesets\Replays\IAutoGenerator.cs" />
|
<Compile Include="Rulesets\Replays\IAutoGenerator.cs" />
|
||||||
<Compile Include="Rulesets\Replays\AutoGenerator.cs" />
|
<Compile Include="Rulesets\Replays\AutoGenerator.cs" />
|
||||||
|
<Compile Include="Users\UserPanel.cs" />
|
||||||
|
<Compile Include="Users\UserStatus.cs" />
|
||||||
<Compile Include="Overlays\DirectOverlay.cs" />
|
<Compile Include="Overlays\DirectOverlay.cs" />
|
||||||
<Compile Include="Overlays\Direct\FilterControl.cs" />
|
<Compile Include="Overlays\Direct\FilterControl.cs" />
|
||||||
<Compile Include="Overlays\Direct\Header.cs" />
|
<Compile Include="Overlays\Direct\Header.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user