mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 01:02:55 +08:00
Merge branch 'master' into single-osu-logo
This commit is contained in:
commit
90fec5f370
@ -80,7 +80,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
controlWithCurrent?.Current.BindTo(bindable);
|
controlWithCurrent?.Current.BindTo(bindable);
|
||||||
if (ShowsDefaultIndicator)
|
if (ShowsDefaultIndicator)
|
||||||
{
|
{
|
||||||
restoreDefaultValueButton.Bindable.BindTo(bindable);
|
restoreDefaultValueButton.Bindable = bindable.GetBoundCopy();
|
||||||
restoreDefaultValueButton.Bindable.TriggerChange();
|
restoreDefaultValueButton.Bindable.TriggerChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -134,7 +134,17 @@ namespace osu.Game.Overlays.Settings
|
|||||||
|
|
||||||
private class RestoreDefaultValueButton<T> : Box, IHasTooltip
|
private class RestoreDefaultValueButton<T> : Box, IHasTooltip
|
||||||
{
|
{
|
||||||
internal readonly Bindable<T> Bindable = new Bindable<T>();
|
private Bindable<T> bindable;
|
||||||
|
internal Bindable<T> Bindable
|
||||||
|
{
|
||||||
|
get { return bindable; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
bindable = value;
|
||||||
|
bindable.ValueChanged += newValue => UpdateState();
|
||||||
|
bindable.DisabledChanged += disabled => UpdateState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Color4 buttonColour;
|
private Color4 buttonColour;
|
||||||
|
|
||||||
@ -142,9 +152,6 @@ namespace osu.Game.Overlays.Settings
|
|||||||
|
|
||||||
public RestoreDefaultValueButton()
|
public RestoreDefaultValueButton()
|
||||||
{
|
{
|
||||||
Bindable.ValueChanged += value => UpdateState();
|
|
||||||
Bindable.DisabledChanged += disabled => UpdateState();
|
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.Y;
|
RelativeSizeAxes = Axes.Y;
|
||||||
Width = SettingsOverlay.CONTENT_MARGINS;
|
Width = SettingsOverlay.CONTENT_MARGINS;
|
||||||
Alpha = 0f;
|
Alpha = 0f;
|
||||||
@ -160,8 +167,8 @@ namespace osu.Game.Overlays.Settings
|
|||||||
|
|
||||||
protected override bool OnClick(InputState state)
|
protected override bool OnClick(InputState state)
|
||||||
{
|
{
|
||||||
if (!Bindable.Disabled)
|
if (bindable != null && !bindable.Disabled)
|
||||||
Bindable.SetDefault();
|
bindable.SetDefault();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,8 +193,10 @@ namespace osu.Game.Overlays.Settings
|
|||||||
|
|
||||||
internal void UpdateState()
|
internal void UpdateState()
|
||||||
{
|
{
|
||||||
var colour = Bindable.Disabled ? Color4.Gray : buttonColour;
|
if (bindable == null)
|
||||||
this.FadeTo(Bindable.IsDefault ? 0f : hovering && !Bindable.Disabled ? 1f : 0.5f, 200, Easing.OutQuint);
|
return;
|
||||||
|
var colour = bindable.Disabled ? Color4.Gray : buttonColour;
|
||||||
|
this.FadeTo(bindable.IsDefault ? 0f : hovering && !bindable.Disabled ? 1f : 0.5f, 200, Easing.OutQuint);
|
||||||
this.FadeColour(ColourInfo.GradientHorizontal(colour.Opacity(0.8f), colour.Opacity(0)), 200, Easing.OutQuint);
|
this.FadeColour(ColourInfo.GradientHorizontal(colour.Opacity(0.8f), colour.Opacity(0)), 200, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,9 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
welcome = audio.Sample.Get(@"welcome");
|
welcome = audio.Sample.Get(@"welcome");
|
||||||
seeya = audio.Sample.Get(@"seeya");
|
seeya = audio.Sample.Get(@"seeya");
|
||||||
beatmaps.Delete(setInfo);
|
|
||||||
|
if (setInfo.Protected)
|
||||||
|
beatmaps.Delete(setInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnEntering(Screen last)
|
protected override void OnEntering(Screen last)
|
||||||
|
@ -186,13 +186,18 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
public Action<BeatmapInfo> HideDifficultyRequested;
|
public Action<BeatmapInfo> HideDifficultyRequested;
|
||||||
|
|
||||||
|
private void selectNullBeatmap()
|
||||||
|
{
|
||||||
|
selectedGroup = null;
|
||||||
|
selectedPanel = null;
|
||||||
|
SelectionChanged?.Invoke(null);
|
||||||
|
}
|
||||||
|
|
||||||
public void SelectNext(int direction = 1, bool skipDifficulties = true)
|
public void SelectNext(int direction = 1, bool skipDifficulties = true)
|
||||||
{
|
{
|
||||||
if (groups.All(g => g.State == BeatmapGroupState.Hidden))
|
if (groups.All(g => g.State == BeatmapGroupState.Hidden))
|
||||||
{
|
{
|
||||||
selectedGroup = null;
|
selectNullBeatmap();
|
||||||
selectedPanel = null;
|
|
||||||
SelectionChanged?.Invoke(null);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -383,6 +388,14 @@ namespace osu.Game.Screens.Select
|
|||||||
if (group == null)
|
if (group == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (selectedGroup == group)
|
||||||
|
{
|
||||||
|
if (getVisibleGroups().Count() == 1)
|
||||||
|
selectNullBeatmap();
|
||||||
|
else
|
||||||
|
SelectNext();
|
||||||
|
}
|
||||||
|
|
||||||
groups.Remove(group);
|
groups.Remove(group);
|
||||||
panels.Remove(group.Header);
|
panels.Remove(group.Header);
|
||||||
foreach (var p in group.BeatmapPanels)
|
foreach (var p in group.BeatmapPanels)
|
||||||
@ -391,9 +404,6 @@ namespace osu.Game.Screens.Select
|
|||||||
scrollableContent.Remove(group.Header);
|
scrollableContent.Remove(group.Header);
|
||||||
scrollableContent.RemoveRange(group.BeatmapPanels);
|
scrollableContent.RemoveRange(group.BeatmapPanels);
|
||||||
|
|
||||||
if (selectedGroup == group)
|
|
||||||
SelectNext();
|
|
||||||
|
|
||||||
computeYPositions();
|
computeYPositions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user