mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 15:22:55 +08:00
Visual design pass
This commit is contained in:
parent
a4a37c5ba6
commit
a6ed719454
@ -1,7 +1,9 @@
|
||||
// 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.Game.Graphics;
|
||||
using osu.Game.Rulesets.Objects.Pooling;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.UI.ReplayAnalysis
|
||||
@ -13,6 +15,9 @@ namespace osu.Game.Rulesets.Osu.UI.ReplayAnalysis
|
||||
Origin = Anchor.Centre;
|
||||
}
|
||||
|
||||
[Resolved]
|
||||
private OsuColour colours { get; set; } = null!;
|
||||
|
||||
protected override void OnApply(AnalysisFrameEntry entry)
|
||||
{
|
||||
Position = entry.Position;
|
||||
@ -22,6 +27,21 @@ namespace osu.Game.Rulesets.Osu.UI.ReplayAnalysis
|
||||
|
||||
using (BeginAbsoluteSequence(LifetimeEnd - 200))
|
||||
this.FadeOut(200);
|
||||
|
||||
switch (entry.Action)
|
||||
{
|
||||
case OsuAction.LeftButton:
|
||||
Colour = colours.BlueLight;
|
||||
break;
|
||||
|
||||
case OsuAction.RightButton:
|
||||
Colour = colours.YellowLight;
|
||||
break;
|
||||
|
||||
default:
|
||||
Colour = colours.Pink2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.UI.ReplayAnalysis
|
||||
{
|
||||
@ -11,62 +10,25 @@ namespace osu.Game.Rulesets.Osu.UI.ReplayAnalysis
|
||||
{
|
||||
public HitMarkerClick()
|
||||
{
|
||||
const float length = 20;
|
||||
const float border_size = 3;
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
new CircularContainer
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(border_size, length + border_size),
|
||||
Colour = Colour4.Black.Opacity(0.5F)
|
||||
Size = new Vector2(15),
|
||||
Masking = true,
|
||||
BorderThickness = 2,
|
||||
BorderColour = Color4.White,
|
||||
Child = new Box
|
||||
{
|
||||
Colour = Color4.Black,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
AlwaysPresent = true,
|
||||
Alpha = 0,
|
||||
},
|
||||
new Box
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(border_size, length + border_size),
|
||||
Rotation = 90,
|
||||
Colour = Colour4.Black.Opacity(0.5F)
|
||||
},
|
||||
new Box
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(1, length),
|
||||
},
|
||||
new Box
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(1, length),
|
||||
Rotation = 90,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
[Resolved]
|
||||
private OsuColour colours { get; set; } = null!;
|
||||
|
||||
protected override void OnApply(AnalysisFrameEntry entry)
|
||||
{
|
||||
base.OnApply(entry);
|
||||
|
||||
switch (entry.Action)
|
||||
{
|
||||
case OsuAction.LeftButton:
|
||||
Colour = colours.BlueLight;
|
||||
break;
|
||||
|
||||
case OsuAction.RightButton:
|
||||
Colour = colours.YellowLight;
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.UI.ReplayAnalysis
|
||||
{
|
||||
@ -10,41 +9,30 @@ namespace osu.Game.Rulesets.Osu.UI.ReplayAnalysis
|
||||
{
|
||||
public HitMarkerMovement()
|
||||
{
|
||||
const float length = 5;
|
||||
|
||||
Colour = Color4.Gray.Opacity(0.4f);
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
new Circle
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(3, length),
|
||||
Colour = Colour4.Black.Opacity(0.5F)
|
||||
Colour = OsuColour.Gray(0.2f),
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = new Vector2(1.2f)
|
||||
},
|
||||
new Box
|
||||
new Circle
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(3, length),
|
||||
Rotation = 90,
|
||||
Colour = Colour4.Black.Opacity(0.5F)
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
new Box
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(1, length),
|
||||
},
|
||||
new Box
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(1, length),
|
||||
Rotation = 90,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected override void OnApply(AnalysisFrameEntry entry)
|
||||
{
|
||||
base.OnApply(entry);
|
||||
|
||||
Size = new Vector2(entry.Action != null ? 4 : 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Osu.UI.ReplayAnalysis
|
||||
lifetimeManager.EntryBecameAlive += entryBecameAlive;
|
||||
lifetimeManager.EntryBecameDead += entryBecameDead;
|
||||
|
||||
PathRadius = 1f;
|
||||
PathRadius = 0.5f;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
@ -62,13 +62,12 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
bool leftHeld = false;
|
||||
bool rightHeld = false;
|
||||
|
||||
OsuAction? lastAction = null;
|
||||
|
||||
foreach (var frame in replay.Frames)
|
||||
{
|
||||
var osuFrame = (OsuReplayFrame)frame;
|
||||
|
||||
MovementMarkers.Add(new AnalysisFrameEntry(osuFrame.Time, osuFrame.Position));
|
||||
MovementPath.Add(new AnalysisFrameEntry(osuFrame.Time, osuFrame.Position));
|
||||
|
||||
bool leftButton = osuFrame.Actions.Contains(OsuAction.LeftButton);
|
||||
bool rightButton = osuFrame.Actions.Contains(OsuAction.RightButton);
|
||||
|
||||
@ -76,17 +75,25 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
leftHeld = false;
|
||||
else if (!leftHeld && leftButton)
|
||||
{
|
||||
ClickMarkers.Add(new AnalysisFrameEntry(osuFrame.Time, osuFrame.Position, OsuAction.LeftButton));
|
||||
leftHeld = true;
|
||||
lastAction = OsuAction.LeftButton;
|
||||
ClickMarkers.Add(new AnalysisFrameEntry(osuFrame.Time, osuFrame.Position, OsuAction.LeftButton));
|
||||
}
|
||||
|
||||
if (rightHeld && !rightButton)
|
||||
rightHeld = false;
|
||||
else if (!rightHeld && rightButton)
|
||||
{
|
||||
ClickMarkers.Add(new AnalysisFrameEntry(osuFrame.Time, osuFrame.Position, OsuAction.RightButton));
|
||||
rightHeld = true;
|
||||
lastAction = OsuAction.RightButton;
|
||||
ClickMarkers.Add(new AnalysisFrameEntry(osuFrame.Time, osuFrame.Position, OsuAction.RightButton));
|
||||
}
|
||||
|
||||
if (!leftButton && !rightButton)
|
||||
lastAction = null;
|
||||
|
||||
MovementMarkers.Add(new AnalysisFrameEntry(osuFrame.Time, osuFrame.Position, lastAction));
|
||||
MovementPath.Add(new AnalysisFrameEntry(osuFrame.Time, osuFrame.Position));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user