mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 12:45:09 +08:00
Merge branch 'master' into profile.
This commit is contained in:
commit
6f2b49dea8
@ -1 +1 @@
|
|||||||
Subproject commit bb8c723ad135a2935a499c45f23c45bd14f3daa4
|
Subproject commit 3c76bce45762765b7268f8036da681a788f756b9
|
193
osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs
Normal file
193
osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs
Normal file
@ -0,0 +1,193 @@
|
|||||||
|
// 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.Framework.Timing;
|
||||||
|
using osu.Game.Overlays;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
using osu.Framework.Audio.Track;
|
||||||
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osu.Framework.Lists;
|
||||||
|
using System;
|
||||||
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
|
|
||||||
|
namespace osu.Desktop.VisualTests.Tests
|
||||||
|
{
|
||||||
|
internal class TestCaseBeatSyncedContainer : TestCase
|
||||||
|
{
|
||||||
|
public override string Description => @"Tests beat synced containers.";
|
||||||
|
|
||||||
|
private readonly MusicController mc;
|
||||||
|
|
||||||
|
public TestCaseBeatSyncedContainer()
|
||||||
|
{
|
||||||
|
Clock = new FramedClock();
|
||||||
|
Clock.ProcessFrame();
|
||||||
|
|
||||||
|
Add(new BeatContainer
|
||||||
|
{
|
||||||
|
Anchor = Anchor.BottomCentre,
|
||||||
|
Origin = Anchor.BottomCentre,
|
||||||
|
});
|
||||||
|
|
||||||
|
Add(mc = new MusicController
|
||||||
|
{
|
||||||
|
Origin = Anchor.TopRight,
|
||||||
|
Anchor = Anchor.TopRight,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
mc.ToggleVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
private class BeatContainer : BeatSyncedContainer
|
||||||
|
{
|
||||||
|
private const int flash_layer_heigth = 150;
|
||||||
|
|
||||||
|
private readonly InfoString timingPointCount;
|
||||||
|
private readonly InfoString currentTimingPoint;
|
||||||
|
private readonly InfoString beatCount;
|
||||||
|
private readonly InfoString currentBeat;
|
||||||
|
private readonly InfoString beatsPerMinute;
|
||||||
|
private readonly InfoString adjustedBeatLength;
|
||||||
|
|
||||||
|
private readonly Box flashLayer;
|
||||||
|
|
||||||
|
public BeatContainer()
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
AutoSizeAxes = Axes.Y;
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
Name = @"Info Layer",
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Origin = Anchor.BottomLeft,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Margin = new MarginPadding { Bottom = flash_layer_heigth },
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = Color4.Black.Opacity(150),
|
||||||
|
},
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Origin = Anchor.BottomLeft,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
timingPointCount = new InfoString(@"Timing points amount"),
|
||||||
|
currentTimingPoint = new InfoString(@"Current timing point"),
|
||||||
|
beatCount = new InfoString(@"Beats amount (in the current timing point)"),
|
||||||
|
currentBeat = new InfoString(@"Current beat"),
|
||||||
|
beatsPerMinute = new InfoString(@"BPM"),
|
||||||
|
adjustedBeatLength = new InfoString(@"Adjusted beat length"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
Name = @"Color indicator",
|
||||||
|
Anchor = Anchor.BottomCentre,
|
||||||
|
Origin = Anchor.BottomCentre,
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Height = flash_layer_heigth,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = Color4.Black,
|
||||||
|
},
|
||||||
|
flashLayer = new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = Color4.White,
|
||||||
|
Alpha = 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Beatmap.ValueChanged += delegate
|
||||||
|
{
|
||||||
|
timingPointCount.Value = 0;
|
||||||
|
currentTimingPoint.Value = 0;
|
||||||
|
beatCount.Value = 0;
|
||||||
|
currentBeat.Value = 0;
|
||||||
|
beatsPerMinute.Value = 0;
|
||||||
|
adjustedBeatLength.Value = 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private SortedList<TimingControlPoint> timingPoints => Beatmap.Value.Beatmap.ControlPointInfo.TimingPoints;
|
||||||
|
private TimingControlPoint getNextTimingPoint(TimingControlPoint current)
|
||||||
|
{
|
||||||
|
if (timingPoints[timingPoints.Count - 1] == current)
|
||||||
|
return current;
|
||||||
|
|
||||||
|
return timingPoints[timingPoints.IndexOf(current) + 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
private int calculateBeatCount(TimingControlPoint current)
|
||||||
|
{
|
||||||
|
if (timingPoints[timingPoints.Count - 1] == current)
|
||||||
|
return (int)Math.Ceiling((Beatmap.Value.Track.Length - current.Time) / current.BeatLength);
|
||||||
|
|
||||||
|
return (int)Math.Ceiling((getNextTimingPoint(current).Time - current.Time) / current.BeatLength);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
|
||||||
|
{
|
||||||
|
base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);
|
||||||
|
|
||||||
|
timingPointCount.Value = timingPoints.Count;
|
||||||
|
currentTimingPoint.Value = timingPoints.IndexOf(timingPoint);
|
||||||
|
beatCount.Value = calculateBeatCount(timingPoint);
|
||||||
|
currentBeat.Value = beatIndex;
|
||||||
|
beatsPerMinute.Value = 60000 / timingPoint.BeatLength;
|
||||||
|
adjustedBeatLength.Value = timingPoint.BeatLength;
|
||||||
|
|
||||||
|
flashLayer.ClearTransforms();
|
||||||
|
flashLayer.FadeTo(1);
|
||||||
|
flashLayer.FadeTo(0, timingPoint.BeatLength);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class InfoString : FillFlowContainer
|
||||||
|
{
|
||||||
|
private const int text_size = 20;
|
||||||
|
private const int margin = 7;
|
||||||
|
|
||||||
|
private readonly OsuSpriteText valueText;
|
||||||
|
|
||||||
|
public double Value
|
||||||
|
{
|
||||||
|
set { valueText.Text = $"{value:G}"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public InfoString(string header)
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both;
|
||||||
|
Direction = FillDirection.Horizontal;
|
||||||
|
Add(new OsuSpriteText { Text = header + @": ", TextSize = text_size });
|
||||||
|
Add(valueText = new OsuSpriteText() { TextSize = text_size });
|
||||||
|
Margin = new MarginPadding(margin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -12,10 +12,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Beatmap details in song select";
|
public override string Description => @"Beatmap details in song select";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseBeatmapDetailArea()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(new BeatmapDetailArea
|
Add(new BeatmapDetailArea
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
|
@ -13,12 +13,10 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => "BeatmapDetails tab of BeatmapDetailArea";
|
public override string Description => "BeatmapDetails tab of BeatmapDetailArea";
|
||||||
|
|
||||||
private BeatmapDetails details;
|
private readonly BeatmapDetails details;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseBeatmapDetails()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(details = new BeatmapDetails
|
Add(details = new BeatmapDetails
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
@ -13,10 +13,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Beatmap options in song select";
|
public override string Description => @"Beatmap options in song select";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseBeatmapOptionsOverlay()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
var overlay = new BeatmapOptionsOverlay();
|
var overlay = new BeatmapOptionsOverlay();
|
||||||
|
|
||||||
overlay.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, Color4.Purple, null, Key.Number1);
|
overlay.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, Color4.Purple, null, Key.Number1);
|
||||||
|
@ -11,10 +11,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"breadcrumb > control";
|
public override string Description => @"breadcrumb > control";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseBreadcrumbs()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
BreadcrumbControl<BreadcrumbTab> c;
|
BreadcrumbControl<BreadcrumbTab> c;
|
||||||
Add(c = new BreadcrumbControl<BreadcrumbTab>
|
Add(c = new BreadcrumbControl<BreadcrumbTab>
|
||||||
{
|
{
|
||||||
|
@ -11,10 +11,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Testing chat api and overlay";
|
public override string Description => @"Testing chat api and overlay";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseChatDisplay()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(new ChatOverlay
|
Add(new ChatOverlay
|
||||||
{
|
{
|
||||||
State = Visibility.Visible
|
State = Visibility.Visible
|
||||||
|
@ -21,11 +21,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
private const int start_time = 0;
|
private const int start_time = 0;
|
||||||
private const int duration = 1000;
|
private const int duration = 1000;
|
||||||
|
|
||||||
private MyContextMenuContainer container;
|
public TestCaseContextMenu()
|
||||||
|
|
||||||
public override void Reset()
|
|
||||||
{
|
{
|
||||||
base.Reset();
|
MyContextMenuContainer container;
|
||||||
|
|
||||||
Add(container = new MyContextMenuContainer
|
Add(container = new MyContextMenuContainer
|
||||||
{
|
{
|
||||||
|
@ -12,11 +12,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Display dialogs";
|
public override string Description => @"Display dialogs";
|
||||||
|
|
||||||
private DialogOverlay overlay;
|
public TestCaseDialogOverlay()
|
||||||
|
|
||||||
public override void Reset()
|
|
||||||
{
|
{
|
||||||
base.Reset();
|
DialogOverlay overlay;
|
||||||
|
|
||||||
Add(overlay = new DialogOverlay());
|
Add(overlay = new DialogOverlay());
|
||||||
|
|
||||||
|
@ -16,9 +16,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
private DirectOverlay direct;
|
private DirectOverlay direct;
|
||||||
private RulesetDatabase rulesets;
|
private RulesetDatabase rulesets;
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
Add(direct = new DirectOverlay());
|
Add(direct = new DirectOverlay());
|
||||||
newBeatmaps();
|
newBeatmaps();
|
||||||
|
@ -15,9 +15,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Select your favourite room";
|
public override string Description => @"Select your favourite room";
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
DrawableRoom first;
|
DrawableRoom first;
|
||||||
DrawableRoom second;
|
DrawableRoom second;
|
||||||
|
@ -12,10 +12,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => "Tournament drawings";
|
public override string Description => "Tournament drawings";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseDrawings()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(new Drawings
|
Add(new Drawings
|
||||||
{
|
{
|
||||||
TeamList = new TestTeamList(),
|
TeamList = new TestTeamList(),
|
||||||
|
@ -34,9 +34,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
this.rulesets = rulesets;
|
this.rulesets = rulesets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
List<HitObject> objects = new List<HitObject>();
|
List<HitObject> objects = new List<HitObject>();
|
||||||
|
|
||||||
|
@ -13,11 +13,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => "graph";
|
public override string Description => "graph";
|
||||||
|
|
||||||
private BarGraph graph;
|
public TestCaseGraph()
|
||||||
|
|
||||||
public override void Reset()
|
|
||||||
{
|
{
|
||||||
base.Reset();
|
BarGraph graph;
|
||||||
|
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
|
@ -29,15 +29,58 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
var rateAdjustClock = new StopwatchClock(true);
|
var rateAdjustClock = new StopwatchClock(true);
|
||||||
framedClock = new FramedClock(rateAdjustClock);
|
framedClock = new FramedClock(rateAdjustClock);
|
||||||
playbackSpeed.ValueChanged += delegate { rateAdjustClock.Rate = playbackSpeed.Value; };
|
playbackSpeed.ValueChanged += delegate { rateAdjustClock.Rate = playbackSpeed.Value; };
|
||||||
|
|
||||||
|
playbackSpeed.TriggerChange();
|
||||||
|
|
||||||
|
AddStep(@"circles", () => loadHitobjects(HitObjectType.Circle));
|
||||||
|
AddStep(@"slider", () => loadHitobjects(HitObjectType.Slider));
|
||||||
|
AddStep(@"spinner", () => loadHitobjects(HitObjectType.Spinner));
|
||||||
|
|
||||||
|
AddToggleStep(@"auto", state => { auto = state; loadHitobjects(mode); });
|
||||||
|
|
||||||
|
BasicSliderBar<double> sliderBar;
|
||||||
|
Add(new Container
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopRight,
|
||||||
|
Origin = Anchor.TopRight,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new SpriteText { Text = "Playback Speed" },
|
||||||
|
sliderBar = new BasicSliderBar<double>
|
||||||
|
{
|
||||||
|
Width = 150,
|
||||||
|
Height = 10,
|
||||||
|
SelectionColor = Color4.Orange,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
sliderBar.Current.BindTo(playbackSpeed);
|
||||||
|
|
||||||
|
framedClock.ProcessFrame();
|
||||||
|
|
||||||
|
var clockAdjustContainer = new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Clock = framedClock,
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
playfieldContainer = new Container { RelativeSizeAxes = Axes.Both },
|
||||||
|
approachContainer = new Container { RelativeSizeAxes = Axes.Both }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Add(clockAdjustContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
private HitObjectType mode = HitObjectType.Slider;
|
private HitObjectType mode = HitObjectType.Slider;
|
||||||
|
|
||||||
private readonly BindableNumber<double> playbackSpeed = new BindableDouble(0.5) { MinValue = 0, MaxValue = 1 };
|
private readonly BindableNumber<double> playbackSpeed = new BindableDouble(0.5) { MinValue = 0, MaxValue = 1 };
|
||||||
private Container playfieldContainer;
|
private readonly Container playfieldContainer;
|
||||||
private Container approachContainer;
|
private readonly Container approachContainer;
|
||||||
|
|
||||||
private void load(HitObjectType mode)
|
private void loadHitobjects(HitObjectType mode)
|
||||||
{
|
{
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
|
|
||||||
@ -83,54 +126,6 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Reset()
|
|
||||||
{
|
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
playbackSpeed.TriggerChange();
|
|
||||||
|
|
||||||
AddStep(@"circles", () => load(HitObjectType.Circle));
|
|
||||||
AddStep(@"slider", () => load(HitObjectType.Slider));
|
|
||||||
AddStep(@"spinner", () => load(HitObjectType.Spinner));
|
|
||||||
|
|
||||||
AddToggleStep(@"auto", state => { auto = state; load(mode); });
|
|
||||||
|
|
||||||
BasicSliderBar<double> sliderBar;
|
|
||||||
Add(new Container
|
|
||||||
{
|
|
||||||
Anchor = Anchor.TopRight,
|
|
||||||
Origin = Anchor.TopRight,
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new SpriteText { Text = "Playback Speed" },
|
|
||||||
sliderBar = new BasicSliderBar<double>
|
|
||||||
{
|
|
||||||
Width = 150,
|
|
||||||
Height = 10,
|
|
||||||
SelectionColor = Color4.Orange,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
sliderBar.Current.BindTo(playbackSpeed);
|
|
||||||
|
|
||||||
framedClock.ProcessFrame();
|
|
||||||
|
|
||||||
var clockAdjustContainer = new Container
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Clock = framedClock,
|
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
playfieldContainer = new Container { RelativeSizeAxes = Axes.Both },
|
|
||||||
approachContainer = new Container { RelativeSizeAxes = Axes.Both }
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Add(clockAdjustContainer);
|
|
||||||
}
|
|
||||||
|
|
||||||
private int depth;
|
private int depth;
|
||||||
|
|
||||||
private void add(DrawableOsuHitObject h)
|
private void add(DrawableOsuHitObject h)
|
||||||
|
@ -20,10 +20,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Tests key counter";
|
public override string Description => @"Tests key counter";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseKeyCounter()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
KeyCounterCollection kc = new KeyCounterCollection
|
KeyCounterCollection kc = new KeyCounterCollection
|
||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"From song select";
|
public override string Description => @"From song select";
|
||||||
|
|
||||||
private Leaderboard leaderboard;
|
private readonly Leaderboard leaderboard;
|
||||||
|
|
||||||
private void newScores()
|
private void newScores()
|
||||||
{
|
{
|
||||||
@ -207,10 +207,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
leaderboard.Scores = scores;
|
leaderboard.Scores = scores;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseLeaderboard()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(leaderboard = new Leaderboard
|
Add(leaderboard = new Leaderboard
|
||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
@ -13,10 +13,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
internal class TestCaseManiaHitObjects : TestCase
|
internal class TestCaseManiaHitObjects : TestCase
|
||||||
{
|
{
|
||||||
public override void Reset()
|
public TestCaseManiaHitObjects()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(new FillFlowContainer
|
Add(new FillFlowContainer
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
|
@ -25,10 +25,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
protected override double TimePerAction => 200;
|
protected override double TimePerAction => 200;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseManiaPlayfield()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Action<int, SpecialColumnPosition> createPlayfield = (cols, pos) =>
|
Action<int, SpecialColumnPosition> createPlayfield = (cols, pos) =>
|
||||||
{
|
{
|
||||||
Clear();
|
Clear();
|
||||||
|
@ -13,10 +13,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Main menu button system";
|
public override string Description => @"Main menu button system";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseMenuButtonSystem()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(new Box
|
Add(new Box
|
||||||
{
|
{
|
||||||
ColourInfo = ColourInfo.GradientVertical(Color4.Gray, Color4.WhiteSmoke),
|
ColourInfo = ColourInfo.GradientVertical(Color4.Gray, Color4.WhiteSmoke),
|
||||||
|
@ -12,15 +12,12 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Tests pause and fail overlays";
|
public override string Description => @"Tests pause and fail overlays";
|
||||||
|
|
||||||
private PauseContainer.PauseOverlay pauseOverlay;
|
public TestCaseMenuOverlays()
|
||||||
private FailOverlay failOverlay;
|
|
||||||
private int retryCount;
|
|
||||||
|
|
||||||
public override void Reset()
|
|
||||||
{
|
{
|
||||||
base.Reset();
|
FailOverlay failOverlay;
|
||||||
|
PauseContainer.PauseOverlay pauseOverlay;
|
||||||
|
|
||||||
retryCount = 0;
|
var retryCount = 0;
|
||||||
|
|
||||||
Add(pauseOverlay = new PauseContainer.PauseOverlay
|
Add(pauseOverlay = new PauseContainer.PauseOverlay
|
||||||
{
|
{
|
||||||
@ -34,14 +31,16 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
OnQuit = () => Logger.Log(@"Quit"),
|
OnQuit = () => Logger.Log(@"Quit"),
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep(@"Pause", delegate {
|
AddStep(@"Pause", delegate
|
||||||
|
{
|
||||||
if (failOverlay.State == Visibility.Visible)
|
if (failOverlay.State == Visibility.Visible)
|
||||||
{
|
{
|
||||||
failOverlay.Hide();
|
failOverlay.Hide();
|
||||||
}
|
}
|
||||||
pauseOverlay.Show();
|
pauseOverlay.Show();
|
||||||
});
|
});
|
||||||
AddStep("Fail", delegate {
|
AddStep("Fail", delegate
|
||||||
|
{
|
||||||
if (pauseOverlay.State == Visibility.Visible)
|
if (pauseOverlay.State == Visibility.Visible)
|
||||||
{
|
{
|
||||||
pauseOverlay.Hide();
|
pauseOverlay.Hide();
|
||||||
|
@ -27,9 +27,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
this.rulesets = rulesets;
|
this.rulesets = rulesets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
Add(modSelect = new ModSelectOverlay
|
Add(modSelect = new ModSelectOverlay
|
||||||
{
|
{
|
||||||
|
@ -13,18 +13,11 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Tests music controller ui.";
|
public override string Description => @"Tests music controller ui.";
|
||||||
|
|
||||||
private MusicController mc;
|
|
||||||
|
|
||||||
public TestCaseMusicController()
|
public TestCaseMusicController()
|
||||||
{
|
{
|
||||||
Clock = new FramedClock();
|
Clock = new FramedClock();
|
||||||
}
|
|
||||||
|
|
||||||
public override void Reset()
|
var mc = new MusicController
|
||||||
{
|
|
||||||
base.Reset();
|
|
||||||
Clock.ProcessFrame();
|
|
||||||
mc = new MusicController
|
|
||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre
|
Anchor = Anchor.Centre
|
||||||
|
@ -16,12 +16,10 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"I handle notifications";
|
public override string Description => @"I handle notifications";
|
||||||
|
|
||||||
private NotificationManager manager;
|
private readonly NotificationManager manager;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseNotificationManager()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
progressingNotifications.Clear();
|
progressingNotifications.Clear();
|
||||||
|
|
||||||
Content.Add(manager = new NotificationManager
|
Content.Add(manager = new NotificationManager
|
||||||
|
@ -15,9 +15,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
public override string Description => @"Make it easier to see setting changes";
|
public override string Description => @"Make it easier to see setting changes";
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
Add(new OnScreenDisplay());
|
Add(new OnScreenDisplay());
|
||||||
|
|
||||||
|
@ -13,20 +13,19 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
internal class TestCasePlaySongSelect : TestCase
|
internal class TestCasePlaySongSelect : TestCase
|
||||||
{
|
{
|
||||||
private BeatmapDatabase db;
|
private readonly BeatmapDatabase db;
|
||||||
private TestStorage storage;
|
|
||||||
private PlaySongSelect songSelect;
|
|
||||||
|
|
||||||
public override string Description => @"with fake data";
|
public override string Description => @"with fake data";
|
||||||
|
|
||||||
private RulesetDatabase rulesets;
|
private readonly RulesetDatabase rulesets;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCasePlaySongSelect()
|
||||||
{
|
{
|
||||||
base.Reset();
|
PlaySongSelect songSelect;
|
||||||
|
|
||||||
if (db == null)
|
if (db == null)
|
||||||
{
|
{
|
||||||
storage = new TestStorage(@"TestCasePlaySongSelect");
|
var storage = new TestStorage(@"TestCasePlaySongSelect");
|
||||||
|
|
||||||
var backingDatabase = storage.GetDatabase(@"client");
|
var backingDatabase = storage.GetDatabase(@"client");
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// 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 System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
@ -21,65 +20,54 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
internal class TestCasePlayer : TestCase
|
internal class TestCasePlayer : TestCase
|
||||||
{
|
{
|
||||||
protected Player Player;
|
protected Player Player;
|
||||||
private BeatmapDatabase db;
|
|
||||||
private RulesetDatabase rulesets;
|
private RulesetDatabase rulesets;
|
||||||
|
|
||||||
public override string Description => @"Showing everything to play the game.";
|
public override string Description => @"Showing everything to play the game.";
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(BeatmapDatabase db, RulesetDatabase rulesets)
|
private void load(RulesetDatabase rulesets)
|
||||||
{
|
{
|
||||||
this.rulesets = rulesets;
|
this.rulesets = rulesets;
|
||||||
this.db = db;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
WorkingBeatmap beatmap = null;
|
var objects = new List<HitObject>();
|
||||||
|
|
||||||
var beatmapInfo = db.Query<BeatmapInfo>().FirstOrDefault(b => b.RulesetID == 0);
|
int time = 1500;
|
||||||
if (beatmapInfo != null)
|
for (int i = 0; i < 50; i++)
|
||||||
beatmap = db.GetWorkingBeatmap(beatmapInfo);
|
|
||||||
|
|
||||||
if (beatmap?.Track == null)
|
|
||||||
{
|
{
|
||||||
var objects = new List<HitObject>();
|
objects.Add(new HitCircle
|
||||||
|
|
||||||
int time = 1500;
|
|
||||||
for (int i = 0; i < 50; i++)
|
|
||||||
{
|
{
|
||||||
objects.Add(new HitCircle
|
StartTime = time,
|
||||||
{
|
Position = new Vector2(i % 4 == 0 || i % 4 == 2 ? 0 : OsuPlayfield.BASE_SIZE.X,
|
||||||
StartTime = time,
|
i % 4 < 2 ? 0 : OsuPlayfield.BASE_SIZE.Y),
|
||||||
Position = new Vector2(i % 4 == 0 || i % 4 == 2 ? 0 : OsuPlayfield.BASE_SIZE.X,
|
NewCombo = i % 4 == 0
|
||||||
i % 4 < 2 ? 0 : OsuPlayfield.BASE_SIZE.Y),
|
});
|
||||||
NewCombo = i % 4 == 0
|
|
||||||
});
|
|
||||||
|
|
||||||
time += 500;
|
time += 500;
|
||||||
}
|
|
||||||
|
|
||||||
Beatmap b = new Beatmap
|
|
||||||
{
|
|
||||||
HitObjects = objects,
|
|
||||||
BeatmapInfo = new BeatmapInfo
|
|
||||||
{
|
|
||||||
Difficulty = new BeatmapDifficulty(),
|
|
||||||
Ruleset = rulesets.Query<RulesetInfo>().First(),
|
|
||||||
Metadata = new BeatmapMetadata
|
|
||||||
{
|
|
||||||
Artist = @"Unknown",
|
|
||||||
Title = @"Sample Beatmap",
|
|
||||||
Author = @"peppy",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
beatmap = new TestWorkingBeatmap(b);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Beatmap b = new Beatmap
|
||||||
|
{
|
||||||
|
HitObjects = objects,
|
||||||
|
BeatmapInfo = new BeatmapInfo
|
||||||
|
{
|
||||||
|
Difficulty = new BeatmapDifficulty(),
|
||||||
|
Ruleset = rulesets.Query<RulesetInfo>().First(),
|
||||||
|
Metadata = new BeatmapMetadata
|
||||||
|
{
|
||||||
|
Artist = @"Unknown",
|
||||||
|
Title = @"Sample Beatmap",
|
||||||
|
Author = @"peppy",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
WorkingBeatmap beatmap = new TestWorkingBeatmap(b);
|
||||||
|
|
||||||
Add(new Box
|
Add(new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Framework.Graphics.Axes.Both,
|
RelativeSizeAxes = Framework.Graphics.Axes.Both,
|
||||||
|
@ -13,13 +13,11 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Settings visible in replay/auto";
|
public override string Description => @"Settings visible in replay/auto";
|
||||||
|
|
||||||
private ExampleContainer container;
|
public TestCaseReplaySettingsOverlay()
|
||||||
|
|
||||||
public override void Reset()
|
|
||||||
{
|
{
|
||||||
base.Reset();
|
ExampleContainer container;
|
||||||
|
|
||||||
Add(new ReplaySettingsOverlay()
|
Add(new ReplaySettingsOverlay
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
|
@ -28,9 +28,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private WorkingBeatmap beatmap;
|
private WorkingBeatmap beatmap;
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
if (beatmap == null)
|
if (beatmap == null)
|
||||||
{
|
{
|
||||||
@ -39,8 +39,6 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
beatmap = db.GetWorkingBeatmap(beatmapInfo);
|
beatmap = db.GetWorkingBeatmap(beatmapInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(new Results(new Score
|
Add(new Results(new Score
|
||||||
{
|
{
|
||||||
TotalScore = 2845370,
|
TotalScore = 2845370,
|
||||||
|
@ -17,9 +17,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private RulesetDatabase rulesets;
|
private RulesetDatabase rulesets;
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
var room = new Room
|
var room = new Room
|
||||||
{
|
{
|
||||||
|
@ -15,10 +15,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Tests multiple counters";
|
public override string Description => @"Tests multiple counters";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseScoreCounter()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
int numerator = 0, denominator = 0;
|
int numerator = 0, denominator = 0;
|
||||||
|
|
||||||
ScoreCounter score = new ScoreCounter(7)
|
ScoreCounter score = new ScoreCounter(7)
|
||||||
|
@ -21,16 +21,15 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => "SpeedAdjustmentContainer/DrawableTimingSection";
|
public override string Description => "SpeedAdjustmentContainer/DrawableTimingSection";
|
||||||
|
|
||||||
private SpeedAdjustmentCollection adjustmentCollection;
|
private readonly BindableDouble timeRangeBindable;
|
||||||
|
private readonly OsuSpriteText bottomLabel;
|
||||||
|
private readonly SpriteText topTime;
|
||||||
|
private readonly SpriteText bottomTime;
|
||||||
|
|
||||||
private BindableDouble timeRangeBindable;
|
public TestCaseScrollingHitObjects()
|
||||||
private OsuSpriteText timeRangeText;
|
|
||||||
private OsuSpriteText bottomLabel;
|
|
||||||
private SpriteText topTime, bottomTime;
|
|
||||||
|
|
||||||
public override void Reset()
|
|
||||||
{
|
{
|
||||||
base.Reset();
|
OsuSpriteText timeRangeText;
|
||||||
|
SpeedAdjustmentCollection adjustmentCollection;
|
||||||
|
|
||||||
timeRangeBindable = new BindableDouble(2000)
|
timeRangeBindable = new BindableDouble(2000)
|
||||||
{
|
{
|
||||||
|
@ -10,13 +10,16 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Tests the settings overlay";
|
public override string Description => @"Tests the settings overlay";
|
||||||
|
|
||||||
private SettingsOverlay settings;
|
private readonly SettingsOverlay settings;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseSettings()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Children = new[] { settings = new SettingsOverlay() };
|
Children = new[] { settings = new SettingsOverlay() };
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
settings.ToggleVisibility();
|
settings.ToggleVisibility();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,9 +10,10 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Skip skip skippediskip";
|
public override string Description => @"Skip skip skippediskip";
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
Add(new SkipButton(Clock.CurrentTime + 5000));
|
Add(new SkipButton(Clock.CurrentTime + 5000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"social browser overlay";
|
public override string Description => @"social browser overlay";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseSocial()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
SocialOverlay s = new SocialOverlay
|
SocialOverlay s = new SocialOverlay
|
||||||
{
|
{
|
||||||
Users = new[]
|
Users = new[]
|
||||||
|
@ -15,15 +15,13 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"With fake data";
|
public override string Description => @"With fake data";
|
||||||
|
|
||||||
private SongProgress progress;
|
private readonly SongProgress progress;
|
||||||
private SongProgressGraph graph;
|
private readonly SongProgressGraph graph;
|
||||||
|
|
||||||
private StopwatchClock clock;
|
private readonly StopwatchClock clock;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseSongProgress()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
clock = new StopwatchClock(true);
|
clock = new StopwatchClock(true);
|
||||||
|
|
||||||
Add(progress = new SongProgress
|
Add(progress = new SongProgress
|
||||||
|
@ -14,10 +14,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Filter for song select";
|
public override string Description => @"Filter for song select";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseTabControl()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
OsuSpriteText text;
|
OsuSpriteText text;
|
||||||
OsuTabControl<GroupMode> filter;
|
OsuTabControl<GroupMode> filter;
|
||||||
Add(filter = new OsuTabControl<GroupMode>
|
Add(filter = new OsuTabControl<GroupMode>
|
||||||
|
@ -16,10 +16,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private bool kiai;
|
private bool kiai;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseTaikoHitObjects()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
AddToggleStep("Kiai", b =>
|
AddToggleStep("Kiai", b =>
|
||||||
{
|
{
|
||||||
kiai = !kiai;
|
kiai = !kiai;
|
||||||
|
@ -26,13 +26,11 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
protected override double TimePerAction => default_duration * 2;
|
protected override double TimePerAction => default_duration * 2;
|
||||||
|
|
||||||
private readonly Random rng = new Random(1337);
|
private readonly Random rng = new Random(1337);
|
||||||
private TaikoPlayfield playfield;
|
private readonly TaikoPlayfield playfield;
|
||||||
private Container playfieldContainer;
|
private readonly Container playfieldContainer;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseTaikoPlayfield()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
AddStep("Hit!", addHitJudgement);
|
AddStep("Hit!", addHitJudgement);
|
||||||
AddStep("Miss :(", addMissJudgement);
|
AddStep("Miss :(", addMissJudgement);
|
||||||
AddStep("DrumRoll", () => addDrumRoll(false));
|
AddStep("DrumRoll", () => addDrumRoll(false));
|
||||||
|
@ -16,10 +16,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Tests display of icons";
|
public override string Description => @"Tests display of icons";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseTextAwesome()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
FillFlowContainer flow;
|
FillFlowContainer flow;
|
||||||
|
|
||||||
Add(flow = new FillFlowContainer
|
Add(flow = new FillFlowContainer
|
||||||
|
@ -10,10 +10,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Mostly back button";
|
public override string Description => @"Mostly back button";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseTwoLayerButton()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(new BackButton());
|
Add(new BackButton());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,10 +13,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Panels for displaying a user's status";
|
public override string Description => @"Panels for displaying a user's status";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseUserPanel()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
UserPanel flyte;
|
UserPanel flyte;
|
||||||
UserPanel peppy;
|
UserPanel peppy;
|
||||||
Add(new FillFlowContainer
|
Add(new FillFlowContainer
|
||||||
|
@ -187,6 +187,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="AutomatedVisualTestGame.cs" />
|
<Compile Include="AutomatedVisualTestGame.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Tests\TestCaseBeatSyncedContainer.cs" />
|
||||||
<Compile Include="Tests\TestCaseChatDisplay.cs" />
|
<Compile Include="Tests\TestCaseChatDisplay.cs" />
|
||||||
<Compile Include="Tests\TestCaseBeatmapDetails.cs" />
|
<Compile Include="Tests\TestCaseBeatmapDetails.cs" />
|
||||||
<Compile Include="Tests\TestCaseContextMenu.cs" />
|
<Compile Include="Tests\TestCaseContextMenu.cs" />
|
||||||
|
@ -11,6 +11,7 @@ using System.Reflection;
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Screens.Menu;
|
using osu.Game.Screens.Menu;
|
||||||
|
|
||||||
namespace osu.Desktop
|
namespace osu.Desktop
|
||||||
@ -22,18 +23,22 @@ namespace osu.Desktop
|
|||||||
public OsuGameDesktop(string[] args = null)
|
public OsuGameDesktop(string[] args = null)
|
||||||
: base(args)
|
: base(args)
|
||||||
{
|
{
|
||||||
versionManager = new VersionManager { Depth = int.MinValue };
|
versionManager = new VersionManager
|
||||||
|
{
|
||||||
|
Depth = int.MinValue,
|
||||||
|
State = Visibility.Hidden
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
LoadComponentAsync(versionManager);
|
LoadComponentAsync(versionManager, Add);
|
||||||
ScreenChanged += s =>
|
ScreenChanged += s =>
|
||||||
{
|
{
|
||||||
if (!versionManager.IsAlive && s is Intro)
|
if (!versionManager.IsPresent && s is Intro)
|
||||||
Add(versionManager);
|
versionManager.State = Visibility.Visible;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,12 +93,6 @@ namespace osu.Desktop.Overlays
|
|||||||
checkForUpdateAsync();
|
checkForUpdateAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
|
||||||
{
|
|
||||||
base.LoadComplete();
|
|
||||||
State = Visibility.Visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
{
|
{
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
|
@ -118,7 +118,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
if (Time.Current < slider.EndTime)
|
if (Time.Current < slider.EndTime)
|
||||||
Tracking = canCurrentlyTrack && lastState != null && Contains(lastState.Mouse.NativeState.Position) && lastState.Mouse.HasMainButtonPressed;
|
Tracking = canCurrentlyTrack && lastState != null && ReceiveMouseInputAt(lastState.Mouse.NativeState.Position) && lastState.Mouse.HasMainButtonPressed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateProgress(double progress, int repeat)
|
public void UpdateProgress(double progress, int repeat)
|
||||||
|
@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => true;
|
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true;
|
||||||
|
|
||||||
private bool tracking;
|
private bool tracking;
|
||||||
public bool Tracking
|
public bool Tracking
|
||||||
|
@ -93,6 +93,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
{
|
{
|
||||||
new BeatmapBackgroundSprite(working)
|
new BeatmapBackgroundSprite(working)
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
|
@ -26,6 +26,7 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
|
|
||||||
Add(Sprite = new Sprite
|
Add(Sprite = new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Colour = Color4.DarkGray,
|
Colour = Color4.DarkGray,
|
||||||
|
@ -74,7 +74,7 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => true;
|
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(ShaderManager shaders, TextureStore textures)
|
private void load(ShaderManager shaders, TextureStore textures)
|
||||||
|
@ -10,9 +10,5 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
public class OsuContextMenuContainer : ContextMenuContainer
|
public class OsuContextMenuContainer : ContextMenuContainer
|
||||||
{
|
{
|
||||||
protected override ContextMenu<ContextMenuItem> CreateContextMenu() => new OsuContextMenu<ContextMenuItem>();
|
protected override ContextMenu<ContextMenuItem> CreateContextMenu() => new OsuContextMenu<ContextMenuItem>();
|
||||||
|
|
||||||
public OsuContextMenuContainer(CursorContainer cursor) : base(cursor)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -15,7 +15,7 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
{
|
{
|
||||||
public class OsuTooltipContainer : TooltipContainer
|
public class OsuTooltipContainer : TooltipContainer
|
||||||
{
|
{
|
||||||
protected override Tooltip CreateTooltip() => new OsuTooltip();
|
protected override ITooltip CreateTooltip() => new OsuTooltip();
|
||||||
|
|
||||||
public OsuTooltipContainer(CursorContainer cursor) : base(cursor)
|
public OsuTooltipContainer(CursorContainer cursor) : base(cursor)
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
public readonly TextAwesome Chevron;
|
public readonly TextAwesome Chevron;
|
||||||
|
|
||||||
//don't allow clicking between transitions and don't make the chevron clickable
|
//don't allow clicking between transitions and don't make the chevron clickable
|
||||||
public override bool Contains(Vector2 screenSpacePos) => Alpha == 1f && Text.Contains(screenSpacePos);
|
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => Alpha == 1f && Text.ReceiveMouseInputAt(screenSpacePos);
|
||||||
public override bool HandleInput => State == Visibility.Visible;
|
public override bool HandleInput => State == Visibility.Visible;
|
||||||
|
|
||||||
private Visibility state;
|
private Visibility state;
|
||||||
|
@ -91,7 +91,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
private bool didClick; // Used for making sure that the OnMouseDown animation can call instead of OnHoverLost's when clicking
|
private bool didClick; // Used for making sure that the OnMouseDown animation can call instead of OnHoverLost's when clicking
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => backgroundContainer.Contains(screenSpacePos);
|
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => backgroundContainer.ReceiveMouseInputAt(screenSpacePos);
|
||||||
|
|
||||||
protected override bool OnClick(Framework.Input.InputState state)
|
protected override bool OnClick(Framework.Input.InputState state)
|
||||||
{
|
{
|
||||||
|
@ -23,8 +23,6 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
protected override TabItem<T> CreateTabItem(T value) => new OsuTabItem(value);
|
protected override TabItem<T> CreateTabItem(T value) => new OsuTabItem(value);
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => base.Contains(screenSpacePos) || Dropdown?.Contains(screenSpacePos) == true;
|
|
||||||
|
|
||||||
private static bool isEnumType => typeof(T).IsEnum;
|
private static bool isEnumType => typeof(T).IsEnum;
|
||||||
|
|
||||||
public OsuTabControl()
|
public OsuTabControl()
|
||||||
|
@ -169,7 +169,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => IconLayer.Contains(screenSpacePos) || TextLayer.Contains(screenSpacePos);
|
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => IconLayer.ReceiveMouseInputAt(screenSpacePos) || TextLayer.ReceiveMouseInputAt(screenSpacePos);
|
||||||
|
|
||||||
protected override bool OnHover(InputState state)
|
protected override bool OnHover(InputState state)
|
||||||
{
|
{
|
||||||
|
@ -37,9 +37,9 @@ namespace osu.Game
|
|||||||
|
|
||||||
public APIAccess API;
|
public APIAccess API;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => ratioContainer;
|
private Container content;
|
||||||
|
|
||||||
private RatioAdjust ratioContainer;
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
protected MenuCursor Cursor;
|
protected MenuCursor Cursor;
|
||||||
|
|
||||||
@ -146,21 +146,19 @@ namespace osu.Game
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
base.Content.Add(ratioContainer = new RatioAdjust
|
base.Content.Add(new RatioAdjust
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Container
|
Cursor = new MenuCursor(),
|
||||||
|
new OsuTooltipContainer(Cursor)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Depth = float.MinValue,
|
Child = content = new OsuContextMenuContainer
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
{
|
||||||
Cursor = new MenuCursor(),
|
RelativeSizeAxes = Axes.Both,
|
||||||
new OsuContextMenuContainer(Cursor) { Depth = -2 },
|
},
|
||||||
new OsuTooltipContainer(Cursor) { Depth = -1 },
|
}
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ namespace osu.Game.Overlays
|
|||||||
private readonly Container channelSelectionContainer;
|
private readonly Container channelSelectionContainer;
|
||||||
private readonly ChannelSelectionOverlay channelSelection;
|
private readonly ChannelSelectionOverlay channelSelection;
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => chatContainer.Contains(screenSpacePos) || channelSelection.State == Visibility.Visible && channelSelection.Contains(screenSpacePos);
|
public override bool Contains(Vector2 screenSpacePos) => chatContainer.ReceiveMouseInputAt(screenSpacePos) || channelSelection.State == Visibility.Visible && channelSelection.ReceiveMouseInputAt(screenSpacePos);
|
||||||
|
|
||||||
public ChatOverlay()
|
public ChatOverlay()
|
||||||
{
|
{
|
||||||
@ -194,7 +194,7 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
protected override bool OnDragStart(InputState state)
|
protected override bool OnDragStart(InputState state)
|
||||||
{
|
{
|
||||||
if (!channelTabs.Hovering)
|
if (!channelTabs.IsHovered)
|
||||||
return base.OnDragStart(state);
|
return base.OnDragStart(state);
|
||||||
|
|
||||||
startDragChatHeight = chatHeight.Value;
|
startDragChatHeight = chatHeight.Value;
|
||||||
|
@ -38,6 +38,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
{
|
{
|
||||||
return new AsyncLoadWrapper(new BeatmapBackgroundSprite(new OnlineWorkingBeatmap(SetInfo.Beatmaps.FirstOrDefault(), textures, null))
|
return new AsyncLoadWrapper(new BeatmapBackgroundSprite(new OnlineWorkingBeatmap(SetInfo.Beatmaps.FirstOrDefault(), textures, null))
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
OnLoadComplete = d => d.FadeInFromZero(400, EasingTypes.Out),
|
OnLoadComplete = d => d.FadeInFromZero(400, EasingTypes.Out),
|
||||||
}) { RelativeSizeAxes = Axes.Both };
|
}) { RelativeSizeAxes = Axes.Both };
|
||||||
|
@ -151,8 +151,8 @@ namespace osu.Game.Overlays.Mods
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio)
|
private void load(AudioManager audio)
|
||||||
{
|
{
|
||||||
sampleOn = audio.Sample.Get(@"Checkbox/check-on");
|
sampleOn = audio.Sample.Get(@"UI/check-on");
|
||||||
sampleOff = audio.Sample.Get(@"Checkbox/check-off");
|
sampleOff = audio.Sample.Get(@"UI/check-off");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
||||||
@ -171,7 +171,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
|
|
||||||
public void SelectNext()
|
public void SelectNext()
|
||||||
{
|
{
|
||||||
(++SelectedIndex == -1 ? sampleOff : sampleOn).Play();
|
(++SelectedIndex == Mods.Length ? sampleOff : sampleOn).Play();
|
||||||
Action?.Invoke(SelectedMod);
|
Action?.Invoke(SelectedMod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,6 +398,7 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
sprite = new Sprite
|
sprite = new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = OsuColour.Gray(150),
|
Colour = OsuColour.Gray(150),
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
},
|
},
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// 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 System;
|
using System;
|
||||||
using OpenTK;
|
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
@ -29,8 +28,6 @@ namespace osu.Game.Overlays.SearchableList
|
|||||||
protected abstract T DefaultTab { get; }
|
protected abstract T DefaultTab { get; }
|
||||||
protected virtual Drawable CreateSupplementaryControls() => null;
|
protected virtual Drawable CreateSupplementaryControls() => null;
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => base.Contains(screenSpacePos) || DisplayStyleControl.Dropdown.Contains(screenSpacePos);
|
|
||||||
|
|
||||||
protected SearchableListFilterControl()
|
protected SearchableListFilterControl()
|
||||||
{
|
{
|
||||||
if (!typeof(T).IsEnum)
|
if (!typeof(T).IsEnum)
|
||||||
|
@ -113,8 +113,11 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
{
|
{
|
||||||
base.UpdateAfterChildren();
|
base.UpdateAfterChildren();
|
||||||
|
|
||||||
if (!activeMode.EnsureValid())
|
if (!activeMode.IsValid)
|
||||||
activeMode.Refresh(() => modeButtonLine.MoveToX(activeButton.DrawPosition.X, 200, EasingTypes.OutQuint));
|
{
|
||||||
|
modeButtonLine.MoveToX(activeButton.DrawPosition.X, 200, EasingTypes.OutQuint);
|
||||||
|
activeMode.Validate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,14 +80,9 @@ namespace osu.Game.Rulesets.Timing
|
|||||||
base.InvalidateFromChild(invalidation);
|
base.InvalidateFromChild(invalidation);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Cached<double> durationBacking = new Cached<double>();
|
private Cached<double> durationBacking;
|
||||||
/// <summary>
|
|
||||||
/// The maximum duration of any one hit object inside this <see cref="DrawableTimingSection"/>. This is calculated as the maximum
|
private double computeDuration()
|
||||||
/// end time between all hit objects relative to this <see cref="DrawableTimingSection"/>'s <see cref="MultiplierControlPoint.StartTime"/>.
|
|
||||||
/// </summary>
|
|
||||||
public double Duration => durationBacking.EnsureValid()
|
|
||||||
? durationBacking.Value
|
|
||||||
: durationBacking.Refresh(() =>
|
|
||||||
{
|
{
|
||||||
if (!Children.Any())
|
if (!Children.Any())
|
||||||
return 0;
|
return 0;
|
||||||
@ -117,7 +112,13 @@ namespace osu.Game.Rulesets.Timing
|
|||||||
baseDuration *= 1 + maxAbsoluteSize / ourAbsoluteSize;
|
baseDuration *= 1 + maxAbsoluteSize / ourAbsoluteSize;
|
||||||
|
|
||||||
return baseDuration;
|
return baseDuration;
|
||||||
});
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The maximum duration of any one hit object inside this <see cref="DrawableTimingSection"/>. This is calculated as the maximum
|
||||||
|
/// end time between all hit objects relative to this <see cref="DrawableTimingSection"/>'s <see cref="MultiplierControlPoint.StartTime"/>.
|
||||||
|
/// </summary>
|
||||||
|
public double Duration => durationBacking.IsValid ? durationBacking : (durationBacking.Value = computeDuration());
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
|
@ -148,7 +148,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
// Check if the beatmap can be converted
|
// Check if the beatmap can be converted
|
||||||
if (!converter.CanConvert(beatmap.Beatmap))
|
if (!converter.CanConvert(beatmap.Beatmap))
|
||||||
throw new BeatmapInvalidForRulesetException($"{nameof(Beatmap)} can't be converted for the current ruleset.");
|
throw new BeatmapInvalidForRulesetException($"{nameof(Beatmap)} can not be converted for the current ruleset (converter: {converter}).");
|
||||||
|
|
||||||
// Convert the beatmap
|
// Convert the beatmap
|
||||||
Beatmap = converter.Convert(beatmap.Beatmap, isForCurrentRuleset);
|
Beatmap = converter.Convert(beatmap.Beatmap, isForCurrentRuleset);
|
||||||
|
@ -36,7 +36,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
private SampleChannel sampleClick;
|
private SampleChannel sampleClick;
|
||||||
private SampleChannel sampleHover;
|
private SampleChannel sampleHover;
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => box.Contains(screenSpacePos);
|
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => box.ReceiveMouseInputAt(screenSpacePos);
|
||||||
|
|
||||||
public Button(string text, string sampleName, FontAwesome symbol, Color4 colour, Action clickAction = null, float extraWidth = 0, Key triggerKey = Key.Unknown)
|
public Button(string text, string sampleName, FontAwesome symbol, Color4 colour, Action clickAction = null, float extraWidth = 0, Key triggerKey = Key.Unknown)
|
||||||
{
|
{
|
||||||
|
@ -57,7 +57,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
set { colourAndTriangles.Alpha = value ? 1 : 0; }
|
set { colourAndTriangles.Alpha = value ? 1 : 0; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => logoContainer.Contains(screenSpacePos);
|
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => logoContainer.ReceiveMouseInputAt(screenSpacePos);
|
||||||
|
|
||||||
public bool Ripple
|
public bool Ripple
|
||||||
{
|
{
|
||||||
@ -236,7 +236,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
if (beatIndex < 0) return;
|
if (beatIndex < 0) return;
|
||||||
|
|
||||||
if (Hovering)
|
if (IsHovered)
|
||||||
{
|
{
|
||||||
using (BeginDelayedSequence(early_activation))
|
using (BeginDelayedSequence(early_activation))
|
||||||
Schedule(() => sampleBeat.Play());
|
Schedule(() => sampleBeat.Play());
|
||||||
|
@ -438,6 +438,7 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
{
|
{
|
||||||
new AsyncLoadWrapper(new BeatmapBackgroundSprite(new OnlineWorkingBeatmap(value, textures, null))
|
new AsyncLoadWrapper(new BeatmapBackgroundSprite(new OnlineWorkingBeatmap(value, textures, null))
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
|
@ -127,7 +127,7 @@ namespace osu.Game.Screens.Play
|
|||||||
this.target = target;
|
this.target = target;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => true;
|
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true;
|
||||||
|
|
||||||
public override bool HandleInput => true;
|
public override bool HandleInput => true;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Screens.Play
|
|||||||
Button = button;
|
Button = button;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => true;
|
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true;
|
||||||
|
|
||||||
private static string getStringRepresentation(MouseButton button)
|
private static string getStringRepresentation(MouseButton button)
|
||||||
{
|
{
|
||||||
|
@ -227,6 +227,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
new Sprite
|
new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Texture = beatmap?.Background,
|
Texture = beatmap?.Background,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
|
@ -156,7 +156,7 @@ namespace osu.Game.Screens.Play
|
|||||||
if (lastState == Visibility.Hidden)
|
if (lastState == Visibility.Hidden)
|
||||||
FadeIn(500, EasingTypes.OutExpo);
|
FadeIn(500, EasingTypes.OutExpo);
|
||||||
|
|
||||||
if (!Hovering)
|
if (!IsHovered)
|
||||||
using (BeginDelayedSequence(1000))
|
using (BeginDelayedSequence(1000))
|
||||||
scheduledHide = Schedule(() => State = Visibility.Hidden);
|
scheduledHide = Schedule(() => State = Visibility.Hidden);
|
||||||
break;
|
break;
|
||||||
|
@ -19,6 +19,10 @@ namespace osu.Game.Screens.Play
|
|||||||
objects = value;
|
objects = value;
|
||||||
|
|
||||||
const int granularity = 200;
|
const int granularity = 200;
|
||||||
|
Values = new int[granularity];
|
||||||
|
|
||||||
|
if (!objects.Any())
|
||||||
|
return;
|
||||||
|
|
||||||
var firstHit = objects.First().StartTime;
|
var firstHit = objects.First().StartTime;
|
||||||
var lastHit = (objects.Last() as IHasEndTime)?.EndTime ?? 0;
|
var lastHit = (objects.Last() as IHasEndTime)?.EndTime ?? 0;
|
||||||
@ -28,8 +32,6 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
var interval = (lastHit - firstHit + 1) / granularity;
|
var interval = (lastHit - firstHit + 1) / granularity;
|
||||||
|
|
||||||
var values = new int[granularity];
|
|
||||||
|
|
||||||
foreach (var h in objects)
|
foreach (var h in objects)
|
||||||
{
|
{
|
||||||
IHasEndTime end = h as IHasEndTime;
|
IHasEndTime end = h as IHasEndTime;
|
||||||
@ -37,10 +39,8 @@ namespace osu.Game.Screens.Play
|
|||||||
int startRange = (int)((h.StartTime - firstHit) / interval);
|
int startRange = (int)((h.StartTime - firstHit) / interval);
|
||||||
int endRange = (int)(((end?.EndTime > 0 ? end.EndTime : h.StartTime) - firstHit) / interval);
|
int endRange = (int)(((end?.EndTime > 0 ? end.EndTime : h.StartTime) - firstHit) / interval);
|
||||||
for (int i = startRange; i <= endRange; i++)
|
for (int i = startRange; i <= endRange; i++)
|
||||||
values[i]++;
|
Values[i]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Values = values;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,12 @@ namespace osu.Game.Screens.Play
|
|||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
layout.Refresh(recreateGraph);
|
|
||||||
|
if (!layout.IsValid)
|
||||||
|
{
|
||||||
|
recreateGraph();
|
||||||
|
layout.Validate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -163,6 +163,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
{
|
{
|
||||||
new Sprite
|
new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Alpha = 0.2f,
|
Alpha = 0.2f,
|
||||||
Texture = Beatmap?.Background,
|
Texture = Beatmap?.Background,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
|
@ -343,6 +343,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
{
|
{
|
||||||
cover = new Sprite
|
cover = new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
@ -152,6 +152,7 @@ namespace osu.Game.Screens.Select
|
|||||||
// Zoomed-in and cropped beatmap background
|
// Zoomed-in and cropped beatmap background
|
||||||
new BeatmapBackgroundSprite(beatmap)
|
new BeatmapBackgroundSprite(beatmap)
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
|
@ -67,7 +67,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
private readonly SearchTextBox searchTextBox;
|
private readonly SearchTextBox searchTextBox;
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => base.Contains(screenSpacePos) || groupTabs.Contains(screenSpacePos) || sortTabs.Contains(screenSpacePos);
|
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => base.ReceiveMouseInputAt(screenSpacePos) || groupTabs.ReceiveMouseInputAt(screenSpacePos) || sortTabs.ReceiveMouseInputAt(screenSpacePos);
|
||||||
|
|
||||||
public FilterControl()
|
public FilterControl()
|
||||||
{
|
{
|
||||||
|
@ -124,7 +124,7 @@ namespace osu.Game.Screens.Select
|
|||||||
updateModeLight();
|
updateModeLight();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => base.Contains(screenSpacePos) || StartButton.Contains(screenSpacePos);
|
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => base.ReceiveMouseInputAt(screenSpacePos) || StartButton.ReceiveMouseInputAt(screenSpacePos);
|
||||||
|
|
||||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
{
|
{
|
||||||
rankSprite = new Sprite
|
rankSprite = new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
FillMode = FillMode.Fit
|
FillMode = FillMode.Fit
|
||||||
|
@ -84,7 +84,7 @@ namespace osu.Game.Screens.Select.Options
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => box.Contains(screenSpacePos);
|
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => box.ReceiveMouseInputAt(screenSpacePos);
|
||||||
|
|
||||||
public BeatmapOptionsButton()
|
public BeatmapOptionsButton()
|
||||||
{
|
{
|
||||||
|
@ -281,10 +281,13 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
database.BeatmapSetAdded -= onBeatmapSetAdded;
|
if (database != null)
|
||||||
database.BeatmapSetRemoved -= onBeatmapSetRemoved;
|
{
|
||||||
|
database.BeatmapSetAdded -= onBeatmapSetAdded;
|
||||||
|
database.BeatmapSetRemoved -= onBeatmapSetRemoved;
|
||||||
|
}
|
||||||
|
|
||||||
initialAddSetsTask.Cancel();
|
initialAddSetsTask?.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changeBackground(WorkingBeatmap beatmap)
|
private void changeBackground(WorkingBeatmap beatmap)
|
||||||
|
@ -82,6 +82,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
},
|
},
|
||||||
new Sprite
|
new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
Texture = textures.Get(@"Backgrounds/Drawings/background.png")
|
Texture = textures.Get(@"Backgrounds/Drawings/background.png")
|
||||||
},
|
},
|
||||||
|
@ -151,9 +151,9 @@ namespace osu.Game.Screens.Tournament
|
|||||||
{
|
{
|
||||||
flagSprite = new Sprite
|
flagSprite = new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
|
|
||||||
FillMode = FillMode.Fit
|
FillMode = FillMode.Fit
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
|
@ -31,6 +31,7 @@ namespace osu.Game.Users
|
|||||||
|
|
||||||
Add(new Sprite
|
Add(new Sprite
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Texture = texture,
|
Texture = texture,
|
||||||
FillMode = FillMode.Fit,
|
FillMode = FillMode.Fit,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
|
@ -46,6 +46,7 @@ namespace osu.Game.Users
|
|||||||
{
|
{
|
||||||
new AsyncLoadWrapper(new UserCoverBackground(user)
|
new AsyncLoadWrapper(new UserCoverBackground(user)
|
||||||
{
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
|
Loading…
Reference in New Issue
Block a user