mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 01:47:30 +09:00
Merge remote-tracking branch 'refs/remotes/ppy/master' into toolbar-rulesets-refactor
This commit is contained in:
commit
bae0258d8d
@ -72,7 +72,7 @@ If the build fails, try to restore nuget packages with `dotnet restore`.
|
|||||||
|
|
||||||
On Linux, the environment variable `LD_LIBRARY_PATH` must point to the build directory, located at `osu.Desktop/bin/Debug/$NETCORE_VERSION`.
|
On Linux, the environment variable `LD_LIBRARY_PATH` must point to the build directory, located at `osu.Desktop/bin/Debug/$NETCORE_VERSION`.
|
||||||
|
|
||||||
`$NETCORE_VERSION` is the version of .NET Core SDK. You can have it with `grep TargetFramework osu.Desktop/osu.Desktop.csproj | sed -r 's/.*>(.*)<\/.*/\1/'`.
|
`$NETCORE_VERSION` is the version of the targeted .NET Core SDK. You can check it by running `grep TargetFramework osu.Desktop/osu.Desktop.csproj | sed -r 's/.*>(.*)<\/.*/\1/'`.
|
||||||
|
|
||||||
For example, you can run osu! with the following command:
|
For example, you can run osu! with the following command:
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
@ -97,6 +98,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
protected override DrawableMenuItem CreateDrawableMenuItem(MenuItem item) => new DrawableOsuDropdownMenuItem(item) { AccentColour = accentColour };
|
protected override DrawableMenuItem CreateDrawableMenuItem(MenuItem item) => new DrawableOsuDropdownMenuItem(item) { AccentColour = accentColour };
|
||||||
|
|
||||||
|
protected override ScrollContainer<Drawable> CreateScrollContainer(Direction direction) => new OsuScrollContainer(direction);
|
||||||
|
|
||||||
#region DrawableOsuDropdownMenuItem
|
#region DrawableOsuDropdownMenuItem
|
||||||
|
|
||||||
public class DrawableOsuDropdownMenuItem : DrawableDropdownMenuItem, IHasAccentColour
|
public class DrawableOsuDropdownMenuItem : DrawableDropdownMenuItem, IHasAccentColour
|
||||||
@ -247,8 +250,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Icon = FontAwesome.Solid.ChevronDown,
|
Icon = FontAwesome.Solid.ChevronDown,
|
||||||
Anchor = Anchor.CentreRight,
|
Anchor = Anchor.CentreRight,
|
||||||
Origin = Anchor.CentreRight,
|
Origin = Anchor.CentreRight,
|
||||||
Margin = new MarginPadding { Right = 4 },
|
Margin = new MarginPadding { Right = 5 },
|
||||||
Size = new Vector2(20),
|
Size = new Vector2(12),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
@ -46,6 +47,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
protected override DrawableMenuItem CreateDrawableMenuItem(MenuItem item) => new DrawableOsuMenuItem(item);
|
protected override DrawableMenuItem CreateDrawableMenuItem(MenuItem item) => new DrawableOsuMenuItem(item);
|
||||||
|
|
||||||
|
protected override ScrollContainer<Drawable> CreateScrollContainer(Direction direction) => new OsuScrollContainer(direction);
|
||||||
|
|
||||||
protected override Menu CreateSubMenu() => new OsuMenu(Direction.Vertical)
|
protected override Menu CreateSubMenu() => new OsuMenu(Direction.Vertical)
|
||||||
{
|
{
|
||||||
Anchor = Direction == Direction.Horizontal ? Anchor.BottomLeft : Anchor.TopRight
|
Anchor = Direction == Direction.Horizontal ? Anchor.BottomLeft : Anchor.TopRight
|
||||||
|
@ -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,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,12 @@ namespace osu.Game.Online.API
|
|||||||
if (checkAndScheduleFailure())
|
if (checkAndScheduleFailure())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
API.Schedule(delegate { Success?.Invoke(); });
|
API.Schedule(delegate
|
||||||
|
{
|
||||||
|
if (cancelled) return;
|
||||||
|
|
||||||
|
Success?.Invoke();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Cancel() => Fail(new OperationCanceledException(@"Request cancelled"));
|
public void Cancel() => Fail(new OperationCanceledException(@"Request cancelled"));
|
||||||
|
@ -8,7 +8,6 @@ using osu.Framework.Graphics.Colour;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Effects;
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
@ -40,6 +39,10 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
|
|
||||||
private readonly FavouriteButton favouriteButton;
|
private readonly FavouriteButton favouriteButton;
|
||||||
|
|
||||||
|
private readonly FillFlowContainer fadeContent;
|
||||||
|
|
||||||
|
private readonly LoadingAnimation loading;
|
||||||
|
|
||||||
public Header()
|
public Header()
|
||||||
{
|
{
|
||||||
ExternalLinkButton externalLink;
|
ExternalLinkButton externalLink;
|
||||||
@ -96,8 +99,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.Both,
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Padding = new MarginPadding
|
Padding = new MarginPadding
|
||||||
{
|
{
|
||||||
Top = 20,
|
Top = 20,
|
||||||
@ -105,63 +107,71 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
Left = BeatmapSetOverlay.X_PADDING,
|
Left = BeatmapSetOverlay.X_PADDING,
|
||||||
Right = BeatmapSetOverlay.X_PADDING + BeatmapSetOverlay.RIGHT_WIDTH,
|
Right = BeatmapSetOverlay.X_PADDING + BeatmapSetOverlay.RIGHT_WIDTH,
|
||||||
},
|
},
|
||||||
Child = new FillFlowContainer
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
fadeContent = new FillFlowContainer
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Direction = FillDirection.Vertical,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
{
|
||||||
new Container
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
new Container
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Child = Picker = new BeatmapPicker(),
|
|
||||||
},
|
|
||||||
new FillFlowContainer
|
|
||||||
{
|
|
||||||
Direction = FillDirection.Horizontal,
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
{
|
||||||
title = new OsuSpriteText
|
RelativeSizeAxes = Axes.X,
|
||||||
{
|
AutoSizeAxes = Axes.Y,
|
||||||
Font = OsuFont.GetFont(size: 37, weight: FontWeight.Bold, italics: true)
|
Child = Picker = new BeatmapPicker(),
|
||||||
},
|
},
|
||||||
externalLink = new ExternalLinkButton
|
new FillFlowContainer
|
||||||
{
|
|
||||||
Anchor = Anchor.BottomLeft,
|
|
||||||
Origin = Anchor.BottomLeft,
|
|
||||||
Margin = new MarginPadding { Left = 3, Bottom = 4 }, //To better lineup with the font
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
artist = new OsuSpriteText { Font = OsuFont.GetFont(size: 25, weight: FontWeight.SemiBold, italics: true) },
|
|
||||||
new Container
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Margin = new MarginPadding { Top = 20 },
|
|
||||||
Child = author = new AuthorInfo(),
|
|
||||||
},
|
|
||||||
new Container
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
Height = buttons_height,
|
|
||||||
Margin = new MarginPadding { Top = 10 },
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
{
|
||||||
favouriteButton = new FavouriteButton(),
|
Direction = FillDirection.Horizontal,
|
||||||
downloadButtonsContainer = new FillFlowContainer
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
title = new OsuSpriteText
|
||||||
Padding = new MarginPadding { Left = buttons_height + buttons_spacing },
|
{
|
||||||
Spacing = new Vector2(buttons_spacing),
|
Font = OsuFont.GetFont(size: 37, weight: FontWeight.Bold, italics: true)
|
||||||
|
},
|
||||||
|
externalLink = new ExternalLinkButton
|
||||||
|
{
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Origin = Anchor.BottomLeft,
|
||||||
|
Margin = new MarginPadding { Left = 3, Bottom = 4 }, //To better lineup with the font
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
artist = new OsuSpriteText { Font = OsuFont.GetFont(size: 25, weight: FontWeight.SemiBold, italics: true) },
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Margin = new MarginPadding { Top = 20 },
|
||||||
|
Child = author = new AuthorInfo(),
|
||||||
|
},
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Height = buttons_height,
|
||||||
|
Margin = new MarginPadding { Top = 10 },
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
favouriteButton = new FavouriteButton(),
|
||||||
|
downloadButtonsContainer = new FillFlowContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Padding = new MarginPadding { Left = buttons_height + buttons_spacing },
|
||||||
|
Spacing = new Vector2(buttons_spacing),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
loading = new LoadingAnimation
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
@ -187,8 +197,11 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
Picker.Beatmap.ValueChanged += b => Details.Beatmap = b.NewValue;
|
Picker.Beatmap.ValueChanged += b =>
|
||||||
Picker.Beatmap.ValueChanged += b => externalLink.Link = $@"https://osu.ppy.sh/beatmapsets/{BeatmapSet.Value?.OnlineBeatmapSetID}#{b.NewValue?.Ruleset.ShortName}/{b.NewValue?.OnlineBeatmapID}";
|
{
|
||||||
|
Details.Beatmap = b.NewValue;
|
||||||
|
externalLink.Link = $@"https://osu.ppy.sh/beatmapsets/{BeatmapSet.Value?.OnlineBeatmapSetID}#{b.NewValue?.Ruleset.ShortName}/{b.NewValue?.OnlineBeatmapID}";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -201,24 +214,35 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
BeatmapSet.BindValueChanged(setInfo =>
|
BeatmapSet.BindValueChanged(setInfo =>
|
||||||
{
|
{
|
||||||
Picker.BeatmapSet = author.BeatmapSet = Details.BeatmapSet = setInfo.NewValue;
|
Picker.BeatmapSet = author.BeatmapSet = Details.BeatmapSet = setInfo.NewValue;
|
||||||
|
|
||||||
title.Text = setInfo.NewValue?.Metadata.Title ?? string.Empty;
|
|
||||||
artist.Text = setInfo.NewValue?.Metadata.Artist ?? string.Empty;
|
|
||||||
onlineStatusPill.Status = setInfo.NewValue?.OnlineInfo.Status ?? BeatmapSetOnlineStatus.None;
|
|
||||||
cover.BeatmapSet = setInfo.NewValue;
|
cover.BeatmapSet = setInfo.NewValue;
|
||||||
|
|
||||||
if (setInfo.NewValue != null)
|
if (setInfo.NewValue == null)
|
||||||
{
|
|
||||||
downloadButtonsContainer.FadeIn(transition_duration);
|
|
||||||
favouriteButton.FadeIn(transition_duration);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
|
onlineStatusPill.FadeTo(0.5f, 500, Easing.OutQuint);
|
||||||
|
fadeContent.Hide();
|
||||||
|
|
||||||
|
loading.Show();
|
||||||
|
|
||||||
downloadButtonsContainer.FadeOut(transition_duration);
|
downloadButtonsContainer.FadeOut(transition_duration);
|
||||||
favouriteButton.FadeOut(transition_duration);
|
favouriteButton.FadeOut(transition_duration);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fadeContent.FadeIn(500, Easing.OutQuint);
|
||||||
|
|
||||||
updateDownloadButtons();
|
loading.Hide();
|
||||||
|
|
||||||
|
title.Text = setInfo.NewValue.Metadata.Title ?? string.Empty;
|
||||||
|
artist.Text = setInfo.NewValue.Metadata.Artist ?? string.Empty;
|
||||||
|
|
||||||
|
onlineStatusPill.FadeIn(500, Easing.OutQuint);
|
||||||
|
onlineStatusPill.Status = setInfo.NewValue.OnlineInfo.Status;
|
||||||
|
|
||||||
|
downloadButtonsContainer.FadeIn(transition_duration);
|
||||||
|
favouriteButton.FadeIn(transition_duration);
|
||||||
|
|
||||||
|
updateDownloadButtons();
|
||||||
|
}
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
Size = new Vector2(40),
|
Size = new Vector2(40),
|
||||||
FillMode = FillMode.Fit,
|
FillMode = FillMode.Fit,
|
||||||
},
|
},
|
||||||
avatar = new UpdateableAvatar
|
avatar = new UpdateableAvatar(hideImmediately: true)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
@ -90,7 +90,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold)
|
Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold)
|
||||||
},
|
},
|
||||||
flag = new UpdateableFlag
|
flag = new UpdateableFlag(hideImmediately: true)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -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>
|
||||||
{
|
{
|
||||||
|
@ -247,6 +247,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
public override void OnSuspending(IScreen next)
|
public override void OnSuspending(IScreen next)
|
||||||
{
|
{
|
||||||
|
BackgroundBrightnessReduction = false;
|
||||||
base.OnSuspending(next);
|
base.OnSuspending(next);
|
||||||
cancelLoad();
|
cancelLoad();
|
||||||
}
|
}
|
||||||
@ -258,6 +259,7 @@ namespace osu.Game.Screens.Play
|
|||||||
cancelLoad();
|
cancelLoad();
|
||||||
|
|
||||||
Background.EnableUserDim.Value = false;
|
Background.EnableUserDim.Value = false;
|
||||||
|
BackgroundBrightnessReduction = false;
|
||||||
|
|
||||||
return base.OnExiting(next);
|
return base.OnExiting(next);
|
||||||
}
|
}
|
||||||
@ -273,6 +275,22 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool backgroundBrightnessReduction;
|
||||||
|
|
||||||
|
protected bool BackgroundBrightnessReduction
|
||||||
|
{
|
||||||
|
get => backgroundBrightnessReduction;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == backgroundBrightnessReduction)
|
||||||
|
return;
|
||||||
|
|
||||||
|
backgroundBrightnessReduction = value;
|
||||||
|
|
||||||
|
Background.FadeColour(OsuColour.Gray(backgroundBrightnessReduction ? 0.8f : 1), 200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
@ -287,12 +305,16 @@ namespace osu.Game.Screens.Play
|
|||||||
// Preview user-defined background dim and blur when hovered on the visual settings panel.
|
// Preview user-defined background dim and blur when hovered on the visual settings panel.
|
||||||
Background.EnableUserDim.Value = true;
|
Background.EnableUserDim.Value = true;
|
||||||
Background.BlurAmount.Value = 0;
|
Background.BlurAmount.Value = 0;
|
||||||
|
|
||||||
|
BackgroundBrightnessReduction = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Returns background dim and blur to the values specified by PlayerLoader.
|
// Returns background dim and blur to the values specified by PlayerLoader.
|
||||||
Background.EnableUserDim.Value = false;
|
Background.EnableUserDim.Value = false;
|
||||||
Background.BlurAmount.Value = BACKGROUND_BLUR;
|
Background.BlurAmount.Value = BACKGROUND_BLUR;
|
||||||
|
|
||||||
|
BackgroundBrightnessReduction = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Effects;
|
using osu.Framework.Graphics.Effects;
|
||||||
|
using osu.Framework.Graphics.Transforms;
|
||||||
|
|
||||||
namespace osu.Game.Users.Drawables
|
namespace osu.Game.Users.Drawables
|
||||||
{
|
{
|
||||||
@ -37,6 +38,8 @@ namespace osu.Game.Users.Drawables
|
|||||||
set => base.EdgeEffect = value;
|
set => base.EdgeEffect = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool TransformImmediately { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether to show a default guest representation on null user (as opposed to nothing).
|
/// Whether to show a default guest representation on null user (as opposed to nothing).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -47,11 +50,14 @@ namespace osu.Game.Users.Drawables
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly BindableBool OpenOnClick = new BindableBool(true);
|
public readonly BindableBool OpenOnClick = new BindableBool(true);
|
||||||
|
|
||||||
public UpdateableAvatar(User user = null)
|
public UpdateableAvatar(User user = null, bool hideImmediately = false)
|
||||||
{
|
{
|
||||||
|
TransformImmediately = hideImmediately;
|
||||||
User = user;
|
User = user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override TransformSequence<Drawable> ApplyHideTransforms(Drawable drawable) => TransformImmediately ? drawable?.FadeOut() : base.ApplyHideTransforms(drawable);
|
||||||
|
|
||||||
protected override Drawable CreateDrawable(User user)
|
protected override Drawable CreateDrawable(User user)
|
||||||
{
|
{
|
||||||
if (user == null && !ShowGuestOnNull)
|
if (user == null && !ShowGuestOnNull)
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Transforms;
|
||||||
|
|
||||||
namespace osu.Game.Users.Drawables
|
namespace osu.Game.Users.Drawables
|
||||||
{
|
{
|
||||||
@ -14,16 +15,21 @@ namespace osu.Game.Users.Drawables
|
|||||||
set => Model = value;
|
set => Model = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool TransformImmediately { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether to show a place holder on null country.
|
/// Whether to show a place holder on null country.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ShowPlaceholderOnNull = true;
|
public bool ShowPlaceholderOnNull = true;
|
||||||
|
|
||||||
public UpdateableFlag(Country country = null)
|
public UpdateableFlag(Country country = null, bool hideImmediately = false)
|
||||||
{
|
{
|
||||||
|
TransformImmediately = hideImmediately;
|
||||||
Country = country;
|
Country = country;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override TransformSequence<Drawable> ApplyHideTransforms(Drawable drawable) => TransformImmediately ? drawable?.FadeOut() : base.ApplyHideTransforms(drawable);
|
||||||
|
|
||||||
protected override Drawable CreateDrawable(Country country)
|
protected override Drawable CreateDrawable(Country country)
|
||||||
{
|
{
|
||||||
if (country == null && !ShowPlaceholderOnNull)
|
if (country == null && !ShowPlaceholderOnNull)
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.4" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.609.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.609.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2019.621.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2019.625.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.23.0" />
|
<PackageReference Include="SharpCompress" Version="0.23.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
@ -105,8 +105,8 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.609.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.609.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2019.621.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2019.625.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.621.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.625.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user