Merge branch 'master' into better-skin-hashing

This commit is contained in:
Dean Herbert 2020-09-17 11:12:56 +09:00
commit 1a3dd7ac76
6 changed files with 31 additions and 0 deletions

View File

@ -74,6 +74,13 @@ namespace osu.Game.Tests.Visual.Navigation
private void returnToMenu()
{
// if we don't pause, there's a chance the track may change at the main menu out of our control (due to reaching the end of the track).
AddStep("pause audio", () =>
{
if (Game.MusicController.IsPlaying)
Game.MusicController.TogglePause();
});
AddStep("return to menu", () => Game.ScreenStack.CurrentScreen.Exit());
AddUntilStep("wait for menu", () => Game.ScreenStack.CurrentScreen is MainMenu);
}

View File

@ -110,6 +110,13 @@ namespace osu.Game.Tests.Visual.Navigation
private void returnToMenu()
{
// if we don't pause, there's a chance the track may change at the main menu out of our control (due to reaching the end of the track).
AddStep("pause audio", () =>
{
if (Game.MusicController.IsPlaying)
Game.MusicController.TogglePause();
});
AddStep("return to menu", () => Game.ScreenStack.CurrentScreen.Exit());
AddUntilStep("wait for menu", () => Game.ScreenStack.CurrentScreen is MainMenu);
}

View File

@ -24,6 +24,7 @@ namespace osu.Game.Configuration
Set(OsuSetting.Skin, 0, -1, int.MaxValue);
Set(OsuSetting.BeatmapDetailTab, PlayBeatmapDetailArea.TabType.Details);
Set(OsuSetting.BeatmapDetailModsFilter, false);
Set(OsuSetting.ShowConvertedBeatmaps, true);
Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10, 0.1);
@ -200,6 +201,7 @@ namespace osu.Game.Configuration
CursorRotation,
MenuParallax,
BeatmapDetailTab,
BeatmapDetailModsFilter,
Username,
ReleaseStream,
SavePassword,

View File

@ -30,6 +30,8 @@ namespace osu.Game.Screens.Select
protected Bindable<BeatmapDetailAreaTabItem> CurrentTab => tabControl.Current;
protected Bindable<bool> CurrentModsFilter => tabControl.CurrentModsFilter;
private readonly Container content;
protected override Container<Drawable> Content => content;

View File

@ -26,6 +26,12 @@ namespace osu.Game.Screens.Select
set => tabs.Current = value;
}
public Bindable<bool> CurrentModsFilter
{
get => modsCheckbox.Current;
set => modsCheckbox.Current = value;
}
public Action<BeatmapDetailAreaTabItem, bool> OnFilter; // passed the selected tab and if mods is checked
public IReadOnlyList<BeatmapDetailAreaTabItem> TabItems

View File

@ -29,6 +29,8 @@ namespace osu.Game.Screens.Select
private Bindable<TabType> selectedTab;
private Bindable<bool> selectedModsFilter;
public PlayBeatmapDetailArea()
{
Add(Leaderboard = new BeatmapLeaderboard { RelativeSizeAxes = Axes.Both });
@ -38,8 +40,13 @@ namespace osu.Game.Screens.Select
private void load(OsuConfigManager config)
{
selectedTab = config.GetBindable<TabType>(OsuSetting.BeatmapDetailTab);
selectedModsFilter = config.GetBindable<bool>(OsuSetting.BeatmapDetailModsFilter);
selectedTab.BindValueChanged(tab => CurrentTab.Value = getTabItemFromTabType(tab.NewValue), true);
CurrentTab.BindValueChanged(tab => selectedTab.Value = getTabTypeFromTabItem(tab.NewValue));
selectedModsFilter.BindValueChanged(checkbox => CurrentModsFilter.Value = checkbox.NewValue, true);
CurrentModsFilter.BindValueChanged(checkbox => selectedModsFilter.Value = checkbox.NewValue);
}
public override void Refresh()