1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-18 18:12:56 +08:00

Merge branch 'master' into global-track-volume-reduction

This commit is contained in:
Dean Herbert 2017-11-27 12:27:01 +09:00 committed by GitHub
commit 3e0f282d52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 106 additions and 29 deletions
osu.Desktop.Deploy
osu.Game

View File

@ -13,7 +13,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
<add key="ProjectName" value="osu.Desktop" /> <add key="ProjectName" value="osu.Desktop" />
<add key="NuSpecName" value="osu.Desktop\osu.nuspec" /> <add key="NuSpecName" value="osu.Desktop\osu.nuspec" />
<add key="SolutionName" value="osu" /> <add key="SolutionName" value="osu" />
<add key="TargetName" value="Client\osu.Desktop" /> <add key="TargetName" value="osu.Desktop" />
<add key="PackageName" value="osulazer" /> <add key="PackageName" value="osulazer" />
<add key="IconName" value="lazer.ico" /> <add key="IconName" value="lazer.ico" />
<add key="CodeSigningCertificate" value="" /> <add key="CodeSigningCertificate" value="" />

View File

@ -145,6 +145,8 @@ namespace osu.Desktop.Deploy
/// </summary> /// </summary>
private static void checkReleaseFiles() private static void checkReleaseFiles()
{ {
if (!canGitHub) return;
var releaseLines = getReleaseLines(); var releaseLines = getReleaseLines();
//ensure we have all files necessary //ensure we have all files necessary
@ -157,6 +159,8 @@ namespace osu.Desktop.Deploy
private static void pruneReleases() private static void pruneReleases()
{ {
if (!canGitHub) return;
write("Pruning RELEASES..."); write("Pruning RELEASES...");
var releaseLines = getReleaseLines().ToList(); var releaseLines = getReleaseLines().ToList();
@ -190,7 +194,7 @@ namespace osu.Desktop.Deploy
private static void uploadBuild(string version) private static void uploadBuild(string version)
{ {
if (string.IsNullOrEmpty(GitHubAccessToken) || string.IsNullOrEmpty(codeSigningCertPath)) if (!canGitHub || string.IsNullOrEmpty(CodeSigningCertificate))
return; return;
write("Publishing to GitHub..."); write("Publishing to GitHub...");
@ -228,8 +232,12 @@ namespace osu.Desktop.Deploy
private static void openGitHubReleasePage() => Process.Start(GitHubReleasePage); private static void openGitHubReleasePage() => Process.Start(GitHubReleasePage);
private static bool canGitHub => !string.IsNullOrEmpty(GitHubAccessToken);
private static void checkGitHubReleases() private static void checkGitHubReleases()
{ {
if (!canGitHub) return;
write("Checking GitHub releases..."); write("Checking GitHub releases...");
var req = new JsonWebRequest<List<GitHubRelease>>($"{GitHubApiEndpoint}"); var req = new JsonWebRequest<List<GitHubRelease>>($"{GitHubApiEndpoint}");
req.AuthenticatedBlockingPerform(); req.AuthenticatedBlockingPerform();

View File

@ -3,12 +3,15 @@
using System; using System;
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Input; using osu.Framework.Input;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
namespace osu.Game.Beatmaps.Drawables namespace osu.Game.Beatmaps.Drawables
{ {
@ -22,6 +25,10 @@ namespace osu.Game.Beatmaps.Drawables
private readonly Container nestedContainer; private readonly Container nestedContainer;
private readonly Container borderContainer;
private readonly Box hoverLayer;
protected override Container<Drawable> Content => nestedContainer; protected override Container<Drawable> Content => nestedContainer;
protected Panel() protected Panel()
@ -29,20 +36,53 @@ namespace osu.Game.Beatmaps.Drawables
Height = MAX_HEIGHT; Height = MAX_HEIGHT;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AddInternal(nestedContainer = new Container AddInternal(borderContainer = new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Masking = true, Masking = true,
CornerRadius = 10, CornerRadius = 10,
BorderColour = new Color4(221, 255, 255, 255), BorderColour = new Color4(221, 255, 255, 255),
Children = new Drawable[]
{
nestedContainer = new Container
{
RelativeSizeAxes = Axes.Both,
},
hoverLayer = new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = 0,
Blending = BlendingMode.Additive,
},
}
}); });
Alpha = 0; Alpha = 0;
} }
protected override bool OnHover(InputState state)
{
hoverLayer.FadeIn(100, Easing.OutQuint);
return base.OnHover(state);
}
protected override void OnHoverLost(InputState state)
{
hoverLayer.FadeOut(1000, Easing.OutQuint);
base.OnHoverLost(state);
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
hoverLayer.Colour = colours.Blue.Opacity(0.1f);
}
public void SetMultiplicativeAlpha(float alpha) public void SetMultiplicativeAlpha(float alpha)
{ {
nestedContainer.Alpha = alpha; borderContainer.Alpha = alpha;
} }
protected override void LoadComplete() protected override void LoadComplete()
@ -94,8 +134,8 @@ namespace osu.Game.Beatmaps.Drawables
protected virtual void Selected() protected virtual void Selected()
{ {
nestedContainer.BorderThickness = 2.5f; borderContainer.BorderThickness = 2.5f;
nestedContainer.EdgeEffect = new EdgeEffectParameters borderContainer.EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Glow, Type = EdgeEffectType.Glow,
Colour = new Color4(130, 204, 255, 150), Colour = new Color4(130, 204, 255, 150),
@ -106,8 +146,8 @@ namespace osu.Game.Beatmaps.Drawables
protected virtual void Deselected() protected virtual void Deselected()
{ {
nestedContainer.BorderThickness = 0; borderContainer.BorderThickness = 0;
nestedContainer.EdgeEffect = new EdgeEffectParameters borderContainer.EdgeEffect = new EdgeEffectParameters
{ {
Type = EdgeEffectType.Shadow, Type = EdgeEffectType.Shadow,
Offset = new Vector2(1), Offset = new Vector2(1),

View File

@ -16,6 +16,7 @@ namespace osu.Game.Configuration
Set(OsuSetting.Ruleset, 0, 0, int.MaxValue); Set(OsuSetting.Ruleset, 0, 0, int.MaxValue);
Set(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Details); Set(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Details);
Set(OsuSetting.ShowConvertedBeatmaps, true);
Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10, 0.1); Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10, 0.1);
Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10, 0.1); Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10, 0.1);
@ -112,6 +113,7 @@ namespace osu.Game.Configuration
SnakingOutSliders, SnakingOutSliders,
ShowFpsDisplay, ShowFpsDisplay,
ChatDisplayHeight, ChatDisplayHeight,
Version Version,
ShowConvertedBeatmaps
} }
} }

View File

@ -57,19 +57,31 @@ namespace osu.Game.Graphics
private void load(FontStore store) private void load(FontStore store)
{ {
this.store = store; this.store = store;
updateTexture(); updateTexture();
} }
protected override void LoadComplete()
{
base.LoadComplete();
updateTexture();
}
private FontAwesome loadedIcon;
private void updateTexture() private void updateTexture()
{ {
var texture = store?.Get(((char)icon).ToString()); var loadableIcon = icon;
if (loadableIcon == loadedIcon) return;
var texture = store?.Get(((char)loadableIcon).ToString());
spriteMain.Texture = texture; spriteMain.Texture = texture;
spriteShadow.Texture = texture; spriteShadow.Texture = texture;
if (Size == Vector2.Zero) if (Size == Vector2.Zero)
Size = new Vector2(texture?.DisplayWidth ?? 0, texture?.DisplayHeight ?? 0); Size = new Vector2(texture?.DisplayWidth ?? 0, texture?.DisplayHeight ?? 0);
loadedIcon = loadableIcon;
} }
public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true) public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true)

View File

@ -234,7 +234,7 @@ namespace osu.Game.Overlays.BeatmapSet
private void handleBeatmapAdd(BeatmapSetInfo beatmap) private void handleBeatmapAdd(BeatmapSetInfo beatmap)
{ {
if (beatmap.OnlineBeatmapSetID == BeatmapSet.OnlineBeatmapSetID) if (beatmap.OnlineBeatmapSetID == BeatmapSet?.OnlineBeatmapSetID)
downloadButtonsContainer.FadeOut(transition_duration); downloadButtonsContainer.FadeOut(transition_duration);
} }

View File

@ -50,7 +50,7 @@ namespace osu.Game.Overlays
{ {
if (beatmapSets?.Equals(value) ?? false) return; if (beatmapSets?.Equals(value) ?? false) return;
beatmapSets = value; beatmapSets = value?.ToList();
if (beatmapSets == null) return; if (beatmapSets == null) return;
@ -65,8 +65,6 @@ namespace osu.Game.Overlays
} }
ResultAmounts = new ResultCounts(distinctCount(artists), distinctCount(songs), distinctCount(tags)); ResultAmounts = new ResultCounts(distinctCount(artists), distinctCount(songs), distinctCount(tags));
recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value);
} }
} }
@ -282,7 +280,11 @@ namespace osu.Game.Overlays
var sets = response.Select(r => r.ToBeatmapSet(rulesets)).Where(b => !presentOnlineIds.Contains(b.OnlineBeatmapSetID)).ToList(); var sets = response.Select(r => r.ToBeatmapSet(rulesets)).Where(b => !presentOnlineIds.Contains(b.OnlineBeatmapSetID)).ToList();
// may not need scheduling; loads async internally. // may not need scheduling; loads async internally.
Schedule(() => BeatmapSets = sets); Schedule(() =>
{
BeatmapSets = sets;
recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value);
});
}); });
}; };

View File

@ -17,6 +17,11 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new SettingsCheckbox
{
LabelText = "Show converted beatmaps",
Bindable = config.GetBindable<bool>(OsuSetting.ShowConvertedBeatmaps),
},
new SettingsSlider<double, StarSlider> new SettingsSlider<double, StarSlider>
{ {
LabelText = "Display beatmaps from", LabelText = "Display beatmaps from",
@ -33,7 +38,7 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
{ {
LabelText = "Random beatmap selection", LabelText = "Random beatmap selection",
Bindable = config.GetBindable<SelectionRandomType>(OsuSetting.SelectionRandomType), Bindable = config.GetBindable<SelectionRandomType>(OsuSetting.SelectionRandomType),
}, }
}; };
} }

View File

@ -22,8 +22,6 @@ namespace osu.Game.Screens.Play
{ {
public bool IsPaused { get; private set; } public bool IsPaused { get; private set; }
public bool AllowExit => IsPaused && pauseOverlay.Alpha == 1;
public Func<bool> CheckCanPause; public Func<bool> CheckCanPause;
private const double pause_cooldown = 1000; private const double pause_cooldown = 1000;

View File

@ -310,7 +310,7 @@ namespace osu.Game.Screens.Play
if (!loadedSuccessfully) if (!loadedSuccessfully)
return; return;
(Background as BackgroundScreenBeatmap)?.BlurTo(Vector2.Zero, 1500, Easing.OutQuint); (Background as BackgroundScreenBeatmap)?.BlurTo(Vector2.Zero, 1000, Easing.OutQuint);
dimLevel.ValueChanged += dimLevel_ValueChanged; dimLevel.ValueChanged += dimLevel_ValueChanged;
showStoryboard.ValueChanged += showStoryboard_ValueChanged; showStoryboard.ValueChanged += showStoryboard_ValueChanged;
@ -357,7 +357,7 @@ namespace osu.Game.Screens.Play
protected override bool OnExiting(Screen next) protected override bool OnExiting(Screen next)
{ {
if (!AllowPause || HasFailed || !ValidForResume || pauseContainer?.AllowExit != false || RulesetContainer?.HasReplayLoaded != false) if (!AllowPause || HasFailed || !ValidForResume || pauseContainer?.IsPaused != false || RulesetContainer?.HasReplayLoaded != false)
{ {
// In the case of replays, we may have changed the playback rate. // In the case of replays, we may have changed the playback rate.
applyRateFromMods(); applyRateFromMods();

View File

@ -31,15 +31,15 @@ namespace osu.Game.Screens.Select.Details
const int rating_range = 10; const int rating_range = 10;
var ratings = Metrics.Ratings.ToList().GetRange(1, rating_range); // adjust for API returning weird empty data at 0. var ratings = Metrics.Ratings.Skip(1).Take(rating_range); // adjust for API returning weird empty data at 0.
var negativeCount = ratings.GetRange(0, rating_range / 2).Sum(); var negativeCount = ratings.Take(rating_range / 2).Sum();
var totalCount = ratings.Sum(); var totalCount = ratings.Sum();
negativeRatings.Text = negativeCount.ToString(); negativeRatings.Text = negativeCount.ToString();
positiveRatings.Text = (totalCount - negativeCount).ToString(); positiveRatings.Text = (totalCount - negativeCount).ToString();
ratingsBar.Length = totalCount == 0 ? 0 : (float)negativeCount / totalCount; ratingsBar.Length = totalCount == 0 ? 0 : (float)negativeCount / totalCount;
graph.Values = ratings.GetRange(0, rating_range).Select(r => (float)r); graph.Values = ratings.Take(rating_range).Select(r => (float)r);
} }
} }

View File

@ -15,6 +15,7 @@ using osu.Game.Screens.Select.Filter;
using Container = osu.Framework.Graphics.Containers.Container; using Container = osu.Framework.Graphics.Containers.Container;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Game.Configuration;
using osu.Game.Rulesets; using osu.Game.Rulesets;
namespace osu.Game.Screens.Select namespace osu.Game.Screens.Select
@ -60,6 +61,7 @@ namespace osu.Game.Screens.Select
Group = group, Group = group,
Sort = sort, Sort = sort,
SearchText = searchTextBox.Text, SearchText = searchTextBox.Text,
AllowConvertedBeatmaps = showConverted,
Ruleset = ruleset Ruleset = ruleset
}; };
@ -163,17 +165,24 @@ namespace osu.Game.Screens.Select
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>(); private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
private Bindable<bool> showConverted;
[BackgroundDependencyLoader(permitNulls: true)] [BackgroundDependencyLoader(permitNulls: true)]
private void load(OsuColour colours, OsuGame osu) private void load(OsuColour colours, OsuGame osu, OsuConfigManager config)
{ {
sortTabs.AccentColour = colours.GreenLight; sortTabs.AccentColour = colours.GreenLight;
showConverted = config.GetBindable<bool>(OsuSetting.ShowConvertedBeatmaps);
showConverted.ValueChanged += val => updateCriteria();
if (osu != null) if (osu != null)
ruleset.BindTo(osu.Ruleset); ruleset.BindTo(osu.Ruleset);
ruleset.ValueChanged += val => FilterChanged?.Invoke(CreateCriteria()); ruleset.ValueChanged += val => updateCriteria();
ruleset.TriggerChange(); ruleset.TriggerChange();
} }
private void updateCriteria() => FilterChanged?.Invoke(CreateCriteria());
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true; protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
protected override bool OnMouseMove(InputState state) => true; protected override bool OnMouseMove(InputState state) => true;

View File

@ -16,6 +16,7 @@ namespace osu.Game.Screens.Select
public SortMode Sort; public SortMode Sort;
public string SearchText; public string SearchText;
public RulesetInfo Ruleset; public RulesetInfo Ruleset;
public bool AllowConvertedBeatmaps;
public void Filter(List<BeatmapGroup> groups) public void Filter(List<BeatmapGroup> groups)
{ {
@ -23,7 +24,7 @@ namespace osu.Game.Screens.Select
{ {
var set = g.BeatmapSet; var set = g.BeatmapSet;
bool hasCurrentMode = set.Beatmaps.Any(bm => bm.RulesetID == (Ruleset?.ID ?? 0)); bool hasCurrentMode = AllowConvertedBeatmaps || set.Beatmaps.Any(bm => bm.RulesetID == (Ruleset?.ID ?? 0));
bool match = hasCurrentMode; bool match = hasCurrentMode;

View File

@ -413,7 +413,7 @@ namespace osu.Game.Screens.Select
if (backgroundModeBeatmap != null) if (backgroundModeBeatmap != null)
{ {
backgroundModeBeatmap.Beatmap = beatmap; backgroundModeBeatmap.Beatmap = beatmap;
backgroundModeBeatmap.BlurTo(background_blur, 1000); backgroundModeBeatmap.BlurTo(background_blur, 750, Easing.OutQuint);
backgroundModeBeatmap.FadeTo(1, 250); backgroundModeBeatmap.FadeTo(1, 250);
} }