1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 00:02:54 +08:00

Merge master with conflicts resolved

This commit is contained in:
Andrei Zavatski 2019-08-07 16:05:28 +03:00
commit d9fd054102
14 changed files with 495 additions and 19 deletions

View File

@ -34,7 +34,7 @@ If you are not interested in developing the game, you can still consume our [bin
| ------------- | ------------- |
- **Linux** users are recommended to self-compile until we have official deployment in place.
- **iOS** users can join the [TestFlight beta program](https://t.co/PasE1zrHhw) (note that due to high demand this is regularly full).
- **iOS** users can join the [TestFlight beta program](https://testflight.apple.com/join/2tLcjWlF) (note that due to high demand this is regularly full).
- **Android** users can self-compile, and expect a public beta soon.
If your platform is not listed above, there is still a chance you can manually build it by following the instructions below.

View File

@ -63,6 +63,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2019.730.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2019.807.0" />
</ItemGroup>
</Project>

View File

@ -8,7 +8,6 @@ using osu.Framework.MathUtils;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Tests.Beatmaps;
namespace osu.Game.Rulesets.Osu.Tests
@ -23,6 +22,7 @@ namespace osu.Game.Rulesets.Osu.Tests
[TestCase("slider-ticks")]
[TestCase("repeat-slider")]
[TestCase("uneven-repeat-slider")]
[TestCase("old-stacking")]
public void Test(string name) => base.Test(name);
protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject)
@ -31,22 +31,22 @@ namespace osu.Game.Rulesets.Osu.Tests
{
case Slider slider:
foreach (var nested in slider.NestedHitObjects)
yield return createConvertValue(nested);
yield return createConvertValue((OsuHitObject)nested);
break;
default:
yield return createConvertValue(hitObject);
yield return createConvertValue((OsuHitObject)hitObject);
break;
}
ConvertValue createConvertValue(HitObject obj) => new ConvertValue
ConvertValue createConvertValue(OsuHitObject obj) => new ConvertValue
{
StartTime = obj.StartTime,
EndTime = (obj as IHasEndTime)?.EndTime ?? obj.StartTime,
X = (obj as IHasPosition)?.X ?? OsuPlayfield.BASE_SIZE.X / 2,
Y = (obj as IHasPosition)?.Y ?? OsuPlayfield.BASE_SIZE.Y / 2,
X = obj.StackedPosition.X,
Y = obj.StackedPosition.Y
};
}

View File

@ -6,6 +6,7 @@ using osu.Framework.Graphics;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Osu.Objects;
using osuTK;
namespace osu.Game.Rulesets.Osu.Beatmaps
{
@ -208,17 +209,22 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
if (beatmap.HitObjects[j].StartTime - stackThreshold > startTime)
break;
// The start position of the hitobject, or the position at the end of the path if the hitobject is a slider
Vector2 position2 = currHitObject is Slider currSlider
? currSlider.Position + currSlider.Path.PositionAt(1)
: currHitObject.Position;
if (Vector2Extensions.Distance(beatmap.HitObjects[j].Position, currHitObject.Position) < stack_distance)
{
currHitObject.StackHeight++;
startTime = (beatmap.HitObjects[j] as IHasEndTime)?.EndTime ?? beatmap.HitObjects[i].StartTime;
startTime = (beatmap.HitObjects[j] as IHasEndTime)?.EndTime ?? beatmap.HitObjects[j].StartTime;
}
else if (Vector2Extensions.Distance(beatmap.HitObjects[j].Position, currHitObject.EndPosition) < stack_distance)
else if (Vector2Extensions.Distance(beatmap.HitObjects[j].Position, position2) < stack_distance)
{
//Case for sliders - bump notes down and right, rather than up and left.
sliderStack++;
beatmap.HitObjects[j].StackHeight -= sliderStack;
startTime = (beatmap.HitObjects[j] as IHasEndTime)?.EndTime ?? beatmap.HitObjects[i].StartTime;
startTime = (beatmap.HitObjects[j] as IHasEndTime)?.EndTime ?? beatmap.HitObjects[j].StartTime;
}
}
}

View File

@ -0,0 +1,278 @@
{
"Mappings": [{
"StartTime": 32165,
"Objects": [{
"StartTime": 32165,
"EndTime": 32165,
"X": 32,
"Y": 320
}]
},
{
"StartTime": 32517,
"Objects": [{
"StartTime": 32517,
"EndTime": 32517,
"X": 246.396057,
"Y": 182.396057
}]
},
{
"StartTime": 32605,
"Objects": [{
"StartTime": 32605,
"EndTime": 32605,
"X": 249.597382,
"Y": 185.597382
}]
},
{
"StartTime": 32693,
"Objects": [{
"StartTime": 32693,
"EndTime": 32693,
"X": 252.798691,
"Y": 188.798691
}]
},
{
"StartTime": 32781,
"Objects": [{
"StartTime": 32781,
"EndTime": 32781,
"X": 256,
"Y": 192
}]
},
{
"StartTime": 33248,
"Objects": [{
"StartTime": 33248,
"EndTime": 33248,
"X": 39.3960648,
"Y": 76.3960648
}]
},
{
"StartTime": 33307,
"Objects": [{
"StartTime": 33307,
"EndTime": 33307,
"X": 42.5973778,
"Y": 79.597374
}]
},
{
"StartTime": 33383,
"Objects": [{
"StartTime": 33383,
"EndTime": 33383,
"X": 45.798687,
"Y": 82.79869
}]
},
{
"StartTime": 33459,
"Objects": [{
"StartTime": 33459,
"EndTime": 33459,
"X": 49,
"Y": 86
},
{
"StartTime": 33635,
"EndTime": 33635,
"X": 123.847847,
"Y": 85.7988
},
{
"StartTime": 33811,
"EndTime": 33811,
"X": 198.6957,
"Y": 85.5975952
},
{
"StartTime": 33988,
"EndTime": 33988,
"X": 273.9688,
"Y": 85.39525
},
{
"StartTime": 34164,
"EndTime": 34164,
"X": 348.816681,
"Y": 85.19404
},
{
"StartTime": 34246,
"EndTime": 34246,
"X": 398.998718,
"Y": 85.05914
}
]
},
{
"StartTime": 34341,
"Objects": [{
"StartTime": 34341,
"EndTime": 34341,
"X": 401.201324,
"Y": 88.20131
}]
},
{
"StartTime": 34400,
"Objects": [{
"StartTime": 34400,
"EndTime": 34400,
"X": 404.402618,
"Y": 91.402626
}]
},
{
"StartTime": 34459,
"Objects": [{
"StartTime": 34459,
"EndTime": 34459,
"X": 407.603943,
"Y": 94.6039352
}]
},
{
"StartTime": 34989,
"Objects": [{
"StartTime": 34989,
"EndTime": 34989,
"X": 163,
"Y": 138
},
{
"StartTime": 35018,
"EndTime": 35018,
"X": 188,
"Y": 138
}
]
},
{
"StartTime": 35106,
"Objects": [{
"StartTime": 35106,
"EndTime": 35106,
"X": 163,
"Y": 138
},
{
"StartTime": 35135,
"EndTime": 35135,
"X": 188,
"Y": 138
}
]
},
{
"StartTime": 35224,
"Objects": [{
"StartTime": 35224,
"EndTime": 35224,
"X": 163,
"Y": 138
},
{
"StartTime": 35253,
"EndTime": 35253,
"X": 188,
"Y": 138
}
]
},
{
"StartTime": 35695,
"Objects": [{
"StartTime": 35695,
"EndTime": 35695,
"X": 166,
"Y": 76
},
{
"StartTime": 35871,
"EndTime": 35871,
"X": 240.99855,
"Y": 75.53417
},
{
"StartTime": 36011,
"EndTime": 36011,
"X": 315.9971,
"Y": 75.0683441
}
]
},
{
"StartTime": 36106,
"Objects": [{
"StartTime": 36106,
"EndTime": 36106,
"X": 315,
"Y": 75
},
{
"StartTime": 36282,
"EndTime": 36282,
"X": 240.001526,
"Y": 75.47769
},
{
"StartTime": 36422,
"EndTime": 36422,
"X": 165.003052,
"Y": 75.95539
}
]
},
{
"StartTime": 36518,
"Objects": [{
"StartTime": 36518,
"EndTime": 36518,
"X": 166,
"Y": 76
},
{
"StartTime": 36694,
"EndTime": 36694,
"X": 240.99855,
"Y": 75.53417
},
{
"StartTime": 36834,
"EndTime": 36834,
"X": 315.9971,
"Y": 75.0683441
}
]
},
{
"StartTime": 36929,
"Objects": [{
"StartTime": 36929,
"EndTime": 36929,
"X": 315,
"Y": 75
},
{
"StartTime": 37105,
"EndTime": 37105,
"X": 240.001526,
"Y": 75.47769
},
{
"StartTime": 37245,
"EndTime": 37245,
"X": 165.003052,
"Y": 75.95539
}
]
}
]
}

View File

@ -0,0 +1,40 @@
osu file format v3
[Difficulty]
HPDrainRate:3
CircleSize:5
OverallDifficulty:8
ApproachRate:8
SliderMultiplier:1.5
SliderTickRate:2
[TimingPoints]
48,352.941176470588,4,1,1,100,1,0
[HitObjects]
// Hit circles
32,320,32165,5,2,0:0:0:0:
256,192,32517,5,0,0:0:0:0:
256,192,32605,1,0,0:0:0:0:
256,192,32693,1,0,0:0:0:0:
256,192,32781,1,0,0:0:0:0:
// Hit circles on slider endpoints
49,86,33248,1,0,0:0:0:0:
49,86,33307,1,0,0:0:0:0:
49,86,33383,1,0,0:0:0:0:
49,86,33459,2,0,L|421:85,1,350
398,85,34341,1,0,0:0:0:0:
398,85,34400,1,0,0:0:0:0:
398,85,34459,1,0,0:0:0:0:
// Sliders
163,138,34989,2,0,L|196:138,1,25
163,138,35106,2,0,L|196:138,1,25
163,138,35224,2,0,L|196:138,1,25
// Reversed sliders
166,76,35695,2,0,L|327:75,1,150
315,75,36106,2,0,L|158:76,1,150
166,76,36518,2,0,L|327:75,1,150
315,75,36929,2,0,L|158:76,1,150

View File

@ -13,13 +13,15 @@ namespace osu.Game.Rulesets.Osu.UI
protected override Container<Drawable> Content => content;
private readonly Container content;
private const float playfield_size_adjust = 0.8f;
public OsuPlayfieldAdjustmentContainer()
{
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
// Calculated from osu!stable as 512 (default gamefield size) / 640 (default window size)
Size = new Vector2(0.8f);
Size = new Vector2(playfield_size_adjust);
InternalChild = new Container
{
@ -41,7 +43,19 @@ namespace osu.Game.Rulesets.Osu.UI
{
base.Update();
// The following calculation results in a constant of 1.6 when OsuPlayfieldAdjustmentContainer
// is consuming the full game_size. This matches the osu-stable "magic ratio".
//
// game_size = DrawSizePreservingFillContainer.TargetSize = new Vector2(1024, 768)
//
// Parent is a 4:3 aspect enforced, using height as the constricting dimension
// Parent.ChildSize.X = min(game_size.X, game_size.Y * (4 / 3)) * playfield_size_adjust
// Parent.ChildSize.X = 819.2
//
// Scale = 819.2 / 512
// Scale = 1.6
Scale = new Vector2(Parent.ChildSize.X / OsuPlayfield.BASE_SIZE.X);
// Size = 0.625
Size = Vector2.Divide(Vector2.One, Scale);
}
}

View File

@ -0,0 +1,109 @@
// 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 NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Containers;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mania;
using osu.Game.Users;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Game.Rulesets.Taiko;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Tests.Visual.Online
{
[TestFixture]
public class TestSceneUserRequest : OsuTestScene
{
[Resolved]
private IAPIProvider api { get; set; }
private readonly Bindable<User> user = new Bindable<User>();
private GetUserRequest request;
private readonly DimmedLoadingLayer loading;
public TestSceneUserRequest()
{
Add(new Container
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
AutoSizeAxes = Axes.Both,
Children = new Drawable[]
{
new UserTestContainer
{
User = { BindTarget = user }
},
loading = new DimmedLoadingLayer
{
Alpha = 0
}
}
});
}
protected override void LoadComplete()
{
base.LoadComplete();
AddStep(@"local user", () => getUser());
AddStep(@"local user with taiko ruleset", () => getUser(ruleset: new TaikoRuleset().RulesetInfo));
AddStep(@"cookiezi", () => getUser(124493));
AddStep(@"cookiezi with mania ruleset", () => getUser(124493, new ManiaRuleset().RulesetInfo));
}
private void getUser(long? userId = null, RulesetInfo ruleset = null)
{
loading.Show();
request?.Cancel();
request = new GetUserRequest(userId, ruleset);
request.Success += user =>
{
this.user.Value = user;
loading.Hide();
};
api.Queue(request);
}
private class UserTestContainer : FillFlowContainer
{
public readonly Bindable<User> User = new Bindable<User>();
public UserTestContainer()
{
AutoSizeAxes = Axes.Both;
Direction = FillDirection.Vertical;
}
protected override void LoadComplete()
{
base.LoadComplete();
User.BindValueChanged(onUserUpdate, true);
}
private void onUserUpdate(ValueChangedEvent<User> user)
{
Clear();
AddRange(new Drawable[]
{
new SpriteText
{
Text = $@"Username: {user.NewValue?.Username}"
},
new SpriteText
{
Text = $@"RankedScore: {user.NewValue?.Statistics.RankedScore}"
},
});
}
}
}
}

View File

@ -2,18 +2,21 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Users;
using osu.Game.Rulesets;
namespace osu.Game.Online.API.Requests
{
public class GetUserRequest : APIRequest<User>
{
private readonly long? userId;
private readonly RulesetInfo ruleset;
public GetUserRequest(long? userId = null)
public GetUserRequest(long? userId = null, RulesetInfo ruleset = null)
{
this.userId = userId;
this.ruleset = ruleset;
}
protected override string Target => userId.HasValue ? $@"users/{userId}" : @"me";
protected override string Target => userId.HasValue ? $@"users/{userId}/{ruleset?.ShortName}" : $@"me/{ruleset?.ShortName}";
}
}

View File

@ -2,7 +2,9 @@
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.IO.Network;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Rulesets;
namespace osu.Game.Online.API.Requests
{
@ -10,12 +12,24 @@ namespace osu.Game.Online.API.Requests
{
private readonly long userId;
private readonly ScoreType type;
private readonly RulesetInfo ruleset;
public GetUserScoresRequest(long userId, ScoreType type, int page = 0, int itemsPerPage = 5)
public GetUserScoresRequest(long userId, ScoreType type, int page = 0, int itemsPerPage = 5, RulesetInfo ruleset = null)
: base(page, itemsPerPage)
{
this.userId = userId;
this.type = type;
this.ruleset = ruleset;
}
protected override WebRequest CreateWebRequest()
{
var req = base.CreateWebRequest();
if (ruleset != null)
req.AddParameter("mode", ruleset.ShortName);
return req;
}
protected override string Target => $@"users/{userId}/scores/{type.ToString().ToLowerInvariant()}";

View File

@ -193,6 +193,12 @@ namespace osu.Game.Rulesets.Mods
shader.Unbind();
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
quadBatch?.Dispose();
}
}
}
}

View File

@ -20,6 +20,7 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.UI;
using osuTK;
using osuTK.Graphics;
@ -360,6 +361,10 @@ namespace osu.Game.Skinning
}
}
/// <summary>
/// A sprite which is displayed within the playfield, but historically was not considered part of the playfield.
/// Performs scale adjustment to undo the scale applied by <see cref="PlayfieldAdjustmentContainer"/> (osu! ruleset specifically).
/// </summary>
private class NonPlayfieldSprite : Sprite
{
public override Texture Texture
@ -368,7 +373,8 @@ namespace osu.Game.Skinning
set
{
if (value != null)
value.ScaleAdjust *= 2f;
// stable "magic ratio". see OsuPlayfieldAdjustmentContainer for full explanation.
value.ScaleAdjust *= 1.6f;
base.Texture = value;
}
}

View File

@ -15,7 +15,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.730.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.807.0" />
<PackageReference Include="SharpCompress" Version="0.23.0" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" />

View File

@ -105,8 +105,8 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.730.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.730.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.807.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.807.0" />
<PackageReference Include="SharpCompress" Version="0.22.0" />
<PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" />