1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 11:22:58 +08:00

Merge branch 'master' into cancel-api-callback

This commit is contained in:
Dan Balasescu 2019-06-25 18:43:33 +09:00 committed by GitHub
commit ffcd3529a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 28 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -73,7 +74,10 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
{ {
case OsuAction.LeftButton: case OsuAction.LeftButton:
case OsuAction.RightButton: case OsuAction.RightButton:
if (--downCount == 0) // Todo: Math.Max() is required as a temporary measure to address https://github.com/ppy/osu-framework/issues/2576
downCount = Math.Max(0, downCount - 1);
if (downCount == 0)
updateExpandedState(); updateExpandedState();
break; break;
} }

View File

@ -95,9 +95,6 @@ namespace osu.Game.Input.Bindings
[Description("Quick retry (hold)")] [Description("Quick retry (hold)")]
QuickRetry, QuickRetry,
[Description("Quick exit (Hold)")]
QuickExit,
[Description("Take screenshot")] [Description("Take screenshot")]
TakeScreenshot, TakeScreenshot,
@ -115,5 +112,8 @@ namespace osu.Game.Input.Bindings
[Description("Select")] [Description("Select")]
Select, Select,
[Description("Quick exit (Hold)")]
QuickExit,
} }
} }

View File

@ -73,7 +73,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
private class AudioDeviceSettingsDropdown : SettingsDropdown<string> private class AudioDeviceSettingsDropdown : SettingsDropdown<string>
{ {
protected override OsuDropdown<string> CreateDropdown() => new AudioDeviceDropdownControl { Items = Items }; protected override OsuDropdown<string> CreateDropdown() => new AudioDeviceDropdownControl();
private class AudioDeviceDropdownControl : DropdownControl private class AudioDeviceDropdownControl : DropdownControl
{ {

View File

@ -237,7 +237,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
private class ResolutionSettingsDropdown : SettingsDropdown<Size> private class ResolutionSettingsDropdown : SettingsDropdown<Size>
{ {
protected override OsuDropdown<Size> CreateDropdown() => new ResolutionDropdownControl { Items = Items }; protected override OsuDropdown<Size> CreateDropdown() => new ResolutionDropdownControl();
private class ResolutionDropdownControl : DropdownControl private class ResolutionDropdownControl : DropdownControl
{ {

View File

@ -108,7 +108,7 @@ namespace osu.Game.Overlays.Settings.Sections
private class SkinSettingsDropdown : SettingsDropdown<SkinInfo> private class SkinSettingsDropdown : SettingsDropdown<SkinInfo>
{ {
protected override OsuDropdown<SkinInfo> CreateDropdown() => new SkinDropdownControl { Items = Items }; protected override OsuDropdown<SkinInfo> CreateDropdown() => new SkinDropdownControl();
private class SkinDropdownControl : DropdownControl private class SkinDropdownControl : DropdownControl
{ {

View File

@ -13,39 +13,23 @@ namespace osu.Game.Overlays.Settings
{ {
protected new OsuDropdown<T> Control => (OsuDropdown<T>)base.Control; protected new OsuDropdown<T> Control => (OsuDropdown<T>)base.Control;
private IEnumerable<T> items = Enumerable.Empty<T>();
public IEnumerable<T> Items public IEnumerable<T> Items
{ {
get => items; get => Control.Items;
set set => Control.Items = value;
{
items = value;
if (Control != null)
Control.Items = value;
} }
}
private IBindableList<T> itemSource;
public IBindableList<T> ItemSource public IBindableList<T> ItemSource
{ {
get => itemSource; get => Control.ItemSource;
set set => Control.ItemSource = value;
{
itemSource = value;
if (Control != null)
Control.ItemSource = value;
}
} }
public override IEnumerable<string> FilterTerms => base.FilterTerms.Concat(Control.Items.Select(i => i.ToString())); public override IEnumerable<string> FilterTerms => base.FilterTerms.Concat(Control.Items.Select(i => i.ToString()));
protected sealed override Drawable CreateControl() => CreateDropdown(); protected sealed override Drawable CreateControl() => CreateDropdown();
protected virtual OsuDropdown<T> CreateDropdown() => new DropdownControl { Items = Items, ItemSource = ItemSource }; protected virtual OsuDropdown<T> CreateDropdown() => new DropdownControl();
protected class DropdownControl : OsuDropdown<T> protected class DropdownControl : OsuDropdown<T>
{ {