mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 22:34:09 +08:00
Merge master with conflicts resolved
This commit is contained in:
commit
d9fd054102
@ -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.
|
- **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.
|
- **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.
|
If your platform is not listed above, there is still a chance you can manually build it by following the instructions below.
|
||||||
|
@ -63,6 +63,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" />
|
<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>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -8,7 +8,6 @@ using osu.Framework.MathUtils;
|
|||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Rulesets.Osu.UI;
|
|
||||||
using osu.Game.Tests.Beatmaps;
|
using osu.Game.Tests.Beatmaps;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Tests
|
namespace osu.Game.Rulesets.Osu.Tests
|
||||||
@ -23,6 +22,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
[TestCase("slider-ticks")]
|
[TestCase("slider-ticks")]
|
||||||
[TestCase("repeat-slider")]
|
[TestCase("repeat-slider")]
|
||||||
[TestCase("uneven-repeat-slider")]
|
[TestCase("uneven-repeat-slider")]
|
||||||
|
[TestCase("old-stacking")]
|
||||||
public void Test(string name) => base.Test(name);
|
public void Test(string name) => base.Test(name);
|
||||||
|
|
||||||
protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject)
|
protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject)
|
||||||
@ -31,22 +31,22 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
{
|
{
|
||||||
case Slider slider:
|
case Slider slider:
|
||||||
foreach (var nested in slider.NestedHitObjects)
|
foreach (var nested in slider.NestedHitObjects)
|
||||||
yield return createConvertValue(nested);
|
yield return createConvertValue((OsuHitObject)nested);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
yield return createConvertValue(hitObject);
|
yield return createConvertValue((OsuHitObject)hitObject);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConvertValue createConvertValue(HitObject obj) => new ConvertValue
|
ConvertValue createConvertValue(OsuHitObject obj) => new ConvertValue
|
||||||
{
|
{
|
||||||
StartTime = obj.StartTime,
|
StartTime = obj.StartTime,
|
||||||
EndTime = (obj as IHasEndTime)?.EndTime ?? obj.StartTime,
|
EndTime = (obj as IHasEndTime)?.EndTime ?? obj.StartTime,
|
||||||
X = (obj as IHasPosition)?.X ?? OsuPlayfield.BASE_SIZE.X / 2,
|
X = obj.StackedPosition.X,
|
||||||
Y = (obj as IHasPosition)?.Y ?? OsuPlayfield.BASE_SIZE.Y / 2,
|
Y = obj.StackedPosition.Y
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Beatmaps
|
namespace osu.Game.Rulesets.Osu.Beatmaps
|
||||||
{
|
{
|
||||||
@ -208,17 +209,22 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
|||||||
if (beatmap.HitObjects[j].StartTime - stackThreshold > startTime)
|
if (beatmap.HitObjects[j].StartTime - stackThreshold > startTime)
|
||||||
break;
|
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)
|
if (Vector2Extensions.Distance(beatmap.HitObjects[j].Position, currHitObject.Position) < stack_distance)
|
||||||
{
|
{
|
||||||
currHitObject.StackHeight++;
|
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.
|
//Case for sliders - bump notes down and right, rather than up and left.
|
||||||
sliderStack++;
|
sliderStack++;
|
||||||
beatmap.HitObjects[j].StackHeight -= 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -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
|
@ -13,13 +13,15 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
private readonly Container content;
|
private readonly Container content;
|
||||||
|
|
||||||
|
private const float playfield_size_adjust = 0.8f;
|
||||||
|
|
||||||
public OsuPlayfieldAdjustmentContainer()
|
public OsuPlayfieldAdjustmentContainer()
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
// Calculated from osu!stable as 512 (default gamefield size) / 640 (default window size)
|
// 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
|
InternalChild = new Container
|
||||||
{
|
{
|
||||||
@ -41,7 +43,19 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
{
|
{
|
||||||
base.Update();
|
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);
|
Scale = new Vector2(Parent.ChildSize.X / OsuPlayfield.BASE_SIZE.X);
|
||||||
|
// Size = 0.625
|
||||||
Size = Vector2.Divide(Vector2.One, Scale);
|
Size = Vector2.Divide(Vector2.One, Scale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
109
osu.Game.Tests/Visual/Online/TestSceneUserRequest.cs
Normal file
109
osu.Game.Tests/Visual/Online/TestSceneUserRequest.cs
Normal 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}"
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -2,18 +2,21 @@
|
|||||||
// 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.Game.Users;
|
using osu.Game.Users;
|
||||||
|
using osu.Game.Rulesets;
|
||||||
|
|
||||||
namespace osu.Game.Online.API.Requests
|
namespace osu.Game.Online.API.Requests
|
||||||
{
|
{
|
||||||
public class GetUserRequest : APIRequest<User>
|
public class GetUserRequest : APIRequest<User>
|
||||||
{
|
{
|
||||||
private readonly long? userId;
|
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.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}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
// 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.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using osu.Framework.IO.Network;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
|
using osu.Game.Rulesets;
|
||||||
|
|
||||||
namespace osu.Game.Online.API.Requests
|
namespace osu.Game.Online.API.Requests
|
||||||
{
|
{
|
||||||
@ -10,12 +12,24 @@ namespace osu.Game.Online.API.Requests
|
|||||||
{
|
{
|
||||||
private readonly long userId;
|
private readonly long userId;
|
||||||
private readonly ScoreType type;
|
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)
|
: base(page, itemsPerPage)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.type = type;
|
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()}";
|
protected override string Target => $@"users/{userId}/scores/{type.ToString().ToLowerInvariant()}";
|
||||||
|
@ -193,6 +193,12 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
|
|
||||||
shader.Unbind();
|
shader.Unbind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
quadBatch?.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ using osu.Game.Graphics;
|
|||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
|
using osu.Game.Rulesets.UI;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
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
|
private class NonPlayfieldSprite : Sprite
|
||||||
{
|
{
|
||||||
public override Texture Texture
|
public override Texture Texture
|
||||||
@ -368,7 +373,8 @@ namespace osu.Game.Skinning
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (value != null)
|
if (value != null)
|
||||||
value.ScaleAdjust *= 2f;
|
// stable "magic ratio". see OsuPlayfieldAdjustmentContainer for full explanation.
|
||||||
|
value.ScaleAdjust *= 1.6f;
|
||||||
base.Texture = value;
|
base.Texture = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" />
|
<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="SharpCompress" Version="0.23.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
@ -105,8 +105,8 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" />
|
<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="ppy.osu.Framework.iOS" Version="2019.730.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.807.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
Loading…
Reference in New Issue
Block a user