1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-18 06:27:18 +08:00

redo the test case

This commit is contained in:
jorolf 2018-03-03 20:20:07 +01:00
parent 033d066520
commit bafcab1349

View File

@ -3,8 +3,6 @@
using System;
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Graphics;
using osu.Framework.Testing;
using osu.Game.Overlays.Volume;
@ -16,17 +14,18 @@ namespace osu.Game.Tests.Visual
{
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(VolumeMeter), typeof(MuteButton) };
[BackgroundDependencyLoader]
private void load(AudioManager audio)
protected override void LoadComplete()
{
VolumeMeter meter;
MuteButton mute;
Add(meter = new VolumeMeter("MASTER", 125, Color4.Blue));
Add(new MuteButton
Add(mute = new MuteButton
{
Margin = new MarginPadding { Top = 200 }
});
meter.Bindable.BindTo(audio.Volume);
AddSliderStep("master volume", 0, 10, 0, i => meter.Bindable.Value = i * 0.1);
AddToggleStep("mute", b => mute.Current.Value = b);
}
}
}