Merge branch 'master' into default-follow-circle-improvements

This commit is contained in:
Salman Ahmed 2022-07-15 18:39:57 +03:00 committed by GitHub
commit 887f2721b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 122 additions and 19 deletions

View File

@ -52,7 +52,7 @@
</ItemGroup>
<ItemGroup>
<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 Label="Transitive Dependencies">
<!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. -->

View 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);
}
}
}

View File

@ -96,6 +96,9 @@ namespace osu.Android
case AndroidMouseHandler mh:
return new AndroidMouseSettings(mh);
case AndroidJoystickHandler jh:
return new AndroidJoystickSettings(jh);
default:
return base.CreateSettingsSubsectionFor(handler);
}

View File

@ -26,6 +26,7 @@
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
</PropertyGroup>
<ItemGroup>
<Compile Include="AndroidJoystickSettings.cs" />
<Compile Include="AndroidMouseSettings.cs" />
<Compile Include="GameplayScreenRotationLocker.cs" />
<Compile Include="OsuGameActivity.cs" />

View File

@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
if (ParentObject.Judged)
return;
double remainingTime = ParentObject.HitStateUpdateTime - Time.Current;
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).

View File

@ -3,6 +3,7 @@
#nullable disable
using System;
using osu.Framework.Extensions;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
@ -22,11 +23,14 @@ namespace osu.Game.Overlays.BeatmapSet
private readonly MetadataType type;
private TextFlowContainer textFlow;
private readonly Action<string> searchAction;
private const float transition_duration = 250;
public MetadataSection(MetadataType type)
public MetadataSection(MetadataType type, Action<string> searchAction = null)
{
this.type = type;
this.searchAction = searchAction;
Alpha = 0;
@ -91,7 +95,12 @@ namespace osu.Game.Overlays.BeatmapSet
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)
loaded.AddText(" ");
@ -100,7 +109,11 @@ namespace osu.Game.Overlays.BeatmapSet
break;
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;
default:

View File

@ -1,8 +1,6 @@
// 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.
#nullable disable
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
@ -38,15 +36,18 @@ namespace osu.Game.Screens.Select
private readonly LoadingLayer loading;
[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;
set
@ -56,7 +57,7 @@ namespace osu.Game.Screens.Select
beatmapInfo = value;
var onlineInfo = beatmapInfo as IBeatmapOnlineInfo;
var onlineSetInfo = beatmapInfo.BeatmapSet as IBeatmapSetOnlineInfo;
var onlineSetInfo = beatmapInfo?.BeatmapSet as IBeatmapSetOnlineInfo;
failTimes = onlineInfo?.FailTimes;
ratings = onlineSetInfo?.Ratings;
@ -140,9 +141,9 @@ namespace osu.Game.Screens.Select
LayoutEasing = Easing.OutQuad,
Children = new[]
{
description = new MetadataSection(MetadataType.Description),
source = new MetadataSection(MetadataType.Source),
tags = new MetadataSection(MetadataType.Tags),
description = new MetadataSection(MetadataType.Description, searchOnSongSelect),
source = new MetadataSection(MetadataType.Source, searchOnSongSelect),
tags = new MetadataSection(MetadataType.Tags, searchOnSongSelect),
},
},
},
@ -175,6 +176,12 @@ namespace osu.Game.Screens.Select
},
loading = new LoadingLayer(true)
};
void searchOnSongSelect(string text)
{
if (songSelect != null)
songSelect.FilterControl.CurrentTextSearch.Value = text;
}
}
private void updateStatistics()

View File

@ -31,6 +31,8 @@ namespace osu.Game.Screens.Select
public Action<FilterCriteria> FilterChanged;
public Bindable<string> CurrentTextSearch => searchTextBox.Current;
private OsuTabControl<SortMode> sortTabs;
private Bindable<SortMode> sortMode;
@ -63,6 +65,7 @@ namespace osu.Game.Screens.Select
}
private SeekLimitedSearchTextBox searchTextBox;
private CollectionFilterDropdown collectionDropdown;
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) =>

View File

@ -36,7 +36,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<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="Sentry" Version="3.19.0" />
<PackageReference Include="SharpCompress" Version="0.32.1" />

View File

@ -61,7 +61,7 @@
<Reference Include="System.Net.Http" />
</ItemGroup>
<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" />
</ItemGroup>
<!-- 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.Core" Version="5.0.14" />
<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="NUnit" Version="3.13.3" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />