mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Submodule osu-framework updated: 09c18c415d...60e210c1aa
@ -12,7 +12,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
class TestCasePlaySongSelect : TestCase
|
class TestCasePlaySongSelect : TestCase
|
||||||
{
|
{
|
||||||
private BeatmapDatabase db;
|
private BeatmapDatabase db, oldDb;
|
||||||
private TestStorage storage;
|
private TestStorage storage;
|
||||||
|
|
||||||
public override string Name => @"Song Select";
|
public override string Name => @"Song Select";
|
||||||
@ -21,11 +21,12 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
public override void Reset()
|
public override void Reset()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.Reset();
|
||||||
|
oldDb = Dependencies.Get<BeatmapDatabase>();
|
||||||
if (db == null)
|
if (db == null)
|
||||||
{
|
{
|
||||||
storage = new TestStorage(@"TestCasePlaySongSelect");
|
storage = new TestStorage(@"TestCasePlaySongSelect");
|
||||||
db = new BeatmapDatabase(storage);
|
db = new BeatmapDatabase(storage);
|
||||||
|
Dependencies.Cache(db, true);
|
||||||
|
|
||||||
var sets = new List<BeatmapSetInfo>();
|
var sets = new List<BeatmapSetInfo>();
|
||||||
|
|
||||||
@ -34,8 +35,13 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
db.Import(sets);
|
db.Import(sets);
|
||||||
}
|
}
|
||||||
|
Add(new PlaySongSelect());
|
||||||
|
}
|
||||||
|
|
||||||
Add(new PlaySongSelect(db));
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
Dependencies.Cache(oldDb, true);
|
||||||
|
base.Dispose(isDisposing);
|
||||||
}
|
}
|
||||||
|
|
||||||
private BeatmapSetInfo createTestBeatmapSet(int i)
|
private BeatmapSetInfo createTestBeatmapSet(int i)
|
||||||
|
@ -6,16 +6,17 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
|
using osu.Framework.Audio;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface.Volume
|
namespace osu.Game.Graphics.UserInterface.Volume
|
||||||
{
|
{
|
||||||
internal class VolumeControl : OverlayContainer
|
internal class VolumeControl : OverlayContainer
|
||||||
{
|
{
|
||||||
public BindableDouble VolumeGlobal { get; set; }
|
private BindableDouble volumeGlobal = new BindableDouble();
|
||||||
public BindableDouble VolumeSample { get; set; }
|
private BindableDouble volumeSample = new BindableDouble();
|
||||||
public BindableDouble VolumeTrack { get; set; }
|
private BindableDouble volumeTrack = new BindableDouble();
|
||||||
|
|
||||||
private VolumeMeter volumeMeterMaster;
|
private VolumeMeter volumeMeterMaster;
|
||||||
|
|
||||||
@ -54,20 +55,20 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
VolumeGlobal.ValueChanged += volumeChanged;
|
volumeGlobal.ValueChanged += volumeChanged;
|
||||||
VolumeSample.ValueChanged += volumeChanged;
|
volumeSample.ValueChanged += volumeChanged;
|
||||||
VolumeTrack.ValueChanged += volumeChanged;
|
volumeTrack.ValueChanged += volumeChanged;
|
||||||
|
|
||||||
volumeMeterMaster.Bindable = VolumeGlobal;
|
volumeMeterMaster.Bindable.Weld(volumeGlobal);
|
||||||
volumeMeterEffect.Bindable = VolumeSample;
|
volumeMeterEffect.Bindable.Weld(volumeSample);
|
||||||
volumeMeterMusic.Bindable = VolumeTrack;
|
volumeMeterMusic.Bindable.Weld(volumeTrack);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
{
|
{
|
||||||
VolumeGlobal.ValueChanged -= volumeChanged;
|
volumeGlobal.ValueChanged -= volumeChanged;
|
||||||
VolumeSample.ValueChanged -= volumeChanged;
|
volumeSample.ValueChanged -= volumeChanged;
|
||||||
VolumeTrack.ValueChanged -= volumeChanged;
|
volumeTrack.ValueChanged -= volumeChanged;
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,6 +83,14 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
|||||||
volumeMeterMaster.TriggerWheel(state);
|
volumeMeterMaster.TriggerWheel(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(AudioManager audio)
|
||||||
|
{
|
||||||
|
volumeGlobal.Weld(audio.Volume);
|
||||||
|
volumeSample.Weld(audio.VolumeSample);
|
||||||
|
volumeTrack.Weld(audio.VolumeTrack);
|
||||||
|
}
|
||||||
|
|
||||||
ScheduledDelegate popOutDelegate;
|
ScheduledDelegate popOutDelegate;
|
||||||
|
|
||||||
private VolumeMeter volumeMeterEffect;
|
private VolumeMeter volumeMeterEffect;
|
||||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
|||||||
internal class VolumeMeter : Container
|
internal class VolumeMeter : Container
|
||||||
{
|
{
|
||||||
private Box meterFill;
|
private Box meterFill;
|
||||||
public BindableDouble Bindable;
|
public BindableDouble Bindable { get; private set; } = new BindableDouble();
|
||||||
|
|
||||||
public VolumeMeter(string meterName)
|
public VolumeMeter(string meterName)
|
||||||
{
|
{
|
||||||
|
@ -97,12 +97,7 @@ namespace osu.Game
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
},
|
},
|
||||||
volume = new VolumeControl
|
volume = new VolumeControl(),
|
||||||
{
|
|
||||||
VolumeGlobal = Audio.Volume,
|
|
||||||
VolumeSample = Audio.VolumeSample,
|
|
||||||
VolumeTrack = Audio.VolumeTrack
|
|
||||||
},
|
|
||||||
overlayContent = new Container{ RelativeSizeAxes = Axes.Both },
|
overlayContent = new Container{ RelativeSizeAxes = Axes.Both },
|
||||||
new GlobalHotkeys //exists because UserInputManager is at a level below us.
|
new GlobalHotkeys //exists because UserInputManager is at a level below us.
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,7 @@ namespace osu.Game
|
|||||||
Dependencies.Cache(new BeatmapDatabase(Host.Storage, Host));
|
Dependencies.Cache(new BeatmapDatabase(Host.Storage, Host));
|
||||||
|
|
||||||
//this completely overrides the framework default. will need to change once we make a proper FontStore.
|
//this completely overrides the framework default. will need to change once we make a proper FontStore.
|
||||||
Dependencies.Cache(Fonts = new FontStore { ScaleAdjust = 0.01f });
|
Dependencies.Cache(Fonts = new FontStore { ScaleAdjust = 0.01f }, true);
|
||||||
|
|
||||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome"));
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome"));
|
||||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont"));
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont"));
|
||||||
|
@ -73,11 +73,8 @@ namespace osu.Game.Screens.Select
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <param name="database">Optionally provide a database to use instead of the OsuGame one.</param>
|
public PlaySongSelect()
|
||||||
public PlaySongSelect(BeatmapDatabase database = null)
|
|
||||||
{
|
{
|
||||||
this.database = database;
|
|
||||||
|
|
||||||
const float carouselWidth = 640;
|
const float carouselWidth = 640;
|
||||||
const float bottomToolHeight = 50;
|
const float bottomToolHeight = 50;
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
|
Reference in New Issue
Block a user