Merge branch 'master' into editor-bottom-bar-shadow

This commit is contained in:
Dean Herbert
2022-06-01 14:55:50 +09:00
committed by GitHub
62 changed files with 1181 additions and 3085 deletions

View File

@ -16,6 +16,7 @@ using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Rulesets.Edit;
using osuTK;
using osuTK.Input;
namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
@ -273,7 +274,8 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
if (base.OnMouseDown(e))
beginUserDrag();
return true;
// handling right button as well breaks context menus inside the timeline, only handle left button for now.
return e.Button == MouseButton.Left;
}
protected override void OnMouseUp(MouseUpEvent e)

View File

@ -135,7 +135,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
Vector2 size = Vector2.One;
if (indexInBar != 1)
if (indexInBar != 0)
size = BindableBeatDivisor.GetSize(divisor);
var line = getNextUsableLine();

View File

@ -41,7 +41,7 @@ namespace osu.Game.Screens.Edit.Setup
Add(new Box
{
Colour = colourProvider.Background2,
Colour = colourProvider.Background3,
RelativeSizeAxes = Axes.Both,
});

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Timing;
using osu.Framework.Utils;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics.Containers;
@ -28,6 +29,8 @@ namespace osu.Game.Screens.Edit.Timing
private Drawable weight;
private Drawable stick;
private IAdjustableClock metronomeClock;
[Resolved]
private OverlayColourProvider overlayColourProvider { get; set; }
@ -192,6 +195,8 @@ namespace osu.Game.Screens.Edit.Timing
Y = -3,
},
};
Clock = new FramedClock(metronomeClock = new StopwatchClock(true));
}
private double beatLength;
@ -216,6 +221,8 @@ namespace osu.Game.Screens.Edit.Timing
if (BeatSyncSource.ControlPoints == null || BeatSyncSource.Clock == null)
return;
metronomeClock.Rate = IsBeatSyncedWithTrack ? BeatSyncSource.Clock.Rate : 1;
timingPoint = BeatSyncSource.ControlPoints.TimingPointAt(BeatSyncSource.Clock.CurrentTime);
if (beatLength != timingPoint.BeatLength)

View File

@ -19,6 +19,8 @@ namespace osu.Game.Screens.Edit.Timing
private readonly string label;
protected Drawable Background { get; private set; }
protected FillFlowContainer Content { get; private set; }
public RowAttribute(ControlPoint point, string label)
@ -41,11 +43,11 @@ namespace osu.Game.Screens.Edit.Timing
Masking = true;
CornerRadius = 3;
InternalChildren = new Drawable[]
InternalChildren = new[]
{
new Box
Background = new Box
{
Colour = overlayColours.Background4,
Colour = overlayColours.Background5,
RelativeSizeAxes = Axes.Both,
},
Content = new FillFlowContainer

View File

@ -7,6 +7,7 @@ using osu.Framework.Extensions;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Beatmaps.Timing;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
namespace osu.Game.Screens.Edit.Timing.RowAttributes
{
@ -24,10 +25,12 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes
}
[BackgroundDependencyLoader]
private void load()
private void load(OverlayColourProvider colourProvider)
{
Content.Add(text = new AttributeText(Point));
Background.Colour = colourProvider.Background4;
timeSignature.BindValueChanged(_ => updateText());
beatLength.BindValueChanged(_ => updateText(), true);
}

View File

@ -63,7 +63,7 @@ namespace osu.Game.Screens.Edit.Timing
for (int i = 0; i < total_waveforms; i++)
{
AddInternal(new WaveformRow
AddInternal(new WaveformRow(i == total_waveforms / 2)
{
RelativeSizeAxes = Axes.Both,
RelativePositionAxes = Axes.Both,
@ -177,17 +177,29 @@ namespace osu.Game.Screens.Edit.Timing
internal class WaveformRow : CompositeDrawable
{
private readonly bool isMainRow;
private OsuSpriteText beatIndexText = null!;
private WaveformGraph waveformGraph = null!;
[Resolved]
private OverlayColourProvider colourProvider { get; set; } = null!;
public WaveformRow(bool isMainRow)
{
this.isMainRow = isMainRow;
}
[BackgroundDependencyLoader]
private void load(IBindable<WorkingBeatmap> beatmap)
{
InternalChildren = new Drawable[]
{
new Box
{
Colour = colourProvider.Background3,
Alpha = isMainRow ? 1 : 0,
RelativeSizeAxes = Axes.Both,
},
waveformGraph = new WaveformGraph
{
RelativeSizeAxes = Axes.Both,

View File

@ -51,7 +51,7 @@ namespace osu.Game.Screens.Edit.Verify
{
new Box
{
Colour = colours.Background2,
Colour = colours.Background3,
RelativeSizeAxes = Axes.Both,
},
new OsuScrollContainer

View File

@ -41,7 +41,7 @@ namespace osu.Game.Screens.Edit.Verify
ColumnDimensions = new[]
{
new Dimension(),
new Dimension(GridSizeMode.Absolute, 200),
new Dimension(GridSizeMode.Absolute, 250),
},
Content = new[]
{

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Audio.Track;
@ -80,16 +81,13 @@ namespace osu.Game.Screens.Play.HUD
difficultyCache.GetTimedDifficultyAttributesAsync(gameplayWorkingBeatmap, gameplayState.Ruleset, clonedMods, loadCancellationSource.Token)
.ContinueWith(task => Schedule(() =>
{
if (task.Exception != null)
return;
timedAttributes = task.GetResultSafely();
IsValid = true;
if (lastJudgement != null)
onJudgementChanged(lastJudgement);
}));
}), TaskContinuationOptions.OnlyOnRanToCompletion);
}
}