mirror of
https://github.com/ppy/osu.git
synced 2026-05-22 07:09:53 +08:00
Compare commits
18 Commits
+2
-2
@@ -51,8 +51,8 @@
|
||||
<Reference Include="Java.Interop" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.1127.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.1204.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.1207.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.1207.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. -->
|
||||
|
||||
@@ -65,6 +65,11 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
flowDirection = !flowDirection;
|
||||
}
|
||||
|
||||
if (positionInfos[i].HitObject is Slider slider && random.NextDouble() < 0.5)
|
||||
{
|
||||
OsuHitObjectGenerationUtils.FlipSliderHorizontally(slider);
|
||||
}
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
positionInfos[i].DistanceFromPrevious = (float)(random.NextDouble() * OsuPlayfield.BASE_SIZE.Y / 2);
|
||||
|
||||
@@ -116,18 +116,10 @@ namespace osu.Game.Rulesets.Osu.Utils
|
||||
{
|
||||
osuObject.Position = new Vector2(OsuPlayfield.BASE_SIZE.X - osuObject.X, osuObject.Position.Y);
|
||||
|
||||
if (!(osuObject is Slider slider))
|
||||
if (osuObject is not Slider slider)
|
||||
return;
|
||||
|
||||
// No need to update the head and tail circles, since slider handles that when the new slider path is set
|
||||
slider.NestedHitObjects.OfType<SliderTick>().ForEach(h => h.Position = new Vector2(OsuPlayfield.BASE_SIZE.X - h.Position.X, h.Position.Y));
|
||||
slider.NestedHitObjects.OfType<SliderRepeat>().ForEach(h => h.Position = new Vector2(OsuPlayfield.BASE_SIZE.X - h.Position.X, h.Position.Y));
|
||||
|
||||
var controlPoints = slider.Path.ControlPoints.Select(p => new PathControlPoint(p.Position, p.Type)).ToArray();
|
||||
foreach (var point in controlPoints)
|
||||
point.Position = new Vector2(-point.Position.X, point.Position.Y);
|
||||
|
||||
slider.Path = new SliderPath(controlPoints, slider.Path.ExpectedDistance.Value);
|
||||
FlipSliderHorizontally(slider);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -138,18 +130,13 @@ namespace osu.Game.Rulesets.Osu.Utils
|
||||
{
|
||||
osuObject.Position = new Vector2(osuObject.Position.X, OsuPlayfield.BASE_SIZE.Y - osuObject.Y);
|
||||
|
||||
if (!(osuObject is Slider slider))
|
||||
if (osuObject is not Slider slider)
|
||||
return;
|
||||
|
||||
// No need to update the head and tail circles, since slider handles that when the new slider path is set
|
||||
slider.NestedHitObjects.OfType<SliderTick>().ForEach(h => h.Position = new Vector2(h.Position.X, OsuPlayfield.BASE_SIZE.Y - h.Position.Y));
|
||||
slider.NestedHitObjects.OfType<SliderRepeat>().ForEach(h => h.Position = new Vector2(h.Position.X, OsuPlayfield.BASE_SIZE.Y - h.Position.Y));
|
||||
void flipNestedObject(OsuHitObject nested) => nested.Position = new Vector2(nested.X, slider.Y - (nested.Y - slider.Y));
|
||||
static void flipControlPoint(PathControlPoint point) => point.Position = new Vector2(point.Position.X, -point.Position.Y);
|
||||
|
||||
var controlPoints = slider.Path.ControlPoints.Select(p => new PathControlPoint(p.Position, p.Type)).ToArray();
|
||||
foreach (var point in controlPoints)
|
||||
point.Position = new Vector2(point.Position.X, -point.Position.Y);
|
||||
|
||||
slider.Path = new SliderPath(controlPoints, slider.Path.ExpectedDistance.Value);
|
||||
modifySlider(slider, flipNestedObject, flipControlPoint);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -160,14 +147,31 @@ namespace osu.Game.Rulesets.Osu.Utils
|
||||
public static void RotateSlider(Slider slider, float rotation)
|
||||
{
|
||||
void rotateNestedObject(OsuHitObject nested) => nested.Position = rotateVector(nested.Position - slider.Position, rotation) + slider.Position;
|
||||
void rotateControlPoint(PathControlPoint point) => point.Position = rotateVector(point.Position, rotation);
|
||||
|
||||
modifySlider(slider, rotateNestedObject, rotateControlPoint);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Flips the slider about its start position horizontally.
|
||||
/// </summary>
|
||||
public static void FlipSliderHorizontally(Slider slider)
|
||||
{
|
||||
void flipNestedObject(OsuHitObject nested) => nested.Position = new Vector2(slider.X - (nested.X - slider.X), nested.Y);
|
||||
static void flipControlPoint(PathControlPoint point) => point.Position = new Vector2(-point.Position.X, point.Position.Y);
|
||||
|
||||
modifySlider(slider, flipNestedObject, flipControlPoint);
|
||||
}
|
||||
|
||||
private static void modifySlider(Slider slider, Action<OsuHitObject> modifyNestedObject, Action<PathControlPoint> modifyControlPoint)
|
||||
{
|
||||
// No need to update the head and tail circles, since slider handles that when the new slider path is set
|
||||
slider.NestedHitObjects.OfType<SliderTick>().ForEach(rotateNestedObject);
|
||||
slider.NestedHitObjects.OfType<SliderRepeat>().ForEach(rotateNestedObject);
|
||||
slider.NestedHitObjects.OfType<SliderTick>().ForEach(modifyNestedObject);
|
||||
slider.NestedHitObjects.OfType<SliderRepeat>().ForEach(modifyNestedObject);
|
||||
|
||||
var controlPoints = slider.Path.ControlPoints.Select(p => new PathControlPoint(p.Position, p.Type)).ToArray();
|
||||
foreach (var point in controlPoints)
|
||||
point.Position = rotateVector(point.Position, rotation);
|
||||
modifyControlPoint(point);
|
||||
|
||||
slider.Path = new SliderPath(controlPoints, slider.Path.ExpectedDistance.Value);
|
||||
}
|
||||
|
||||
@@ -126,6 +126,21 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
checkBindableAtValue("Circle Size", 9);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestExtendedLimitsRetainedAfterBoundCopyCreation()
|
||||
{
|
||||
setExtendedLimits(true);
|
||||
setSliderValue("Circle Size", 11);
|
||||
|
||||
checkSliderAtValue("Circle Size", 11);
|
||||
checkBindableAtValue("Circle Size", 11);
|
||||
|
||||
AddStep("create bound copy", () => _ = modDifficultyAdjust.CircleSize.GetBoundCopy());
|
||||
|
||||
checkSliderAtValue("Circle Size", 11);
|
||||
checkBindableAtValue("Circle Size", 11);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestResetToDefault()
|
||||
{
|
||||
|
||||
@@ -109,6 +109,8 @@ namespace osu.Game.Audio
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
|
||||
Stop();
|
||||
Track?.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -529,6 +529,10 @@ namespace osu.Game.Online.Chat
|
||||
{
|
||||
Logger.Log($"Joined public channel {channel}");
|
||||
joinChannel(channel, fetchInitialMessages);
|
||||
|
||||
// Required after joining public channels to mark the user as online in them.
|
||||
// Todo: Temporary workaround for https://github.com/ppy/osu-web/issues/9602
|
||||
SendAck();
|
||||
};
|
||||
req.Failure += e =>
|
||||
{
|
||||
|
||||
@@ -118,11 +118,18 @@ namespace osu.Game.Rulesets.Mods
|
||||
if (!(them is DifficultyBindable otherDifficultyBindable))
|
||||
throw new InvalidOperationException($"Cannot bind to a non-{nameof(DifficultyBindable)}.");
|
||||
|
||||
// ensure that MaxValue and ExtendedMaxValue are copied across first before continuing.
|
||||
// not doing so may cause the value of CurrentNumber to be truncated to 10.
|
||||
otherDifficultyBindable.CopyTo(this);
|
||||
|
||||
// set up mutual binding for ExtendedLimits to correctly set the upper bound of CurrentNumber.
|
||||
ExtendedLimits.BindTarget = otherDifficultyBindable.ExtendedLimits;
|
||||
|
||||
// the actual values need to be copied after the max value constraints.
|
||||
// set up mutual binding for CurrentNumber. this must happen after all of the above.
|
||||
CurrentNumber.BindTarget = otherDifficultyBindable.CurrentNumber;
|
||||
|
||||
// finish up the binding by setting up weak references via the base call.
|
||||
// unfortunately this will call `.CopyTo()` again, but fixing that is problematic and messy.
|
||||
base.BindTo(them);
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
protected override void OnMouseUp(MouseUpEvent e)
|
||||
{
|
||||
if (e.Button == MouseButton.Right)
|
||||
if (e.Button == MouseButton.Right && IsHovered)
|
||||
{
|
||||
rewindSearch = true;
|
||||
TriggerClick();
|
||||
|
||||
@@ -47,6 +47,8 @@ namespace osu.Game.Screens.Utility
|
||||
Height = 100;
|
||||
SpriteText.Colour = overlayColourProvider.Background6;
|
||||
SpriteText.Font = OsuFont.TorusAlternate.With(size: 34);
|
||||
|
||||
Triangles?.Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Realm" Version="10.18.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2022.1204.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.1127.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2022.1207.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.1207.0" />
|
||||
<PackageReference Include="Sentry" Version="3.23.1" />
|
||||
<PackageReference Include="SharpCompress" Version="0.32.2" />
|
||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||
|
||||
+3
-3
@@ -61,8 +61,8 @@
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.1127.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.1204.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.1207.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.1207.0" />
|
||||
</ItemGroup>
|
||||
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net6.0) -->
|
||||
<PropertyGroup>
|
||||
@@ -82,7 +82,7 @@
|
||||
<PackageReference Include="DiffPlex" Version="1.7.1" />
|
||||
<PackageReference Include="Humanizer" Version="2.14.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2022.1204.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2022.1207.0" />
|
||||
<PackageReference Include="SharpCompress" Version="0.32.2" />
|
||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||
|
||||
Reference in New Issue
Block a user