Merge branch 'master' into fix-early-exit-test-failures

This commit is contained in:
Dean Herbert 2020-08-18 13:05:24 +09:00 committed by GitHub
commit ab0068a9af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 8 deletions

View File

@ -16,7 +16,7 @@
<EmbeddedResource Include="Resources\**\*.*" /> <EmbeddedResource Include="Resources\**\*.*" />
</ItemGroup> </ItemGroup>
<ItemGroup Label="Code Analysis"> <ItemGroup Label="Code Analysis">
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.0.0" PrivateAssets="All" /> <PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.0" PrivateAssets="All" />
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CodeAnalysis\BannedSymbols.txt" /> <AdditionalFiles Include="$(MSBuildThisFileDirectory)CodeAnalysis\BannedSymbols.txt" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0" PrivateAssets="All" /> <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0" PrivateAssets="All" />
</ItemGroup> </ItemGroup>

View File

@ -12,6 +12,7 @@ using osu.Game.Graphics;
using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
using osu.Game.Rulesets.Osu.Skinning;
using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;
using osu.Game.Screens.Ranking; using osu.Game.Screens.Ranking;
using osu.Game.Skinning; using osu.Game.Skinning;
@ -31,6 +32,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
private readonly IBindable<Vector2> positionBindable = new Bindable<Vector2>(); private readonly IBindable<Vector2> positionBindable = new Bindable<Vector2>();
private bool spinnerFrequencyModulate;
public DrawableSpinner(Spinner s) public DrawableSpinner(Spinner s)
: base(s) : base(s)
{ {
@ -82,6 +85,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
} }
private SkinnableSound spinningSample; private SkinnableSound spinningSample;
private const float spinning_sample_initial_frequency = 1.0f;
private const float spinning_sample_modulated_base_frequency = 0.5f;
protected override void LoadSamples() protected override void LoadSamples()
{ {
@ -101,6 +106,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{ {
Volume = { Value = 0 }, Volume = { Value = 0 },
Looping = true, Looping = true,
Frequency = { Value = spinning_sample_initial_frequency }
}); });
} }
} }
@ -171,6 +177,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
positionBindable.BindTo(HitObject.PositionBindable); positionBindable.BindTo(HitObject.PositionBindable);
} }
protected override void ApplySkin(ISkinSource skin, bool allowFallback)
{
base.ApplySkin(skin, allowFallback);
spinnerFrequencyModulate = skin.GetConfig<OsuSkinConfiguration, bool>(OsuSkinConfiguration.SpinnerFrequencyModulate)?.Value ?? true;
}
/// <summary> /// <summary>
/// The completion progress of this spinner from 0..1 (clamped). /// The completion progress of this spinner from 0..1 (clamped).
/// </summary> /// </summary>
@ -220,9 +232,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
if (HandleUserInput) if (HandleUserInput)
RotationTracker.Tracking = !Result.HasResult && (OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false); RotationTracker.Tracking = !Result.HasResult && (OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false);
if (spinningSample != null) if (spinningSample != null && spinnerFrequencyModulate)
// todo: implement SpinnerFrequencyModulate spinningSample.Frequency.Value = spinning_sample_modulated_base_frequency + Progress;
spinningSample.Frequency.Value = 0.5f + Progress;
} }
protected override void UpdateAfterChildren() protected override void UpdateAfterChildren()

View File

@ -13,6 +13,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
CursorExpand, CursorExpand,
CursorRotate, CursorRotate,
HitCircleOverlayAboveNumber, HitCircleOverlayAboveNumber,
HitCircleOverlayAboveNumer // Some old skins will have this typo HitCircleOverlayAboveNumer, // Some old skins will have this typo
SpinnerFrequencyModulate
} }
} }

View File

@ -118,9 +118,9 @@ namespace osu.Game.Overlays.Toolbar
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Alpha = 0, Alpha = 0,
Height = 90, Height = 100,
Colour = ColourInfo.GradientVertical( Colour = ColourInfo.GradientVertical(
OsuColour.Gray(0.1f).Opacity(0.5f), OsuColour.Gray(0.1f).Opacity(0)), OsuColour.Gray(0).Opacity(0.9f), OsuColour.Gray(0).Opacity(0)),
}, },
}; };
} }

View File

@ -7,6 +7,7 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Edit.Compose.Components; using osu.Game.Screens.Edit.Compose.Components;
using osu.Game.Screens.Edit.Compose.Components.Timeline; using osu.Game.Screens.Edit.Compose.Components.Timeline;
using osuTK.Graphics; using osuTK.Graphics;
@ -32,6 +33,8 @@ namespace osu.Game.Screens.Edit
Container mainContent; Container mainContent;
LoadingSpinner spinner;
Children = new Drawable[] Children = new Drawable[]
{ {
mainContent = new Container mainContent = new Container
@ -44,6 +47,10 @@ namespace osu.Game.Screens.Edit
Top = vertical_margins + timeline_height, Top = vertical_margins + timeline_height,
Bottom = vertical_margins Bottom = vertical_margins
}, },
Child = spinner = new LoadingSpinner(true)
{
State = { Value = Visibility.Visible },
},
}, },
new Container new Container
{ {
@ -87,9 +94,10 @@ namespace osu.Game.Screens.Edit
} }
}, },
}; };
LoadComponentAsync(CreateMainContent(), content => LoadComponentAsync(CreateMainContent(), content =>
{ {
spinner.State.Value = Visibility.Hidden;
mainContent.Add(content); mainContent.Add(content);
content.FadeInFromZero(300, Easing.OutQuint); content.FadeInFromZero(300, Easing.OutQuint);