1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 21:27:24 +08:00

Visual design pass

This commit is contained in:
Dean Herbert 2024-09-04 21:04:59 +09:00
parent a4a37c5ba6
commit a6ed719454
No known key found for this signature in database
5 changed files with 61 additions and 84 deletions

View File

@ -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;
}
}
}
}

View File

@ -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();
}
}
}
}

View File

@ -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);
}
}
}

View File

@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Osu.UI.ReplayAnalysis
lifetimeManager.EntryBecameAlive += entryBecameAlive;
lifetimeManager.EntryBecameDead += entryBecameDead;
PathRadius = 1f;
PathRadius = 0.5f;
}
[BackgroundDependencyLoader]

View File

@ -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));
}
}
}