mirror of
https://github.com/ppy/osu.git
synced 2025-01-30 09:32:55 +08:00
Merge remote-tracking branch 'refs/remotes/ppy/master' into beatsync_fixes
This commit is contained in:
commit
6e293501e0
@ -1 +1 @@
|
|||||||
Subproject commit a5e66079b9df3cf74a8bd1431c1cb7faad3c4d9f
|
Subproject commit 8dc785a0aecfb6df53496eff5bd9f961ff8deee6
|
@ -1 +1 @@
|
|||||||
Subproject commit 10fda22522ffadbdbc43fa0f3683a065e536f7d1
|
Subproject commit 76656c51f281e7934159e9ed4414378fef24d130
|
@ -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
|
||||||
|
@ -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,
|
||||||
|
35
osu.Game/Graphics/Containers/OsuClickableContainer.cs
Normal file
35
osu.Game/Graphics/Containers/OsuClickableContainer.cs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
// 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.Allocation;
|
||||||
|
using osu.Framework.Audio;
|
||||||
|
using osu.Framework.Audio.Sample;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Input;
|
||||||
|
|
||||||
|
namespace osu.Game.Graphics.Containers
|
||||||
|
{
|
||||||
|
public class OsuClickableContainer : ClickableContainer
|
||||||
|
{
|
||||||
|
protected SampleChannel SampleClick, SampleHover;
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(AudioManager audio)
|
||||||
|
{
|
||||||
|
SampleHover = audio.Sample.Get(@"UI/generic-hover");
|
||||||
|
SampleClick = audio.Sample.Get(@"UI/generic-click");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool OnHover(InputState state)
|
||||||
|
{
|
||||||
|
SampleHover?.Play();
|
||||||
|
return base.OnHover(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool OnClick(InputState state)
|
||||||
|
{
|
||||||
|
SampleClick?.Play();
|
||||||
|
return base.OnClick(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
38
osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs
Normal file
38
osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
// 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.Allocation;
|
||||||
|
using osu.Framework.Audio;
|
||||||
|
using osu.Framework.Audio.Sample;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
|
||||||
|
namespace osu.Game.Graphics.Containers
|
||||||
|
{
|
||||||
|
public class OsuFocusedOverlayContainer : FocusedOverlayContainer
|
||||||
|
{
|
||||||
|
private SampleChannel samplePopIn;
|
||||||
|
private SampleChannel samplePopOut;
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(AudioManager audio)
|
||||||
|
{
|
||||||
|
samplePopIn = audio.Sample.Get(@"UI/melodic-5");
|
||||||
|
samplePopOut = audio.Sample.Get(@"UI/melodic-4");
|
||||||
|
|
||||||
|
StateChanged += OsuFocusedOverlayContainer_StateChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OsuFocusedOverlayContainer_StateChanged(VisibilityContainer arg1, Visibility arg2)
|
||||||
|
{
|
||||||
|
switch (arg2)
|
||||||
|
{
|
||||||
|
case Visibility.Visible:
|
||||||
|
samplePopIn?.Play();
|
||||||
|
break;
|
||||||
|
case Visibility.Hidden:
|
||||||
|
samplePopOut?.Play();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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 osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
@ -18,9 +17,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio, OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
ActivationSound = audio.Sample.Get(@"Menu/menuback");
|
|
||||||
BackgroundColour = colours.Pink;
|
BackgroundColour = colours.Pink;
|
||||||
HoverColour = colours.PinkDark;
|
HoverColour = colours.PinkDark;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
@ -8,14 +8,14 @@ using osu.Framework.Graphics.Colour;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Audio.Sample;
|
|
||||||
using osu.Game.Graphics.Backgrounds;
|
using osu.Game.Graphics.Backgrounds;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
{
|
{
|
||||||
public class DialogButton : ClickableContainer
|
public class DialogButton : OsuClickableContainer
|
||||||
{
|
{
|
||||||
private const float hover_width = 0.9f;
|
private const float hover_width = 0.9f;
|
||||||
private const float hover_duration = 500;
|
private const float hover_duration = 500;
|
||||||
@ -79,8 +79,6 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public SampleChannel SampleClick, SampleHover;
|
|
||||||
|
|
||||||
private readonly Container backgroundContainer;
|
private readonly Container backgroundContainer;
|
||||||
private readonly Container colourContainer;
|
private readonly Container colourContainer;
|
||||||
private readonly Container glowContainer;
|
private readonly Container glowContainer;
|
||||||
@ -93,15 +91,13 @@ 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)
|
||||||
{
|
{
|
||||||
didClick = true;
|
didClick = true;
|
||||||
colourContainer.ResizeTo(new Vector2(1.5f, 1f), click_duration, EasingTypes.In);
|
colourContainer.ResizeTo(new Vector2(1.5f, 1f), click_duration, EasingTypes.In);
|
||||||
flash();
|
flash();
|
||||||
SampleClick?.Play();
|
|
||||||
Action?.Invoke();
|
|
||||||
|
|
||||||
Delay(click_duration);
|
Delay(click_duration);
|
||||||
Schedule(delegate {
|
Schedule(delegate {
|
||||||
@ -110,7 +106,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
glowContainer.FadeOut();
|
glowContainer.FadeOut();
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return base.OnClick(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnHover(Framework.Input.InputState state)
|
protected override bool OnHover(Framework.Input.InputState state)
|
||||||
@ -119,7 +115,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
colourContainer.ResizeTo(new Vector2(hover_width, 1f), hover_duration, EasingTypes.OutElastic);
|
colourContainer.ResizeTo(new Vector2(hover_width, 1f), hover_duration, EasingTypes.OutElastic);
|
||||||
glowContainer.FadeIn(glow_fade_duration, EasingTypes.Out);
|
glowContainer.FadeIn(glow_fade_duration, EasingTypes.Out);
|
||||||
SampleHover?.Play();
|
base.OnHover(state);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,10 +9,11 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
{
|
{
|
||||||
public class IconButton : ClickableContainer
|
public class IconButton : OsuClickableContainer
|
||||||
{
|
{
|
||||||
private readonly TextAwesome icon;
|
private readonly TextAwesome icon;
|
||||||
private readonly Box hover;
|
private readonly Box hover;
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Audio;
|
||||||
|
using osu.Framework.Audio.Sample;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
@ -18,6 +20,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
private Box hover;
|
private Box hover;
|
||||||
|
|
||||||
|
private SampleChannel sampleClick;
|
||||||
|
private SampleChannel sampleHover;
|
||||||
|
|
||||||
public OsuButton()
|
public OsuButton()
|
||||||
{
|
{
|
||||||
Height = 40;
|
Height = 40;
|
||||||
@ -34,7 +39,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
public override bool HandleInput => Action != null;
|
public override bool HandleInput => Action != null;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours, AudioManager audio)
|
||||||
{
|
{
|
||||||
if (Action == null)
|
if (Action == null)
|
||||||
Colour = OsuColour.Gray(0.5f);
|
Colour = OsuColour.Gray(0.5f);
|
||||||
@ -60,10 +65,20 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
sampleClick = audio.Sample.Get(@"UI/generic-click");
|
||||||
|
sampleHover = audio.Sample.Get(@"UI/generic-hover");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool OnClick(InputState state)
|
||||||
|
{
|
||||||
|
sampleClick?.Play();
|
||||||
|
return base.OnClick(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnHover(InputState state)
|
protected override bool OnHover(InputState state)
|
||||||
{
|
{
|
||||||
|
sampleHover?.Play();
|
||||||
hover.FadeIn(200);
|
hover.FadeIn(200);
|
||||||
return base.OnHover(state);
|
return base.OnHover(state);
|
||||||
}
|
}
|
||||||
|
@ -106,8 +106,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio)
|
private void load(AudioManager audio)
|
||||||
{
|
{
|
||||||
sampleChecked = audio.Sample.Get(@"Checkbox/check-on");
|
sampleChecked = audio.Sample.Get(@"UI/check-on");
|
||||||
sampleUnchecked = audio.Sample.Get(@"Checkbox/check-off");
|
sampleUnchecked = audio.Sample.Get(@"UI/check-off");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,8 +65,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio)
|
private void load(AudioManager audio)
|
||||||
{
|
{
|
||||||
sampleHover = audio.Sample.Get(@"Menu/menuclick");
|
sampleHover = audio.Sample.Get(@"UI/generic-hover");
|
||||||
sampleClick = audio.Sample.Get(@"Menu/menuback");
|
sampleClick = audio.Sample.Get(@"UI/generic-click");
|
||||||
|
|
||||||
BackgroundColour = Color4.Transparent;
|
BackgroundColour = Color4.Transparent;
|
||||||
BackgroundColourHover = OsuColour.FromHex(@"172023");
|
BackgroundColourHover = OsuColour.FromHex(@"172023");
|
||||||
|
@ -100,7 +100,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio, OsuColour colours)
|
private void load(AudioManager audio, OsuColour colours)
|
||||||
{
|
{
|
||||||
sample = audio.Sample.Get(@"Sliderbar/sliderbar");
|
sample = audio.Sample.Get(@"UI/sliderbar-notch");
|
||||||
AccentColour = colours.Pink;
|
AccentColour = colours.Pink;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
|
||||||
|
|
||||||
private bool isEnumType => typeof(T).IsEnum;
|
private bool isEnumType => typeof(T).IsEnum;
|
||||||
|
|
||||||
public OsuTabControl()
|
public OsuTabControl()
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// 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.Audio.Sample;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
@ -18,7 +17,7 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
{
|
{
|
||||||
public class TwoLayerButton : ClickableContainer
|
public class TwoLayerButton : OsuClickableContainer
|
||||||
{
|
{
|
||||||
private readonly BouncingIcon bouncingIcon;
|
private readonly BouncingIcon bouncingIcon;
|
||||||
|
|
||||||
@ -32,7 +31,6 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
public static readonly Vector2 SIZE_EXTENDED = new Vector2(140, 50);
|
public static readonly Vector2 SIZE_EXTENDED = new Vector2(140, 50);
|
||||||
public static readonly Vector2 SIZE_RETRACTED = new Vector2(100, 50);
|
public static readonly Vector2 SIZE_RETRACTED = new Vector2(100, 50);
|
||||||
public SampleChannel ActivationSound;
|
|
||||||
private readonly SpriteText text;
|
private readonly SpriteText text;
|
||||||
|
|
||||||
public Color4 HoverColour;
|
public Color4 HoverColour;
|
||||||
@ -171,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)
|
||||||
{
|
{
|
||||||
@ -210,8 +208,6 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
flash.FadeOut(500, EasingTypes.OutQuint);
|
flash.FadeOut(500, EasingTypes.OutQuint);
|
||||||
flash.Expire();
|
flash.Expire();
|
||||||
|
|
||||||
ActivationSound.Play();
|
|
||||||
|
|
||||||
return base.OnClick(state);
|
return base.OnClick(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 },
|
}
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -12,10 +12,11 @@ using osu.Framework.Input;
|
|||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Online.Chat;
|
using osu.Game.Online.Chat;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Chat
|
namespace osu.Game.Overlays.Chat
|
||||||
{
|
{
|
||||||
public class ChannelListItem : ClickableContainer, IFilterable
|
public class ChannelListItem : OsuClickableContainer, IFilterable
|
||||||
{
|
{
|
||||||
private const float width_padding = 5;
|
private const float width_padding = 5;
|
||||||
private const float channel_width = 150;
|
private const float channel_width = 150;
|
||||||
|
@ -16,10 +16,11 @@ using osu.Game.Graphics.Backgrounds;
|
|||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Online.Chat;
|
using osu.Game.Online.Chat;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Chat
|
namespace osu.Game.Overlays.Chat
|
||||||
{
|
{
|
||||||
public class ChannelSelectionOverlay : FocusedOverlayContainer
|
public class ChannelSelectionOverlay : OsuFocusedOverlayContainer
|
||||||
{
|
{
|
||||||
public static readonly float WIDTH_PADDING = 170;
|
public static readonly float WIDTH_PADDING = 170;
|
||||||
|
|
||||||
|
@ -22,10 +22,11 @@ using osu.Framework.Input;
|
|||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Overlays.Chat;
|
using osu.Game.Overlays.Chat;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
public class ChatOverlay : FocusedOverlayContainer, IOnlineComponent
|
public class ChatOverlay : OsuFocusedOverlayContainer, IOnlineComponent
|
||||||
{
|
{
|
||||||
private const float textbox_height = 60;
|
private const float textbox_height = 60;
|
||||||
private const float channel_selection_min_height = 0.3f;
|
private const float channel_selection_min_height = 0.3f;
|
||||||
@ -59,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()
|
||||||
{
|
{
|
||||||
@ -193,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;
|
||||||
|
@ -15,10 +15,11 @@ using OpenTK;
|
|||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Dialog
|
namespace osu.Game.Overlays.Dialog
|
||||||
{
|
{
|
||||||
public class PopupDialog : FocusedOverlayContainer
|
public class PopupDialog : OsuFocusedOverlayContainer
|
||||||
{
|
{
|
||||||
public static readonly float ENTER_DURATION = 500;
|
public static readonly float ENTER_DURATION = 500;
|
||||||
public static readonly float EXIT_DURATION = 200;
|
public static readonly float EXIT_DURATION = 200;
|
||||||
|
@ -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 osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Dialog
|
namespace osu.Game.Overlays.Dialog
|
||||||
@ -10,11 +9,9 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
public class PopupDialogCancelButton : PopupDialogButton
|
public class PopupDialogCancelButton : PopupDialogButton
|
||||||
{
|
{
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours, AudioManager audio)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
ButtonColour = colours.Blue;
|
ButtonColour = colours.Blue;
|
||||||
SampleHover = audio.Sample.Get(@"Menu/menuclick");
|
|
||||||
SampleClick = audio.Sample.Get(@"Menu/menuback");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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 osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Dialog
|
namespace osu.Game.Overlays.Dialog
|
||||||
@ -10,11 +9,9 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
public class PopupDialogOkButton : PopupDialogButton
|
public class PopupDialogOkButton : PopupDialogButton
|
||||||
{
|
{
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours, AudioManager audio)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
ButtonColour = colours.Pink;
|
ButtonColour = colours.Pink;
|
||||||
SampleHover = audio.Sample.Get(@"Menu/menuclick");
|
|
||||||
SampleClick = audio.Sample.Get(@"Menu/menu-play-click");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,11 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Game.Overlays.Dialog;
|
using osu.Game.Overlays.Dialog;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
public class DialogOverlay : FocusedOverlayContainer
|
public class DialogOverlay : OsuFocusedOverlayContainer
|
||||||
{
|
{
|
||||||
private readonly Container dialogContainer;
|
private readonly Container dialogContainer;
|
||||||
private PopupDialog currentDialog;
|
private PopupDialog currentDialog;
|
||||||
|
@ -16,6 +16,7 @@ using osu.Framework.Graphics.Textures;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Direct
|
namespace osu.Game.Overlays.Direct
|
||||||
{
|
{
|
||||||
@ -151,7 +152,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private class DownloadButton : ClickableContainer
|
private class DownloadButton : OsuClickableContainer
|
||||||
{
|
{
|
||||||
private readonly TextAwesome icon;
|
private readonly TextAwesome icon;
|
||||||
|
|
||||||
|
@ -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 };
|
||||||
|
@ -9,6 +9,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Overlays.SearchableList;
|
using osu.Game.Overlays.SearchableList;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Direct
|
namespace osu.Game.Overlays.Direct
|
||||||
@ -42,7 +43,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class RulesetToggleButton : ClickableContainer
|
private class RulesetToggleButton : OsuClickableContainer
|
||||||
{
|
{
|
||||||
private readonly TextAwesome icon;
|
private readonly TextAwesome icon;
|
||||||
|
|
||||||
|
@ -8,10 +8,11 @@ using osu.Game.Graphics;
|
|||||||
using osu.Game.Overlays.Settings.Sections.General;
|
using osu.Game.Overlays.Settings.Sections.General;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
internal class LoginOverlay : FocusedOverlayContainer
|
internal class LoginOverlay : OsuFocusedOverlayContainer
|
||||||
{
|
{
|
||||||
private LoginSettings settingsSection;
|
private LoginSettings settingsSection;
|
||||||
|
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,10 +24,11 @@ using osu.Framework.Threading;
|
|||||||
using osu.Game.Overlays.Music;
|
using osu.Game.Overlays.Music;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
public class MusicController : FocusedOverlayContainer
|
public class MusicController : OsuFocusedOverlayContainer
|
||||||
{
|
{
|
||||||
private const float player_height = 130;
|
private const float player_height = 130;
|
||||||
|
|
||||||
@ -397,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,
|
||||||
},
|
},
|
||||||
|
@ -9,10 +9,11 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Game.Overlays.Notifications;
|
using osu.Game.Overlays.Notifications;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
public class NotificationManager : FocusedOverlayContainer
|
public class NotificationManager : OsuFocusedOverlayContainer
|
||||||
{
|
{
|
||||||
private const float width = 320;
|
private const float width = 320;
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ using osu.Game.Graphics;
|
|||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Notifications
|
namespace osu.Game.Overlays.Notifications
|
||||||
{
|
{
|
||||||
@ -152,7 +153,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
Expire();
|
Expire();
|
||||||
}
|
}
|
||||||
|
|
||||||
private class CloseButton : ClickableContainer
|
private class CloseButton : OsuClickableContainer
|
||||||
{
|
{
|
||||||
private Color4 hoverColour;
|
private Color4 hoverColour;
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Notifications
|
namespace osu.Game.Overlays.Notifications
|
||||||
{
|
{
|
||||||
@ -131,7 +132,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
countText.Text = notifications.Children.Count(c => c.Alpha > 0.99f).ToString();
|
countText.Text = notifications.Children.Count(c => c.Alpha > 0.99f).ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ClearAllButton : ClickableContainer
|
private class ClearAllButton : OsuClickableContainer
|
||||||
{
|
{
|
||||||
private readonly OsuSpriteText text;
|
private readonly OsuSpriteText text;
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ using osu.Framework.Configuration;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.SearchableList
|
namespace osu.Game.Overlays.SearchableList
|
||||||
{
|
{
|
||||||
@ -52,7 +53,7 @@ namespace osu.Game.Overlays.SearchableList
|
|||||||
DisplayStyle.Value = PanelDisplayStyle.Grid;
|
DisplayStyle.Value = PanelDisplayStyle.Grid;
|
||||||
}
|
}
|
||||||
|
|
||||||
private class DisplayStyleToggleButton : ClickableContainer
|
private class DisplayStyleToggleButton : OsuClickableContainer
|
||||||
{
|
{
|
||||||
private readonly TextAwesome icon;
|
private readonly TextAwesome icon;
|
||||||
private readonly PanelDisplayStyle style;
|
private readonly PanelDisplayStyle style;
|
||||||
|
@ -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)
|
||||||
|
@ -15,7 +15,7 @@ using osu.Game.Overlays.Settings.Sections;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
public class SettingsOverlay : FocusedOverlayContainer
|
public class SettingsOverlay : OsuFocusedOverlayContainer
|
||||||
{
|
{
|
||||||
internal const float CONTENT_MARGINS = 10;
|
internal const float CONTENT_MARGINS = 10;
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ namespace osu.Game.Overlays
|
|||||||
new SidebarButton
|
new SidebarButton
|
||||||
{
|
{
|
||||||
Section = section,
|
Section = section,
|
||||||
Action = sectionsContainer.ScrollContainer.ScrollIntoView,
|
Action = b => sectionsContainer.ScrollContainer.ScrollTo(b),
|
||||||
}
|
}
|
||||||
).ToArray()
|
).ToArray()
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
// 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 System;
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Audio;
|
|
||||||
using osu.Framework.Audio.Sample;
|
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -16,10 +12,11 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Toolbar
|
namespace osu.Game.Overlays.Toolbar
|
||||||
{
|
{
|
||||||
public class ToolbarButton : Container
|
public class ToolbarButton : OsuClickableContainer
|
||||||
{
|
{
|
||||||
public const float WIDTH = Toolbar.HEIGHT * 1.4f;
|
public const float WIDTH = Toolbar.HEIGHT * 1.4f;
|
||||||
|
|
||||||
@ -58,7 +55,6 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
|
|
||||||
protected virtual Anchor TooltipAnchor => Anchor.TopLeft;
|
protected virtual Anchor TooltipAnchor => Anchor.TopLeft;
|
||||||
|
|
||||||
public Action Action;
|
|
||||||
protected TextAwesome DrawableIcon;
|
protected TextAwesome DrawableIcon;
|
||||||
protected SpriteText DrawableText;
|
protected SpriteText DrawableText;
|
||||||
protected Box HoverBackground;
|
protected Box HoverBackground;
|
||||||
@ -66,7 +62,6 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
private readonly SpriteText tooltip1;
|
private readonly SpriteText tooltip1;
|
||||||
private readonly SpriteText tooltip2;
|
private readonly SpriteText tooltip2;
|
||||||
protected FillFlowContainer Flow;
|
protected FillFlowContainer Flow;
|
||||||
private SampleChannel sampleClick;
|
|
||||||
|
|
||||||
public ToolbarButton()
|
public ToolbarButton()
|
||||||
{
|
{
|
||||||
@ -136,27 +131,19 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(AudioManager audio)
|
|
||||||
{
|
|
||||||
sampleClick = audio.Sample.Get(@"Menu/menuclick");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
||||||
|
|
||||||
protected override bool OnClick(InputState state)
|
protected override bool OnClick(InputState state)
|
||||||
{
|
{
|
||||||
Action?.Invoke();
|
|
||||||
sampleClick.Play();
|
|
||||||
HoverBackground.FlashColour(Color4.White.Opacity(100), 500, EasingTypes.OutQuint);
|
HoverBackground.FlashColour(Color4.White.Opacity(100), 500, EasingTypes.OutQuint);
|
||||||
return true;
|
return base.OnClick(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnHover(InputState state)
|
protected override bool OnHover(InputState state)
|
||||||
{
|
{
|
||||||
HoverBackground.FadeIn(200);
|
HoverBackground.FadeIn(200);
|
||||||
tooltipContainer.FadeIn(100);
|
tooltipContainer.FadeIn(100);
|
||||||
return false;
|
return base.OnHover(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnHoverLost(InputState state)
|
protected override void OnHoverLost(InputState state)
|
||||||
|
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,11 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
public abstract class WaveOverlayContainer : FocusedOverlayContainer
|
public abstract class WaveOverlayContainer : OsuFocusedOverlayContainer
|
||||||
{
|
{
|
||||||
protected const float APPEAR_DURATION = 800;
|
protected const float APPEAR_DURATION = 800;
|
||||||
protected const float DISAPPEAR_DURATION = 500;
|
protected const float DISAPPEAR_DURATION = 500;
|
||||||
|
@ -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);
|
||||||
|
@ -2,16 +2,38 @@
|
|||||||
// 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.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Graphics.Backgrounds;
|
using osu.Game.Graphics.Backgrounds;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Backgrounds
|
namespace osu.Game.Screens.Backgrounds
|
||||||
{
|
{
|
||||||
public class BackgroundScreenDefault : BackgroundScreen
|
public class BackgroundScreenDefault : BackgroundScreen
|
||||||
{
|
{
|
||||||
|
private int currentDisplay;
|
||||||
|
private const int background_count = 5;
|
||||||
|
|
||||||
|
private string backgroundName => $@"Menu/menu-background-{currentDisplay % background_count + 1}";
|
||||||
|
|
||||||
|
private Background current;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
Add(new Background(@"Backgrounds/bg1"));
|
display(new Background(backgroundName));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void display(Background newBackground)
|
||||||
|
{
|
||||||
|
current?.FadeOut(800, EasingTypes.OutQuint);
|
||||||
|
current?.Expire();
|
||||||
|
|
||||||
|
Add(current = newBackground);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Next()
|
||||||
|
{
|
||||||
|
currentDisplay++;
|
||||||
|
LoadComponentAsync(new Background(backgroundName) { Depth = currentDisplay }, display);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -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 osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Screens;
|
|
||||||
using osu.Game.Screens.Menu;
|
using osu.Game.Screens.Menu;
|
||||||
|
|
||||||
namespace osu.Game.Screens
|
namespace osu.Game.Screens
|
||||||
@ -20,9 +19,9 @@ namespace osu.Game.Screens
|
|||||||
private void load(OsuGame game)
|
private void load(OsuGame game)
|
||||||
{
|
{
|
||||||
if (game.IsDeployedBuild)
|
if (game.IsDeployedBuild)
|
||||||
LoadComponentAsync(new Disclaimer(), d => Push((Screen)d));
|
LoadComponentAsync(new Disclaimer(), d => Push(d));
|
||||||
else
|
else
|
||||||
LoadComponentAsync(new Intro(), d => Push((Screen)d));
|
LoadComponentAsync(new Intro(), d => Push(d));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,16 +30,17 @@ namespace osu.Game.Screens.Menu
|
|||||||
private readonly Container box;
|
private readonly Container box;
|
||||||
private readonly Box boxHoverLayer;
|
private readonly Box boxHoverLayer;
|
||||||
private readonly TextAwesome icon;
|
private readonly TextAwesome icon;
|
||||||
private readonly string internalName;
|
private readonly string sampleName;
|
||||||
private readonly Action clickAction;
|
private readonly Action clickAction;
|
||||||
private readonly Key triggerKey;
|
private readonly Key triggerKey;
|
||||||
private SampleChannel sampleClick;
|
private SampleChannel sampleClick;
|
||||||
|
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 internalName, 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)
|
||||||
{
|
{
|
||||||
this.internalName = internalName;
|
this.sampleName = sampleName;
|
||||||
this.clickAction = clickAction;
|
this.clickAction = clickAction;
|
||||||
this.triggerKey = triggerKey;
|
this.triggerKey = triggerKey;
|
||||||
|
|
||||||
@ -120,8 +121,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
{
|
{
|
||||||
if (State != ButtonState.Expanded) return true;
|
if (State != ButtonState.Expanded) return true;
|
||||||
|
|
||||||
//if (OsuGame.Instance.IsActive)
|
sampleHover?.Play();
|
||||||
// Game.Audio.PlaySamplePositional($@"menu-{internalName}-hover", @"menuclick");
|
|
||||||
|
|
||||||
box.ScaleTo(new Vector2(1.5f, 1), 500, EasingTypes.OutElastic);
|
box.ScaleTo(new Vector2(1.5f, 1), 500, EasingTypes.OutElastic);
|
||||||
|
|
||||||
@ -222,7 +222,9 @@ namespace osu.Game.Screens.Menu
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio)
|
private void load(AudioManager audio)
|
||||||
{
|
{
|
||||||
sampleClick = audio.Sample.Get($@"Menu/menu-{internalName}-click") ?? audio.Sample.Get(internalName.Contains(@"back") ? @"Menu/menuback" : @"Menu/menuhit");
|
sampleHover = audio.Sample.Get(@"Menu/hover");
|
||||||
|
if (!string.IsNullOrEmpty(sampleName))
|
||||||
|
sampleClick = audio.Sample.Get($@"Menu/{sampleName}");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
||||||
@ -259,7 +261,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
private void trigger()
|
private void trigger()
|
||||||
{
|
{
|
||||||
sampleClick.Play();
|
sampleClick?.Play();
|
||||||
|
|
||||||
clickAction?.Invoke();
|
clickAction?.Invoke();
|
||||||
|
|
||||||
|
@ -15,6 +15,8 @@ using osu.Game.Overlays.Toolbar;
|
|||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
|
using osu.Framework.Audio.Sample;
|
||||||
|
using osu.Framework.Audio;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Menu
|
namespace osu.Game.Screens.Menu
|
||||||
{
|
{
|
||||||
@ -51,6 +53,8 @@ namespace osu.Game.Screens.Menu
|
|||||||
private readonly List<Button> buttonsTopLevel = new List<Button>();
|
private readonly List<Button> buttonsTopLevel = new List<Button>();
|
||||||
private readonly List<Button> buttonsPlay = new List<Button>();
|
private readonly List<Button> buttonsPlay = new List<Button>();
|
||||||
|
|
||||||
|
private SampleChannel sampleBack;
|
||||||
|
|
||||||
public ButtonSystem()
|
public ButtonSystem()
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
@ -82,8 +86,8 @@ namespace osu.Game.Screens.Menu
|
|||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
settingsButton = new Button(@"settings", @"settings", FontAwesome.fa_gear, new Color4(85, 85, 85, 255), () => OnSettings?.Invoke(), -WEDGE_WIDTH, Key.O),
|
settingsButton = new Button(@"settings", string.Empty, FontAwesome.fa_gear, new Color4(85, 85, 85, 255), () => OnSettings?.Invoke(), -WEDGE_WIDTH, Key.O),
|
||||||
backButton = new Button(@"back", @"back", FontAwesome.fa_osu_left_o, new Color4(51, 58, 94, 255), onBack, -WEDGE_WIDTH),
|
backButton = new Button(@"back", string.Empty, FontAwesome.fa_osu_left_o, new Color4(51, 58, 94, 255), onBack, -WEDGE_WIDTH),
|
||||||
iconFacade = new Container //need a container to make the osu! icon flow properly.
|
iconFacade = new Container //need a container to make the osu! icon flow properly.
|
||||||
{
|
{
|
||||||
Size = new Vector2(0, BUTTON_AREA_HEIGHT)
|
Size = new Vector2(0, BUTTON_AREA_HEIGHT)
|
||||||
@ -101,23 +105,24 @@ namespace osu.Game.Screens.Menu
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
buttonsPlay.Add(new Button(@"solo", @"freeplay", FontAwesome.fa_user, new Color4(102, 68, 204, 255), () => OnSolo?.Invoke(), WEDGE_WIDTH, Key.P));
|
buttonsPlay.Add(new Button(@"solo", @"select-6", FontAwesome.fa_user, new Color4(102, 68, 204, 255), () => OnSolo?.Invoke(), WEDGE_WIDTH, Key.P));
|
||||||
buttonsPlay.Add(new Button(@"multi", @"multiplayer", FontAwesome.fa_users, new Color4(94, 63, 186, 255), () => OnMulti?.Invoke(), 0, Key.M));
|
buttonsPlay.Add(new Button(@"multi", @"select-5", FontAwesome.fa_users, new Color4(94, 63, 186, 255), () => OnMulti?.Invoke(), 0, Key.M));
|
||||||
buttonsPlay.Add(new Button(@"chart", @"charts", FontAwesome.fa_osu_charts, new Color4(80, 53, 160, 255), () => OnChart?.Invoke()));
|
buttonsPlay.Add(new Button(@"chart", @"select-5", FontAwesome.fa_osu_charts, new Color4(80, 53, 160, 255), () => OnChart?.Invoke()));
|
||||||
|
|
||||||
buttonsTopLevel.Add(new Button(@"play", @"play", FontAwesome.fa_osu_logo, new Color4(102, 68, 204, 255), onPlay, WEDGE_WIDTH, Key.P));
|
buttonsTopLevel.Add(new Button(@"play", @"select-1", FontAwesome.fa_osu_logo, new Color4(102, 68, 204, 255), onPlay, WEDGE_WIDTH, Key.P));
|
||||||
buttonsTopLevel.Add(new Button(@"osu!editor", @"edit", FontAwesome.fa_osu_edit_o, new Color4(238, 170, 0, 255), () => OnEdit?.Invoke(), 0, Key.E));
|
buttonsTopLevel.Add(new Button(@"osu!editor", @"select-5", FontAwesome.fa_osu_edit_o, new Color4(238, 170, 0, 255), () => OnEdit?.Invoke(), 0, Key.E));
|
||||||
buttonsTopLevel.Add(new Button(@"osu!direct", @"direct", FontAwesome.fa_osu_chevron_down_o, new Color4(165, 204, 0, 255), () => OnDirect?.Invoke(), 0, Key.D));
|
buttonsTopLevel.Add(new Button(@"osu!direct", string.Empty, FontAwesome.fa_osu_chevron_down_o, new Color4(165, 204, 0, 255), () => OnDirect?.Invoke(), 0, Key.D));
|
||||||
buttonsTopLevel.Add(new Button(@"exit", @"exit", FontAwesome.fa_osu_cross_o, new Color4(238, 51, 153, 255), onExit, 0, Key.Q));
|
buttonsTopLevel.Add(new Button(@"exit", string.Empty, FontAwesome.fa_osu_cross_o, new Color4(238, 51, 153, 255), onExit, 0, Key.Q));
|
||||||
|
|
||||||
buttonFlow.Add(buttonsPlay);
|
buttonFlow.Add(buttonsPlay);
|
||||||
buttonFlow.Add(buttonsTopLevel);
|
buttonFlow.Add(buttonsTopLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(OsuGame game = null)
|
private void load(AudioManager audio, OsuGame game = null)
|
||||||
{
|
{
|
||||||
toolbar = game?.Toolbar;
|
toolbar = game?.Toolbar;
|
||||||
|
sampleBack = audio.Sample.Get(@"Menu/select-4");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -167,6 +172,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
private void onBack()
|
private void onBack()
|
||||||
{
|
{
|
||||||
|
sampleBack?.Play();
|
||||||
State = MenuState.TopLevel;
|
State = MenuState.TopLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,6 +237,8 @@ namespace osu.Game.Screens.Menu
|
|||||||
osuLogo.RotateTo(20, EXIT_DELAY * 1.5f);
|
osuLogo.RotateTo(20, EXIT_DELAY * 1.5f);
|
||||||
osuLogo.FadeOut(EXIT_DELAY);
|
osuLogo.FadeOut(EXIT_DELAY);
|
||||||
}
|
}
|
||||||
|
else if (lastState == MenuState.TopLevel)
|
||||||
|
sampleBack?.Play();
|
||||||
break;
|
break;
|
||||||
case MenuState.TopLevel:
|
case MenuState.TopLevel:
|
||||||
buttonArea.Flush(true);
|
buttonArea.Flush(true);
|
||||||
|
@ -7,6 +7,7 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Screens.Backgrounds;
|
using osu.Game.Screens.Backgrounds;
|
||||||
using osu.Game.Screens.Charts;
|
using osu.Game.Screens.Charts;
|
||||||
@ -24,7 +25,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
internal override bool ShowOverlays => buttons.State != MenuState.Initial;
|
internal override bool ShowOverlays => buttons.State != MenuState.Initial;
|
||||||
|
|
||||||
private readonly BackgroundScreen background;
|
private readonly BackgroundScreenDefault background;
|
||||||
private Screen songSelect;
|
private Screen songSelect;
|
||||||
|
|
||||||
protected override BackgroundScreen CreateBackground() => background;
|
protected override BackgroundScreen CreateBackground() => background;
|
||||||
@ -66,6 +67,12 @@ namespace osu.Game.Screens.Menu
|
|||||||
preloadSongSelect();
|
preloadSongSelect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnBeatmapChanged(WorkingBeatmap beatmap)
|
||||||
|
{
|
||||||
|
base.OnBeatmapChanged(beatmap);
|
||||||
|
background.Next();
|
||||||
|
}
|
||||||
|
|
||||||
private void preloadSongSelect()
|
private void preloadSongSelect()
|
||||||
{
|
{
|
||||||
if (songSelect == null)
|
if (songSelect == null)
|
||||||
@ -111,6 +118,8 @@ namespace osu.Game.Screens.Menu
|
|||||||
{
|
{
|
||||||
base.OnResuming(last);
|
base.OnResuming(last);
|
||||||
|
|
||||||
|
background.Next();
|
||||||
|
|
||||||
//we may have consumed our preloaded instance, so let's make another.
|
//we may have consumed our preloaded instance, so let's make another.
|
||||||
preloadSongSelect();
|
preloadSongSelect();
|
||||||
|
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
@ -72,11 +72,11 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
private const float default_size = 480;
|
private const float default_size = 480;
|
||||||
|
|
||||||
private const double beat_in_time = 60;
|
private const double early_activation = 60;
|
||||||
|
|
||||||
public OsuLogo()
|
public OsuLogo()
|
||||||
{
|
{
|
||||||
EarlyActivationMilliseconds = beat_in_time;
|
EarlyActivationMilliseconds = early_activation;
|
||||||
|
|
||||||
Size = new Vector2(default_size);
|
Size = new Vector2(default_size);
|
||||||
|
|
||||||
@ -215,8 +215,9 @@ namespace osu.Game.Screens.Menu
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(TextureStore textures, AudioManager audio)
|
private void load(TextureStore textures, AudioManager audio)
|
||||||
{
|
{
|
||||||
sampleClick = audio.Sample.Get(@"Menu/menuhit");
|
sampleClick = audio.Sample.Get(@"Menu/select-2");
|
||||||
sampleBeat = audio.Sample.Get(@"Menu/heartbeat");
|
sampleBeat = audio.Sample.Get(@"Menu/heartbeat");
|
||||||
|
|
||||||
logo.Texture = textures.Get(@"Menu/logo");
|
logo.Texture = textures.Get(@"Menu/logo");
|
||||||
ripple.Texture = textures.Get(@"Menu/logo");
|
ripple.Texture = textures.Get(@"Menu/logo");
|
||||||
}
|
}
|
||||||
@ -235,11 +236,14 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
if (beatIndex < 0) return;
|
if (beatIndex < 0) return;
|
||||||
|
|
||||||
if (Hovering)
|
if (IsHovered)
|
||||||
sampleBeat.Play();
|
{
|
||||||
|
using (BeginDelayedSequence(early_activation))
|
||||||
|
Schedule(() => sampleBeat.Play());
|
||||||
|
}
|
||||||
|
|
||||||
logoBeatContainer.ScaleTo(1 - 0.02f * amplitudeAdjust, beat_in_time, EasingTypes.Out);
|
logoBeatContainer.ScaleTo(1 - 0.02f * amplitudeAdjust, early_activation, EasingTypes.Out);
|
||||||
using (logoBeatContainer.BeginDelayedSequence(beat_in_time))
|
using (logoBeatContainer.BeginDelayedSequence(early_activation))
|
||||||
logoBeatContainer.ScaleTo(1, beatLength * 2, EasingTypes.OutQuint);
|
logoBeatContainer.ScaleTo(1, beatLength * 2, EasingTypes.OutQuint);
|
||||||
|
|
||||||
ripple.ClearTransforms();
|
ripple.ClearTransforms();
|
||||||
@ -255,11 +259,11 @@ namespace osu.Game.Screens.Menu
|
|||||||
flashLayer.ClearTransforms();
|
flashLayer.ClearTransforms();
|
||||||
visualizer.ClearTransforms();
|
visualizer.ClearTransforms();
|
||||||
|
|
||||||
flashLayer.FadeTo(0.2f * amplitudeAdjust, beat_in_time, EasingTypes.Out);
|
flashLayer.FadeTo(0.2f * amplitudeAdjust, early_activation, EasingTypes.Out);
|
||||||
visualizer.FadeTo(0.9f * amplitudeAdjust, beat_in_time, EasingTypes.Out);
|
visualizer.FadeTo(0.9f * amplitudeAdjust, early_activation, EasingTypes.Out);
|
||||||
using (flashLayer.BeginDelayedSequence(beat_in_time))
|
using (flashLayer.BeginDelayedSequence(early_activation))
|
||||||
flashLayer.FadeOut(beatLength);
|
flashLayer.FadeOut(beatLength);
|
||||||
using (visualizer.BeginDelayedSequence(beat_in_time))
|
using (visualizer.BeginDelayedSequence(early_activation))
|
||||||
visualizer.FadeTo(0.5f, beatLength);
|
visualizer.FadeTo(0.5f, beatLength);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,13 +11,14 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Multiplayer
|
namespace osu.Game.Screens.Multiplayer
|
||||||
{
|
{
|
||||||
public class DrawableRoom : ClickableContainer
|
public class DrawableRoom : OsuClickableContainer
|
||||||
{
|
{
|
||||||
private const float content_padding = 5;
|
private const float content_padding = 5;
|
||||||
private const float height = 90;
|
private const float height = 90;
|
||||||
|
@ -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,
|
||||||
|
@ -8,6 +8,8 @@ using osu.Game.Beatmaps;
|
|||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
using osu.Framework.Audio.Sample;
|
||||||
|
using osu.Framework.Audio;
|
||||||
|
|
||||||
namespace osu.Game.Screens
|
namespace osu.Game.Screens
|
||||||
{
|
{
|
||||||
@ -33,6 +35,8 @@ namespace osu.Game.Screens
|
|||||||
|
|
||||||
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
||||||
|
|
||||||
|
private SampleChannel sampleExit;
|
||||||
|
|
||||||
public WorkingBeatmap Beatmap
|
public WorkingBeatmap Beatmap
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -46,7 +50,7 @@ namespace osu.Game.Screens
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(permitNulls: true)]
|
[BackgroundDependencyLoader(permitNulls: true)]
|
||||||
private void load(OsuGameBase game, OsuGame osuGame)
|
private void load(OsuGameBase game, OsuGame osuGame, AudioManager audio)
|
||||||
{
|
{
|
||||||
if (game != null)
|
if (game != null)
|
||||||
{
|
{
|
||||||
@ -59,6 +63,8 @@ namespace osu.Game.Screens
|
|||||||
|
|
||||||
if (osuGame != null)
|
if (osuGame != null)
|
||||||
ruleset.BindTo(osuGame.Ruleset);
|
ruleset.BindTo(osuGame.Ruleset);
|
||||||
|
|
||||||
|
sampleExit = audio.Sample.Get(@"UI/melodic-1");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -82,6 +88,12 @@ namespace osu.Game.Screens
|
|||||||
ruleset.Disabled = !AllowRulesetChange;
|
ruleset.Disabled = !AllowRulesetChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnResuming(Screen last)
|
||||||
|
{
|
||||||
|
base.OnResuming(last);
|
||||||
|
sampleExit?.Play();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnEntering(Screen last)
|
protected override void OnEntering(Screen last)
|
||||||
{
|
{
|
||||||
OsuScreen lastOsu = last as OsuScreen;
|
OsuScreen lastOsu = last as OsuScreen;
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio.Sample;
|
|
||||||
using osu.Framework.Audio;
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -18,7 +16,6 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
public Action Action;
|
public Action Action;
|
||||||
|
|
||||||
private SampleChannel retrySample;
|
|
||||||
private Box overlay;
|
private Box overlay;
|
||||||
|
|
||||||
private const int activate_delay = 400;
|
private const int activate_delay = 400;
|
||||||
@ -27,9 +24,8 @@ namespace osu.Game.Screens.Play
|
|||||||
private bool fired;
|
private bool fired;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio)
|
private void load()
|
||||||
{
|
{
|
||||||
retrySample = audio.Sample.Get(@"Menu/menuback");
|
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
AlwaysPresent = true;
|
AlwaysPresent = true;
|
||||||
|
|
||||||
@ -74,7 +70,6 @@ namespace osu.Game.Screens.Play
|
|||||||
if (!fired && overlay.Alpha == 1)
|
if (!fired && overlay.Alpha == 1)
|
||||||
{
|
{
|
||||||
fired = true;
|
fired = true;
|
||||||
retrySample.Play();
|
|
||||||
Action?.Invoke();
|
Action?.Invoke();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user