mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 20:33:08 +08:00
Merge branch 'master' into placeholder-fixes
This commit is contained in:
commit
838e9ec12e
@ -52,7 +52,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.702.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.702.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.713.0" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.715.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Transitive Dependencies">
|
<ItemGroup Label="Transitive Dependencies">
|
||||||
<!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. -->
|
<!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. -->
|
||||||
|
76
osu.Android/AndroidJoystickSettings.cs
Normal file
76
osu.Android/AndroidJoystickSettings.cs
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Android.Input;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
|
using osu.Game.Localisation;
|
||||||
|
using osu.Game.Overlays.Settings;
|
||||||
|
|
||||||
|
namespace osu.Android
|
||||||
|
{
|
||||||
|
public class AndroidJoystickSettings : SettingsSubsection
|
||||||
|
{
|
||||||
|
protected override LocalisableString Header => JoystickSettingsStrings.JoystickGamepad;
|
||||||
|
|
||||||
|
private readonly AndroidJoystickHandler joystickHandler;
|
||||||
|
|
||||||
|
private readonly Bindable<bool> enabled = new BindableBool(true);
|
||||||
|
|
||||||
|
private SettingsSlider<float> deadzoneSlider = null!;
|
||||||
|
|
||||||
|
private Bindable<float> handlerDeadzone = null!;
|
||||||
|
|
||||||
|
private Bindable<float> localDeadzone = null!;
|
||||||
|
|
||||||
|
public AndroidJoystickSettings(AndroidJoystickHandler joystickHandler)
|
||||||
|
{
|
||||||
|
this.joystickHandler = joystickHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
// use local bindable to avoid changing enabled state of game host's bindable.
|
||||||
|
handlerDeadzone = joystickHandler.DeadzoneThreshold.GetBoundCopy();
|
||||||
|
localDeadzone = handlerDeadzone.GetUnboundCopy();
|
||||||
|
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new SettingsCheckbox
|
||||||
|
{
|
||||||
|
LabelText = CommonStrings.Enabled,
|
||||||
|
Current = enabled
|
||||||
|
},
|
||||||
|
deadzoneSlider = new SettingsSlider<float>
|
||||||
|
{
|
||||||
|
LabelText = JoystickSettingsStrings.DeadzoneThreshold,
|
||||||
|
KeyboardStep = 0.01f,
|
||||||
|
DisplayAsPercentage = true,
|
||||||
|
Current = localDeadzone,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
enabled.BindTo(joystickHandler.Enabled);
|
||||||
|
enabled.BindValueChanged(e => deadzoneSlider.Current.Disabled = !e.NewValue, true);
|
||||||
|
|
||||||
|
handlerDeadzone.BindValueChanged(val =>
|
||||||
|
{
|
||||||
|
bool disabled = localDeadzone.Disabled;
|
||||||
|
|
||||||
|
localDeadzone.Disabled = false;
|
||||||
|
localDeadzone.Value = val.NewValue;
|
||||||
|
localDeadzone.Disabled = disabled;
|
||||||
|
}, true);
|
||||||
|
|
||||||
|
localDeadzone.BindValueChanged(val => handlerDeadzone.Value = val.NewValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -96,6 +96,9 @@ namespace osu.Android
|
|||||||
case AndroidMouseHandler mh:
|
case AndroidMouseHandler mh:
|
||||||
return new AndroidMouseSettings(mh);
|
return new AndroidMouseSettings(mh);
|
||||||
|
|
||||||
|
case AndroidJoystickHandler jh:
|
||||||
|
return new AndroidJoystickSettings(jh);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return base.CreateSettingsSubsectionFor(handler);
|
return base.CreateSettingsSubsectionFor(handler);
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="AndroidJoystickSettings.cs" />
|
||||||
<Compile Include="AndroidMouseSettings.cs" />
|
<Compile Include="AndroidMouseSettings.cs" />
|
||||||
<Compile Include="GameplayScreenRotationLocker.cs" />
|
<Compile Include="GameplayScreenRotationLocker.cs" />
|
||||||
<Compile Include="OsuGameActivity.cs" />
|
<Compile Include="OsuGameActivity.cs" />
|
||||||
|
@ -319,13 +319,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
|
|
||||||
const float fade_out_time = 450;
|
const float fade_out_time = 450;
|
||||||
|
|
||||||
// intentionally pile on an extra FadeOut to make it happen much faster.
|
|
||||||
Ball.FadeOut(fade_out_time / 4, Easing.Out);
|
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case ArmedState.Hit:
|
case ArmedState.Hit:
|
||||||
Ball.ScaleTo(HitObject.Scale * 1.4f, fade_out_time, Easing.Out);
|
|
||||||
if (SliderBody?.SnakingOut.Value == true)
|
if (SliderBody?.SnakingOut.Value == true)
|
||||||
Body.FadeOut(40); // short fade to allow for any body colour to smoothly disappear.
|
Body.FadeOut(40); // short fade to allow for any body colour to smoothly disappear.
|
||||||
break;
|
break;
|
||||||
|
@ -23,6 +23,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
{
|
{
|
||||||
public class DrawableSliderBall : CircularContainer, ISliderProgress, IRequireHighFrequencyMousePosition, IHasAccentColour
|
public class DrawableSliderBall : CircularContainer, ISliderProgress, IRequireHighFrequencyMousePosition, IHasAccentColour
|
||||||
{
|
{
|
||||||
|
public const float FOLLOW_AREA = 2.4f;
|
||||||
|
|
||||||
public Func<OsuAction?> GetInitialHitAction;
|
public Func<OsuAction?> GetInitialHitAction;
|
||||||
|
|
||||||
public Color4 AccentColour
|
public Color4 AccentColour
|
||||||
@ -31,7 +33,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
set => ball.Colour = value;
|
set => ball.Colour = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Drawable followCircle;
|
|
||||||
private Drawable followCircleReceptor;
|
private Drawable followCircleReceptor;
|
||||||
private DrawableSlider drawableSlider;
|
private DrawableSlider drawableSlider;
|
||||||
private Drawable ball;
|
private Drawable ball;
|
||||||
@ -47,12 +48,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
|
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
followCircle = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SliderFollowCircle), _ => new DefaultFollowCircle())
|
new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SliderFollowCircle), _ => new DefaultFollowCircle())
|
||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Alpha = 0,
|
|
||||||
},
|
},
|
||||||
followCircleReceptor = new CircularContainer
|
followCircleReceptor = new CircularContainer
|
||||||
{
|
{
|
||||||
@ -103,10 +103,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
|
|
||||||
tracking = value;
|
tracking = value;
|
||||||
|
|
||||||
followCircleReceptor.Scale = new Vector2(tracking ? 2.4f : 1f);
|
followCircleReceptor.Scale = new Vector2(tracking ? FOLLOW_AREA : 1f);
|
||||||
|
|
||||||
followCircle.ScaleTo(tracking ? 2.4f : 1f, 300, Easing.OutQuint);
|
|
||||||
followCircle.FadeTo(tracking ? 1f : 0, 300, Easing.OutQuint);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
// 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 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.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Skinning.Default
|
namespace osu.Game.Rulesets.Osu.Skinning.Default
|
||||||
{
|
{
|
||||||
public class DefaultFollowCircle : CompositeDrawable
|
public class DefaultFollowCircle : FollowCircle
|
||||||
{
|
{
|
||||||
public DefaultFollowCircle()
|
public DefaultFollowCircle()
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both;
|
|
||||||
|
|
||||||
InternalChild = new CircularContainer
|
InternalChild = new CircularContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@ -29,5 +29,22 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnTrackingChanged(ValueChangedEvent<bool> tracking)
|
||||||
|
{
|
||||||
|
const float scale_duration = 300f;
|
||||||
|
const float fade_duration = 300f;
|
||||||
|
|
||||||
|
this.ScaleTo(tracking.NewValue ? DrawableSliderBall.FOLLOW_AREA : 1f, scale_duration, Easing.OutQuint)
|
||||||
|
.FadeTo(tracking.NewValue ? 1f : 0, fade_duration, Easing.OutQuint);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnSliderEnd()
|
||||||
|
{
|
||||||
|
const float fade_duration = 450f;
|
||||||
|
|
||||||
|
// intentionally pile on an extra FadeOut to make it happen much faster
|
||||||
|
this.FadeOut(fade_duration / 4, Easing.Out);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -19,13 +17,14 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
|
|||||||
{
|
{
|
||||||
public class DefaultSliderBall : CompositeDrawable
|
public class DefaultSliderBall : CompositeDrawable
|
||||||
{
|
{
|
||||||
private Box box;
|
private Box box = null!;
|
||||||
|
|
||||||
|
[Resolved(canBeNull: true)]
|
||||||
|
private DrawableHitObject? parentObject { get; set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(DrawableHitObject drawableObject, ISkinSource skin)
|
private void load(ISkinSource skin)
|
||||||
{
|
{
|
||||||
var slider = (DrawableSlider)drawableObject;
|
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
float radius = skin.GetConfig<OsuSkinConfiguration, float>(OsuSkinConfiguration.SliderPathRadius)?.Value ?? OsuHitObject.OBJECT_RADIUS;
|
float radius = skin.GetConfig<OsuSkinConfiguration, float>(OsuSkinConfiguration.SliderPathRadius)?.Value ?? OsuHitObject.OBJECT_RADIUS;
|
||||||
@ -51,10 +50,62 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
slider.Tracking.BindValueChanged(trackingChanged, true);
|
if (parentObject != null)
|
||||||
|
{
|
||||||
|
var slider = (DrawableSlider)parentObject;
|
||||||
|
slider.Tracking.BindValueChanged(trackingChanged, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
if (parentObject != null)
|
||||||
|
{
|
||||||
|
parentObject.ApplyCustomUpdateState += updateStateTransforms;
|
||||||
|
updateStateTransforms(parentObject, parentObject.State.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void trackingChanged(ValueChangedEvent<bool> tracking) =>
|
private void trackingChanged(ValueChangedEvent<bool> tracking) =>
|
||||||
box.FadeTo(tracking.NewValue ? 0.3f : 0.05f, 200, Easing.OutQuint);
|
box.FadeTo(tracking.NewValue ? 0.3f : 0.05f, 200, Easing.OutQuint);
|
||||||
|
|
||||||
|
private void updateStateTransforms(DrawableHitObject drawableObject, ArmedState state)
|
||||||
|
{
|
||||||
|
// Gets called by slider ticks, tails, etc., leading to duplicated
|
||||||
|
// animations which may negatively affect performance
|
||||||
|
if (drawableObject is not DrawableSlider)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const float fade_duration = 450f;
|
||||||
|
|
||||||
|
using (BeginAbsoluteSequence(drawableObject.StateUpdateTime))
|
||||||
|
{
|
||||||
|
this.FadeIn()
|
||||||
|
.ScaleTo(1f);
|
||||||
|
}
|
||||||
|
|
||||||
|
using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime))
|
||||||
|
{
|
||||||
|
// intentionally pile on an extra FadeOut to make it happen much faster
|
||||||
|
this.FadeOut(fade_duration / 4, Easing.Out);
|
||||||
|
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case ArmedState.Hit:
|
||||||
|
this.ScaleTo(1.4f, fade_duration, Easing.Out);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
|
if (parentObject != null)
|
||||||
|
parentObject.ApplyCustomUpdateState -= updateStateTransforms;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
75
osu.Game.Rulesets.Osu/Skinning/FollowCircle.cs
Normal file
75
osu.Game.Rulesets.Osu/Skinning/FollowCircle.cs
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Osu.Skinning
|
||||||
|
{
|
||||||
|
public abstract class FollowCircle : CompositeDrawable
|
||||||
|
{
|
||||||
|
[Resolved]
|
||||||
|
protected DrawableHitObject? ParentObject { get; private set; }
|
||||||
|
|
||||||
|
protected FollowCircle()
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
((DrawableSlider?)ParentObject)?.Tracking.BindValueChanged(OnTrackingChanged, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
if (ParentObject != null)
|
||||||
|
{
|
||||||
|
ParentObject.HitObjectApplied += onHitObjectApplied;
|
||||||
|
onHitObjectApplied(ParentObject);
|
||||||
|
|
||||||
|
ParentObject.ApplyCustomUpdateState += updateStateTransforms;
|
||||||
|
updateStateTransforms(ParentObject, ParentObject.State.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onHitObjectApplied(DrawableHitObject drawableObject)
|
||||||
|
{
|
||||||
|
this.ScaleTo(1f)
|
||||||
|
.FadeOut();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateStateTransforms(DrawableHitObject drawableObject, ArmedState state)
|
||||||
|
{
|
||||||
|
// Gets called by slider ticks, tails, etc., leading to duplicated
|
||||||
|
// animations which may negatively affect performance
|
||||||
|
if (drawableObject is not DrawableSlider)
|
||||||
|
return;
|
||||||
|
|
||||||
|
using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime))
|
||||||
|
OnSliderEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
|
if (ParentObject != null)
|
||||||
|
{
|
||||||
|
ParentObject.HitObjectApplied -= onHitObjectApplied;
|
||||||
|
ParentObject.ApplyCustomUpdateState -= updateStateTransforms;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void OnTrackingChanged(ValueChangedEvent<bool> tracking);
|
||||||
|
|
||||||
|
protected abstract void OnSliderEnd();
|
||||||
|
}
|
||||||
|
}
|
@ -1,12 +1,14 @@
|
|||||||
// 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 System.Diagnostics;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
||||||
{
|
{
|
||||||
public class LegacyFollowCircle : CompositeDrawable
|
public class LegacyFollowCircle : FollowCircle
|
||||||
{
|
{
|
||||||
public LegacyFollowCircle(Drawable animationContent)
|
public LegacyFollowCircle(Drawable animationContent)
|
||||||
{
|
{
|
||||||
@ -18,5 +20,36 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
|||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
InternalChild = animationContent;
|
InternalChild = animationContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnTrackingChanged(ValueChangedEvent<bool> tracking)
|
||||||
|
{
|
||||||
|
Debug.Assert(ParentObject != null);
|
||||||
|
|
||||||
|
if (ParentObject.Judged)
|
||||||
|
return;
|
||||||
|
|
||||||
|
double remainingTime = Math.Max(0, ParentObject.HitStateUpdateTime - Time.Current);
|
||||||
|
|
||||||
|
// Note that the scale adjust here is 2 instead of DrawableSliderBall.FOLLOW_AREA to match legacy behaviour.
|
||||||
|
// This means the actual tracking area for gameplay purposes is larger than the sprite (but skins may be accounting for this).
|
||||||
|
if (tracking.NewValue)
|
||||||
|
{
|
||||||
|
// TODO: Follow circle should bounce on each slider tick.
|
||||||
|
this.ScaleTo(0.5f).ScaleTo(2f, Math.Min(180f, remainingTime), Easing.Out)
|
||||||
|
.FadeTo(0).FadeTo(1f, Math.Min(60f, remainingTime));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TODO: Should animate only at the next slider tick if we want to match stable perfectly.
|
||||||
|
this.ScaleTo(4f, 100)
|
||||||
|
.FadeTo(0f, 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnSliderEnd()
|
||||||
|
{
|
||||||
|
this.ScaleTo(1.6f, 200, Easing.Out)
|
||||||
|
.FadeOut(200, Easing.In);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -274,14 +274,18 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const int initial_great_count = 2000;
|
||||||
|
|
||||||
|
int greatCount = initial_great_count;
|
||||||
|
|
||||||
foreach (var s in scores.Scores)
|
foreach (var s in scores.Scores)
|
||||||
{
|
{
|
||||||
s.Statistics = new Dictionary<HitResult, int>
|
s.Statistics = new Dictionary<HitResult, int>
|
||||||
{
|
{
|
||||||
{ HitResult.Great, RNG.Next(2000) },
|
{ HitResult.Great, greatCount -= 100 },
|
||||||
{ HitResult.Ok, RNG.Next(2000) },
|
{ HitResult.Ok, RNG.Next(100) },
|
||||||
{ HitResult.Meh, RNG.Next(2000) },
|
{ HitResult.Meh, RNG.Next(100) },
|
||||||
{ HitResult.Miss, RNG.Next(2000) }
|
{ HitResult.Miss, initial_great_count - greatCount }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -443,7 +443,6 @@ namespace osu.Game.Database
|
|||||||
TotalScore = score.TotalScore,
|
TotalScore = score.TotalScore,
|
||||||
MaxCombo = score.MaxCombo,
|
MaxCombo = score.MaxCombo,
|
||||||
Accuracy = score.Accuracy,
|
Accuracy = score.Accuracy,
|
||||||
HasReplay = ((IScoreInfo)score).HasReplay,
|
|
||||||
Date = score.Date,
|
Date = score.Date,
|
||||||
PP = score.PP,
|
PP = score.PP,
|
||||||
Rank = score.Rank,
|
Rank = score.Rank,
|
||||||
|
@ -59,8 +59,9 @@ namespace osu.Game.Database
|
|||||||
/// 13 2022-01-13 Final migration of beatmaps and scores to realm (multiple new storage fields).
|
/// 13 2022-01-13 Final migration of beatmaps and scores to realm (multiple new storage fields).
|
||||||
/// 14 2022-03-01 Added BeatmapUserSettings to BeatmapInfo.
|
/// 14 2022-03-01 Added BeatmapUserSettings to BeatmapInfo.
|
||||||
/// 15 2022-07-13 Added LastPlayed to BeatmapInfo.
|
/// 15 2022-07-13 Added LastPlayed to BeatmapInfo.
|
||||||
|
/// 16 2022-07-15 Removed HasReplay from ScoreInfo.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const int schema_version = 15;
|
private const int schema_version = 16;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Lock object which is held during <see cref="BlockAllOperations"/> sections, blocking realm retrieval during blocking periods.
|
/// Lock object which is held during <see cref="BlockAllOperations"/> sections, blocking realm retrieval during blocking periods.
|
||||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Online.API.Requests
|
|||||||
this.mods = mods ?? Array.Empty<IMod>();
|
this.mods = mods ?? Array.Empty<IMod>();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string Target => $@"beatmaps/{beatmapInfo.OnlineID}/scores{createQueryParameters()}";
|
protected override string Target => $@"beatmaps/{beatmapInfo.OnlineID}/solo-scores{createQueryParameters()}";
|
||||||
|
|
||||||
private string createQueryParameters()
|
private string createQueryParameters()
|
||||||
{
|
{
|
||||||
|
@ -103,9 +103,6 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
|
|
||||||
var mods = Mods.Select(apiMod => rulesetInstance.CreateModFromAcronym(apiMod.Acronym)).Where(m => m != null).ToArray();
|
var mods = Mods.Select(apiMod => rulesetInstance.CreateModFromAcronym(apiMod.Acronym)).Where(m => m != null).ToArray();
|
||||||
|
|
||||||
// all API scores provided by this class are considered to be legacy.
|
|
||||||
mods = mods.Append(rulesetInstance.CreateMod<ModClassic>()).ToArray();
|
|
||||||
|
|
||||||
var scoreInfo = ToScoreInfo(mods);
|
var scoreInfo = ToScoreInfo(mods);
|
||||||
|
|
||||||
scoreInfo.Ruleset = ruleset;
|
scoreInfo.Ruleset = ruleset;
|
||||||
@ -132,8 +129,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
Rank = Rank,
|
Rank = Rank,
|
||||||
Statistics = Statistics,
|
Statistics = Statistics,
|
||||||
Date = EndedAt ?? DateTimeOffset.Now,
|
Date = EndedAt ?? DateTimeOffset.Now,
|
||||||
Hash = "online", // TODO: temporary?
|
Hash = HasReplay ? "online" : string.Empty, // TODO: temporary?
|
||||||
HasReplay = HasReplay,
|
|
||||||
Mods = mods,
|
Mods = mods,
|
||||||
PP = PP,
|
PP = PP,
|
||||||
};
|
};
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
using System;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -22,11 +23,14 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
private readonly MetadataType type;
|
private readonly MetadataType type;
|
||||||
private TextFlowContainer textFlow;
|
private TextFlowContainer textFlow;
|
||||||
|
|
||||||
|
private readonly Action<string> searchAction;
|
||||||
|
|
||||||
private const float transition_duration = 250;
|
private const float transition_duration = 250;
|
||||||
|
|
||||||
public MetadataSection(MetadataType type)
|
public MetadataSection(MetadataType type, Action<string> searchAction = null)
|
||||||
{
|
{
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
this.searchAction = searchAction;
|
||||||
|
|
||||||
Alpha = 0;
|
Alpha = 0;
|
||||||
|
|
||||||
@ -91,7 +95,12 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
|
|
||||||
for (int i = 0; i <= tags.Length - 1; i++)
|
for (int i = 0; i <= tags.Length - 1; i++)
|
||||||
{
|
{
|
||||||
loaded.AddLink(tags[i], LinkAction.SearchBeatmapSet, tags[i]);
|
string tag = tags[i];
|
||||||
|
|
||||||
|
if (searchAction != null)
|
||||||
|
loaded.AddLink(tag, () => searchAction(tag));
|
||||||
|
else
|
||||||
|
loaded.AddLink(tag, LinkAction.SearchBeatmapSet, tag);
|
||||||
|
|
||||||
if (i != tags.Length - 1)
|
if (i != tags.Length - 1)
|
||||||
loaded.AddText(" ");
|
loaded.AddText(" ");
|
||||||
@ -100,7 +109,11 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MetadataType.Source:
|
case MetadataType.Source:
|
||||||
loaded.AddLink(text, LinkAction.SearchBeatmapSet, text);
|
if (searchAction != null)
|
||||||
|
loaded.AddLink(text, () => searchAction(text));
|
||||||
|
else
|
||||||
|
loaded.AddLink(text, LinkAction.SearchBeatmapSet, text);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -45,7 +45,7 @@ namespace osu.Game.Scoring
|
|||||||
|
|
||||||
public double Accuracy { get; set; }
|
public double Accuracy { get; set; }
|
||||||
|
|
||||||
public bool HasReplay { get; set; }
|
public bool HasReplay => !string.IsNullOrEmpty(Hash);
|
||||||
|
|
||||||
public DateTimeOffset Date { get; set; }
|
public DateTimeOffset Date { get; set; }
|
||||||
|
|
||||||
|
@ -11,6 +11,10 @@ namespace osu.Game.Scoring
|
|||||||
{
|
{
|
||||||
public enum ScoreRank
|
public enum ScoreRank
|
||||||
{
|
{
|
||||||
|
// TODO: Localisable?
|
||||||
|
[Description(@"F")]
|
||||||
|
F = -1,
|
||||||
|
|
||||||
[LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.RankD))]
|
[LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.RankD))]
|
||||||
[Description(@"D")]
|
[Description(@"D")]
|
||||||
D,
|
D,
|
||||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
if (State.Value == DownloadState.LocallyAvailable)
|
if (State.Value == DownloadState.LocallyAvailable)
|
||||||
return ReplayAvailability.Local;
|
return ReplayAvailability.Local;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(Score.Value?.Hash))
|
if (Score.Value?.HasReplay == true)
|
||||||
return ReplayAvailability.Online;
|
return ReplayAvailability.Online;
|
||||||
|
|
||||||
return ReplayAvailability.NotAvailable;
|
return ReplayAvailability.NotAvailable;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
@ -38,15 +36,18 @@ namespace osu.Game.Screens.Select
|
|||||||
private readonly LoadingLayer loading;
|
private readonly LoadingLayer loading;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private IAPIProvider api { get; set; }
|
private IAPIProvider api { get; set; } = null!;
|
||||||
|
|
||||||
private IBeatmapInfo beatmapInfo;
|
[Resolved]
|
||||||
|
private SongSelect? songSelect { get; set; }
|
||||||
|
|
||||||
private APIFailTimes failTimes;
|
private IBeatmapInfo? beatmapInfo;
|
||||||
|
|
||||||
private int[] ratings;
|
private APIFailTimes? failTimes;
|
||||||
|
|
||||||
public IBeatmapInfo BeatmapInfo
|
private int[]? ratings;
|
||||||
|
|
||||||
|
public IBeatmapInfo? BeatmapInfo
|
||||||
{
|
{
|
||||||
get => beatmapInfo;
|
get => beatmapInfo;
|
||||||
set
|
set
|
||||||
@ -56,7 +57,7 @@ namespace osu.Game.Screens.Select
|
|||||||
beatmapInfo = value;
|
beatmapInfo = value;
|
||||||
|
|
||||||
var onlineInfo = beatmapInfo as IBeatmapOnlineInfo;
|
var onlineInfo = beatmapInfo as IBeatmapOnlineInfo;
|
||||||
var onlineSetInfo = beatmapInfo.BeatmapSet as IBeatmapSetOnlineInfo;
|
var onlineSetInfo = beatmapInfo?.BeatmapSet as IBeatmapSetOnlineInfo;
|
||||||
|
|
||||||
failTimes = onlineInfo?.FailTimes;
|
failTimes = onlineInfo?.FailTimes;
|
||||||
ratings = onlineSetInfo?.Ratings;
|
ratings = onlineSetInfo?.Ratings;
|
||||||
@ -140,9 +141,9 @@ namespace osu.Game.Screens.Select
|
|||||||
LayoutEasing = Easing.OutQuad,
|
LayoutEasing = Easing.OutQuad,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
description = new MetadataSection(MetadataType.Description),
|
description = new MetadataSection(MetadataType.Description, searchOnSongSelect),
|
||||||
source = new MetadataSection(MetadataType.Source),
|
source = new MetadataSection(MetadataType.Source, searchOnSongSelect),
|
||||||
tags = new MetadataSection(MetadataType.Tags),
|
tags = new MetadataSection(MetadataType.Tags, searchOnSongSelect),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -175,6 +176,12 @@ namespace osu.Game.Screens.Select
|
|||||||
},
|
},
|
||||||
loading = new LoadingLayer(true)
|
loading = new LoadingLayer(true)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void searchOnSongSelect(string text)
|
||||||
|
{
|
||||||
|
if (songSelect != null)
|
||||||
|
songSelect.FilterControl.CurrentTextSearch.Value = text;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateStatistics()
|
private void updateStatistics()
|
||||||
|
@ -31,6 +31,8 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
public Action<FilterCriteria> FilterChanged;
|
public Action<FilterCriteria> FilterChanged;
|
||||||
|
|
||||||
|
public Bindable<string> CurrentTextSearch => searchTextBox.Current;
|
||||||
|
|
||||||
private OsuTabControl<SortMode> sortTabs;
|
private OsuTabControl<SortMode> sortTabs;
|
||||||
|
|
||||||
private Bindable<SortMode> sortMode;
|
private Bindable<SortMode> sortMode;
|
||||||
@ -63,6 +65,7 @@ namespace osu.Game.Screens.Select
|
|||||||
}
|
}
|
||||||
|
|
||||||
private SeekLimitedSearchTextBox searchTextBox;
|
private SeekLimitedSearchTextBox searchTextBox;
|
||||||
|
|
||||||
private CollectionFilterDropdown collectionDropdown;
|
private CollectionFilterDropdown collectionDropdown;
|
||||||
|
|
||||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) =>
|
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) =>
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Realm" Version="10.14.0" />
|
<PackageReference Include="Realm" Version="10.14.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2022.713.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2022.715.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.702.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.702.0" />
|
||||||
<PackageReference Include="Sentry" Version="3.19.0" />
|
<PackageReference Include="Sentry" Version="3.19.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.32.1" />
|
<PackageReference Include="SharpCompress" Version="0.32.1" />
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.713.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.715.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.702.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.702.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net6.0) -->
|
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net6.0) -->
|
||||||
@ -84,7 +84,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.14" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.14" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="5.0.14" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="5.0.14" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2022.713.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2022.715.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.32.1" />
|
<PackageReference Include="SharpCompress" Version="0.32.1" />
|
||||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||||
|
Loading…
Reference in New Issue
Block a user